<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://switchbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Liamwhite</id>
	<title>Nintendo Switch Brew - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://switchbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Liamwhite"/>
	<link rel="alternate" type="text/html" href="https://switchbrew.org/wiki/Special:Contributions/Liamwhite"/>
	<updated>2026-04-29T21:15:31Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Applet_Manager_services&amp;diff=12626</id>
		<title>Applet Manager services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Applet_Manager_services&amp;diff=12626"/>
		<updated>2024-01-06T23:25:21Z</updated>

		<summary type="html">&lt;p&gt;Liamwhite: Fixup&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AM (Applet Manager) provides services for interacting with system applets while abstracting several aspects of power and operation management.&lt;br /&gt;
&lt;br /&gt;
Contains multiple raw images, with at least the following: &amp;quot;NN_OMM_CHARGING_BIN_{begin|end}&amp;quot;(charging icon), low-battery icon, and the Nintendo Switch logo displayed during system boot.&lt;br /&gt;
&lt;br /&gt;
= appletAE =&lt;br /&gt;
This is &amp;quot;nn::am::service::IAllSystemAppletProxiesService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 100 || OpenSystemAppletProxy || Returns an [[#ISystemAppletProxy]].&lt;br /&gt;
|-&lt;br /&gt;
| 200 || OpenLibraryAppletProxyOld ([1.0.0-2.3.0] OpenLibraryAppletProxy) || Returns an [[#ILibraryAppletProxy]].&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [3.0.0+] [[#OpenLibraryAppletProxy]] || Returns an [[#ILibraryAppletProxy]].&lt;br /&gt;
|-&lt;br /&gt;
| 300 || OpenOverlayAppletProxy || Returns an [[#IOverlayAppletProxy]].&lt;br /&gt;
|-&lt;br /&gt;
| 350 || OpenSystemApplicationProxy || Returns an [[#IApplicationProxy]].&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#CreateSelfLibraryAppletCreatorForDevelop]] || &lt;br /&gt;
|-&lt;br /&gt;
| 410 || [6.0.0+] [[#GetSystemAppletControllerForDebug]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [6.0.0+] [[#GetDebugFunctions]] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All of these Open*Proxy commands except [[#OpenLibraryAppletProxy]] take the same input as [[#OpenApplicationProxy]], with the same user-process retry-loop as [[#OpenApplicationProxy]]. These Open*Proxy commands (including appletOE) doesn&#039;t seem to usable from processes which aren&#039;t actual applets (such as sysmodules), at least for applet-types which aren&#039;t already in use.&lt;br /&gt;
&lt;br /&gt;
OpenLibraryAppletProxyOld eventually calls the same func as [[#OpenLibraryAppletProxy]], except that the [[#AppletAttribute]] is all-zero.&lt;br /&gt;
&lt;br /&gt;
This service is used by all system non-regular-applications.&lt;br /&gt;
&lt;br /&gt;
The 01000000000010XX system [[Title_list|titles]] use the following applet types(above Open{type}Proxy commands):&lt;br /&gt;
* &amp;quot;qlaunch&amp;quot;: SystemApplet&lt;br /&gt;
* &amp;quot;overlay&amp;quot;: OverlayApplet&lt;br /&gt;
* &amp;quot;starter&amp;quot;: SystemApplication&lt;br /&gt;
* &amp;quot;maintenance&amp;quot;: SystemApplet&lt;br /&gt;
* All others: LibraryApplet&lt;br /&gt;
&lt;br /&gt;
== OpenLibraryAppletProxy ==&lt;br /&gt;
Returns an [[#ILibraryAppletProxy]].&lt;br /&gt;
&lt;br /&gt;
Takes a [[IPC_Marshalling|reserved]] input u64(official user-processes use hard-coded value 0), a PID,a process copy-handle(cur-proc handle alias), and a type-0x15 input buffer containing an [[#AppletAttribute]].&lt;br /&gt;
&lt;br /&gt;
Official user-processes use the same retry loop with this as the other Open*Proxy commands.&lt;br /&gt;
&lt;br /&gt;
== CreateSelfLibraryAppletCreatorForDevelop ==&lt;br /&gt;
Takes a PID and an input u64 pid_placeholder, returns an [[#ILibraryAppletCreator]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; must be set to 0x1 with size 0x1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
== GetSystemAppletControllerForDebug ==&lt;br /&gt;
No input, returns an [[#ISystemAppletControllerForDebug]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; must be set to 0x1 with size 0x1, and various state checks must pass, otherwise 0 is returned with no output interface.&lt;br /&gt;
&lt;br /&gt;
== GetDebugFunctions ==&lt;br /&gt;
No input, returns an [[#IDebugFunctions]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; must be set to 0x1 with size 0x1, otherwise 0 is returned with no output interface.&lt;br /&gt;
&lt;br /&gt;
== ISystemAppletProxy ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ISystemAppletProxy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetSelfController || Returns an [[#ISelfController]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetWindowController || Returns an [[#IWindowController]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetAudioController || Returns an [[#IAudioController]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetDisplayController || Returns an [[#IDisplayController]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].&lt;br /&gt;
|-&lt;br /&gt;
| 20 || GetHomeMenuFunctions || Returns an [[#IHomeMenuFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 21 || GetGlobalStateController || Returns an [[#IGlobalStateController]].&lt;br /&gt;
|-&lt;br /&gt;
| 22 || GetApplicationCreator || Returns an [[#IApplicationCreator]].&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [7.0.0+] GetAppletCommonFunctions || Returns an [[#IAppletCommonFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IHomeMenuFunctions ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IHomeMenuFunctions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#RequestToGetForeground]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#LockForeground]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#UnlockForeground]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#PopFromGeneralChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetPopFromGeneralChannelEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#GetHomeButtonWriterLockAccessor]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [2.0.0+] [[#GetWriterLockAccessorEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [11.0.0+] [[#IsSleepEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 41 || [12.0.0+] [[#IsRebootEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [16.0.0+] [[#LaunchSystemApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [16.0.0+] [[#LaunchStarter]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [6.0.0+] [[#PopRequestLaunchApplicationForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [9.0.0+] [[#IsForceTerminateApplicationDisabledForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [8.0.0+] [[#LaunchDevMenu]]&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [11.0.0+] [[#SetLastApplicationExitReason]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== RequestToGetForeground ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== LockForeground ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== UnlockForeground ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== PopFromGeneralChannel ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== GetPopFromGeneralChannelEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== GetHomeButtonWriterLockAccessor ====&lt;br /&gt;
No input, returns an output [[#ILockAccessor]].&lt;br /&gt;
&lt;br /&gt;
Similar to using [[#GetWriterLockAccessorEx]] with inval=0.&lt;br /&gt;
&lt;br /&gt;
==== GetWriterLockAccessorEx ====&lt;br /&gt;
Takes an input u32, returns an output [[#ILockAccessor]].&lt;br /&gt;
&lt;br /&gt;
The input value must be 0-3. 0 = HomeButton.&lt;br /&gt;
&lt;br /&gt;
==== IsSleepEnabled ====&lt;br /&gt;
No input, returns an output bool.&lt;br /&gt;
&lt;br /&gt;
==== IsRebootEnabled ====&lt;br /&gt;
No input, returns an output bool.&lt;br /&gt;
&lt;br /&gt;
==== LaunchSystemApplet ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This wraps [[NS_Services|ns]] LaunchSystemApplet, ignoring the u64 returned by that cmd (and other functionality).&lt;br /&gt;
&lt;br /&gt;
==== LaunchStarter ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is similar to [[#LaunchSystemApplet]], except this uses [[NS_Services|ns]] LaunchLibraryApplet with a ProgramId from global state.&lt;br /&gt;
&lt;br /&gt;
The global state field is initialized elsewhere with the value of [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!starter_id&amp;lt;/code&amp;gt;, defaulting to ProgramId 0100000000001012 ([[Title_list|starter]]) if not available.&lt;br /&gt;
&lt;br /&gt;
==== PopRequestLaunchApplicationForDebug ====&lt;br /&gt;
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output [[NCM_services#ApplicationId|ApplicationId]] and an output s32 &#039;&#039;&#039;total_userIDs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The total entries in the userID buffer must be &amp;gt;= {total userIDs in state}.&lt;br /&gt;
&lt;br /&gt;
==== IsForceTerminateApplicationDisabledForDebug ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
When the cached value loaded from [[Settings_services#GetDebugModeFlag]] is 0 this will just set the bool to 0. Otherwise, the bool is loaded using data from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!disable_force_terminate_application&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== LaunchDevMenu ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
Uses [[NS_Services|ns]] LaunchDevMenu.&lt;br /&gt;
&lt;br /&gt;
This is used by [[qlaunch]]. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== SetLastApplicationExitReason ====&lt;br /&gt;
Takes an input s32, no output.&lt;br /&gt;
&lt;br /&gt;
==== ILockAccessor ====&lt;br /&gt;
This is &amp;quot;nn::am::service::ILockAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#TryLock]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#Unlock]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [10.0.0+] [[#IsLocked]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== TryLock =====&lt;br /&gt;
Takes an input u8 bool flag, returns an output u8 bool flag and a handle.&lt;br /&gt;
&lt;br /&gt;
Official sw waits on the previously loaded event from [[#GetEvent]]. The output flag indicates whether locking was successful, the user-process can try using this cmd again when flag=false.&lt;br /&gt;
&lt;br /&gt;
Official sw only uses inflag=false. Official sw just closes the output handle. The input flag controls whether this returns the output handle.&lt;br /&gt;
&lt;br /&gt;
===== Unlock =====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
===== GetEvent =====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== IsLocked ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== IGlobalStateController ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IGlobalStateController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#RequestToEnterSleep]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#EnterSleep]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#StartSleepSequence]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#StartShutdownSequence]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#StartRebootSequence]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [7.0.0+] [[#IsAutoPowerDownRequested]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#LoadAndApplyIdlePolicySettings]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [2.0.0+] [[#NotifyCecSettingsChanged]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [3.0.0+] [[#SetDefaultHomeButtonLongPressTime]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [3.0.0+] [[#UpdateDefaultDisplayResolution]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [3.0.0+] [[#ShouldSleepOnBoot]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [4.0.0+] [[#GetHdcpAuthenticationFailedEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [12.0.0+] [[#OpenCradleFirmwareUpdater]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== RequestToEnterSleep ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
==== EnterSleep ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
==== StartSleepSequence ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Official sw uses hard-coded input value = 1.&lt;br /&gt;
&lt;br /&gt;
==== StartShutdownSequence ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== StartRebootSequence ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== IsAutoPowerDownRequested ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Uses [[#idle:sys]] cmd1.&lt;br /&gt;
&lt;br /&gt;
==== LoadAndApplyIdlePolicySettings ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Uses [[#idle:sys]] cmd LoadAndApplySettings.&lt;br /&gt;
&lt;br /&gt;
==== NotifyCecSettingsChanged ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Uses [[#omm]] cmd NotifyCecSettingsChanged.&lt;br /&gt;
&lt;br /&gt;
==== SetDefaultHomeButtonLongPressTime ====&lt;br /&gt;
Takes an input s64, no output.&lt;br /&gt;
&lt;br /&gt;
==== UpdateDefaultDisplayResolution ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Uses [[#omm]] cmd UpdateDefaultDisplayResolution.&lt;br /&gt;
&lt;br /&gt;
==== ShouldSleepOnBoot ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Uses [[#omm]] cmd ShouldSleepOnBoot.&lt;br /&gt;
&lt;br /&gt;
==== GetHdcpAuthenticationFailedEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
Uses [[#omm]] cmd GetHdcpAuthenticationFailedEvent.&lt;br /&gt;
&lt;br /&gt;
==== OpenCradleFirmwareUpdater ====&lt;br /&gt;
No input, returns an [[#ICradleFirmwareUpdater]].&lt;br /&gt;
&lt;br /&gt;
=== ICradleFirmwareUpdater ===&lt;br /&gt;
This is &amp;quot;nn::am::service::ICradleFirmwareUpdater&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [12.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || StartUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 1 || FinishUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetCradleDeviceInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetCradleDeviceInfoChangeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetUpdateProgressInfo&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetLastInternalResult&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GetCradleDeviceInfo ====&lt;br /&gt;
No input, returns a 8-byte CradleDeviceInfo.&lt;br /&gt;
&lt;br /&gt;
[13.0.0+] Now returns a total of 0xC-bytes.&lt;br /&gt;
&lt;br /&gt;
=== IApplicationCreator ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IApplicationCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#PopLaunchRequestedApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#CreateSystemApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#PopFloatingApplicationForDevelopment]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[#CreateApplication]]/[[#CreateSystemApplication]] eventually call the same internal func. With [[#CreateApplication]], two ptrs passed to the internal func are NULL, while with [[#CreateSystemApplication]] these are loaded from state. The initial content of [[#ApplicationLaunchRequestInfo]] is all-zero with [[#CreateSystemApplication]], while with [[#CreateApplication]] the first two u32s are value 0x3 with the rest all-zero. The [[#AppletId]] is set to 0x01 with [[#CreateApplication]], while with [[#CreateSystemApplication]] it&#039;s 0x04.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplication ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an [[#IApplicationAccessor]].&lt;br /&gt;
&lt;br /&gt;
==== PopLaunchRequestedApplication ====&lt;br /&gt;
No input, returns an [[#IApplicationAccessor]].&lt;br /&gt;
&lt;br /&gt;
==== CreateSystemApplication ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|SystemApplicationId]], returns an [[#IApplicationAccessor]].&lt;br /&gt;
&lt;br /&gt;
[[qlaunch]] only uses this with a hard-coded id for the &amp;quot;starter&amp;quot; title.&lt;br /&gt;
&lt;br /&gt;
==== PopFloatingApplicationForDevelopment ====&lt;br /&gt;
No input, returns an [[#IApplicationAccessor]].&lt;br /&gt;
&lt;br /&gt;
Should not be used if no FloatingApplication is available (svcBreak).&lt;br /&gt;
&lt;br /&gt;
==== IApplicationAccessor ====&lt;br /&gt;
This is &amp;quot;nn::am::service::IApplicationAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetAppletStateChangedEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#IsCompleted]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#Start]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#RequestExit]] || &lt;br /&gt;
|-&lt;br /&gt;
| 25 || [[#Terminate]] || &lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#GetResult]] || &lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#RequestForApplicationToGetForeground]] || &lt;br /&gt;
|-&lt;br /&gt;
| 110 || [[#TerminateAllLibraryApplets]] || &lt;br /&gt;
|-&lt;br /&gt;
| 111 || [[#AreAnyLibraryAppletsLeft]] || &lt;br /&gt;
|-&lt;br /&gt;
| 112 || [[#GetCurrentLibraryApplet]] || &lt;br /&gt;
|-&lt;br /&gt;
| 120 || [[#GetApplicationId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 121 || [[#PushLaunchParameter]] || &lt;br /&gt;
|-&lt;br /&gt;
| 122 || [[#GetApplicationControlProperty]] || &lt;br /&gt;
|-&lt;br /&gt;
| 123 || [2.0.0+] [[#GetApplicationLaunchProperty]] || &lt;br /&gt;
|-&lt;br /&gt;
| 124 || [6.0.0+] [[#GetApplicationLaunchRequestInfo]] || &lt;br /&gt;
|-&lt;br /&gt;
| 130 || [6.0.0+] [[#SetUsers]] || &lt;br /&gt;
|-&lt;br /&gt;
| 131 || [6.0.0+] [[#CheckRightsEnvironmentAvailable]] || &lt;br /&gt;
|-&lt;br /&gt;
| 132 || [6.0.0+] [[#GetNsRightsEnvironmentHandle]] || &lt;br /&gt;
|-&lt;br /&gt;
| 140 || [6.0.0+] [[#GetDesirableUids]] || &lt;br /&gt;
|-&lt;br /&gt;
| 150 || [6.0.0+] [[#ReportApplicationExitTimeout]] || &lt;br /&gt;
|-&lt;br /&gt;
| 160 || [8.0.0+] [[#SetApplicationAttribute]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 170 || [8.0.0+] [[#HasSaveDataAccessPermission]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 180 || [9.0.0+] [[#PushToFriendInvitationStorageChannel]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 190 || [9.0.0+] [[#PushToNotificationStorageChannel]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [10.0.0+] [[#RequestApplicationSoftReset]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [10.0.0+] [[#RestartApplicationTimer]] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Commands &amp;lt;=30 are inherited from [[#IAppletAccessor]].&lt;br /&gt;
&lt;br /&gt;
===== RequestForApplicationToGetForeground =====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
===== GetCurrentLibraryApplet =====&lt;br /&gt;
No input, returns an output [[#IAppletAccessor]].&lt;br /&gt;
&lt;br /&gt;
===== GetApplicationId =====&lt;br /&gt;
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].&lt;br /&gt;
&lt;br /&gt;
===== PushLaunchParameter =====&lt;br /&gt;
Takes an input u32 [[#LaunchParameterKind]] and an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
===== GetApplicationControlProperty =====&lt;br /&gt;
No input, takes a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
The output buffer must be at least 0x4000-bytes. Returns an error when the [[#AppletId]] is 0x04, aka when the IApplicationAccessor is for a SystemApplication. &lt;br /&gt;
&lt;br /&gt;
This gets the application [[NACP_Format|control.nacp]].&lt;br /&gt;
&lt;br /&gt;
===== GetApplicationLaunchProperty =====&lt;br /&gt;
Takes a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
The output buffer size must be at least 0x10-bytes. Returns an error when the [[#AppletId]] is 0x04, aka when the IApplicationAccessor is for a SystemApplication.&lt;br /&gt;
&lt;br /&gt;
This gets the [[#ApplicationLaunchProperty]].&lt;br /&gt;
&lt;br /&gt;
===== GetApplicationLaunchRequestInfo =====&lt;br /&gt;
No input, returns an output 0x10-byte struct.&lt;br /&gt;
&lt;br /&gt;
This gets the [[#ApplicationLaunchRequestInfo]] from state. The output struct is &amp;quot;nn::applet::ApplicationLaunchRequestInfo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== SetUsers =====&lt;br /&gt;
Takes an input u8 bool flag and a type-0x5 input buffer containing an array of u128 userIDs.&lt;br /&gt;
&lt;br /&gt;
The total entries for the userIDs must be &amp;lt;=8.&lt;br /&gt;
&lt;br /&gt;
When the input flag is true, this just clears the &#039;&#039;&#039;users_available&#039;&#039;&#039; state flag to 0 and returns.&lt;br /&gt;
&lt;br /&gt;
===== CheckRightsEnvironmentAvailable =====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
===== GetNsRightsEnvironmentHandle =====&lt;br /&gt;
No input, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
===== GetDesirableUids =====&lt;br /&gt;
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output s32 &#039;&#039;&#039;total_entries&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Gets a userID listing, this is unrelated to [[#SetUsers]]. [[qlaunch]] only uses 1 userID with this.&lt;br /&gt;
&lt;br /&gt;
The stored entry-count in state must be &amp;lt;= &amp;lt;size of output buffer in entries&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== ReportApplicationExitTimeout =====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
===== SetApplicationAttribute =====&lt;br /&gt;
Takes a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.&lt;br /&gt;
&lt;br /&gt;
===== HasSaveDataAccessPermission =====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u8 bool flag.&lt;br /&gt;
&lt;br /&gt;
Gets whether the savedata specified by the input ApplicationId is accessible. The output flag indicates whether it&#039;s accessible.&lt;br /&gt;
&lt;br /&gt;
If the ApplicationId matches the current application, this immediately returns success with flag=1.&lt;br /&gt;
&lt;br /&gt;
===== PushToFriendInvitationStorageChannel =====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
Clears the FriendInvitation StorageChannel, then pushes the input storage there.&lt;br /&gt;
&lt;br /&gt;
===== PushToNotificationStorageChannel =====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
Clears the Notification StorageChannel, then pushes the input storage there.&lt;br /&gt;
&lt;br /&gt;
[[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.&lt;br /&gt;
&lt;br /&gt;
===== RequestApplicationSoftReset =====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
===== RestartApplicationTimer =====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
===== IAppletAccessor =====&lt;br /&gt;
This is &amp;quot;nn::am::service::IAppletAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetAppletStateChangedEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#IsCompleted]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#Start]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#RequestExit]]&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [[#Terminate]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#GetResult]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GetAppletStateChangedEvent ====&lt;br /&gt;
No input, returns an output event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== IsCompleted ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
==== Start ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== RequestExit ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== Terminate ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== GetResult====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
== IAppletCommonFunctions ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IAppletCommonFunctions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [7.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [9.0.0+] [[#SetTerminateResult]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#ReadThemeStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#WriteThemeStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [9.0.0+] [[#PushToAppletBoundChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [9.0.0+] [[#TryPopFromAppletBoundChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [8.0.0+] [[#GetDisplayLogicalResolution]]&lt;br /&gt;
|-&lt;br /&gt;
| 42 || [8.0.0+] [[#SetDisplayMagnification]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [8.0.0+] [[#SetHomeButtonDoubleClickEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [8.0.0+] [[#GetHomeButtonDoubleClickEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 52 || [10.0.0+] [[#IsHomeButtonShortPressedBlocked]]&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [11.0.0+] [[#IsVrModeCurtainRequired]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || [12.0.0+] IsSleepRequiredByHighTemperature&lt;br /&gt;
|-&lt;br /&gt;
| 62 || [12.0.0+] IsSleepRequiredByLowBattery&lt;br /&gt;
|-&lt;br /&gt;
| 70 || [11.0.0+] [[#SetCpuBoostRequestPriority]]&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [14.0.0+] SetHandlingCaptureButtonShortPressedMessageEnabledForApplet&lt;br /&gt;
|-&lt;br /&gt;
| 81 || [14.0.0+] SetHandlingCaptureButtonLongPressedMessageEnabledForApplet&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [15.0.0+] OpenNamedChannelAsParent&lt;br /&gt;
|-&lt;br /&gt;
| 91 || [15.0.0+] OpenNamedChannelAsChild&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [15.0.0+] SetApplicationCoreUsageMode&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [17.0.0+] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
ReadThemeStorage/WriteThemeStorage: these commands copy data from/to a state buffer and the user specified buffer. The size of the state buffer is 0x400-bytes. The default content of the ThemeStorage prior to using the WriteThemeStorage cmd, is: &amp;lt;code&amp;gt;memset(statebuf, 0xAA, 0x400);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReadThemeStorage ===&lt;br /&gt;
Takes an input u64 &#039;&#039;&#039;offset&#039;&#039;&#039; and a type-0x22 output buffer, returns an output u64 &#039;&#039;&#039;actual_transfer_size&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== WriteThemeStorage ===&lt;br /&gt;
Takes an input u64 &#039;&#039;&#039;offset&#039;&#039;&#039; and a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
=== PushToAppletBoundChannel ===&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
This is similar to [[#PushToAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.&lt;br /&gt;
&lt;br /&gt;
=== TryPopFromAppletBoundChannel ===&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
This is similar to [[#TryPopFromAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.&lt;br /&gt;
&lt;br /&gt;
=== GetDisplayLogicalResolution ===&lt;br /&gt;
No input, returns an output s32 &#039;&#039;&#039;width&#039;&#039;&#039; and s32 &#039;&#039;&#039;height&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== SetDisplayMagnification ===&lt;br /&gt;
Takes an input float &#039;&#039;&#039;x&#039;&#039;&#039;, float &#039;&#039;&#039;y&#039;&#039;&#039;, float &#039;&#039;&#039;width&#039;&#039;&#039;, and float &#039;&#039;&#039;height&#039;&#039;&#039;, no output.&lt;br /&gt;
&lt;br /&gt;
Sets the DisplayMagnification. This is essentially layer image crop, for everything non-Overlay.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;x&#039;&#039;&#039; and &#039;&#039;&#039;width&#039;&#039;&#039; are multiplied with the same width value returned by [[#GetDisplayLogicalResolution]], so these should be in the range 0.0f-1.0f. Likewise for y and height, except these are multipled with the height value.&lt;br /&gt;
&lt;br /&gt;
=== SetHomeButtonDoubleClickEnabled ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== GetHomeButtonDoubleClickEnabled ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== IsHomeButtonShortPressedBlocked ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== IsVrModeCurtainRequired ===&lt;br /&gt;
No input, returns an output bool.&lt;br /&gt;
&lt;br /&gt;
=== SetCpuBoostRequestPriority ===&lt;br /&gt;
Takes an input s32, no output.&lt;br /&gt;
&lt;br /&gt;
== ILibraryAppletProxy ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ILibraryAppletProxy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetSelfController || Returns an [[#ISelfController]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetWindowController || Returns an [[#IWindowController]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetAudioController || Returns an [[#IAudioController]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetDisplayController || Returns an [[#IDisplayController]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].&lt;br /&gt;
|-&lt;br /&gt;
| 20 || OpenLibraryAppletSelfAccessor || Returns an [[#ILibraryAppletSelfAccessor]].&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [15.0.0+] GetHomeMenuFunctions || No input, returns an [[#IHomeMenuFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ILibraryAppletSelfAccessor ===&lt;br /&gt;
This is &amp;quot;nn::am::service::ILibraryAppletSelfAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#PopInData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#PushOutData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#PopInteractiveInData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#PushInteractiveOutData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetPopInDataEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#GetPopInteractiveInDataEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#ExitProcessAndReturn]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#GetLibraryAppletInfo]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#GetMainAppletIdentityInfo]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#CanUseApplicationCore]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#GetCallerAppletIdentityInfo]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [2.0.0+] [[#GetMainAppletApplicationControlProperty]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [2.0.0+] [[#GetMainAppletStorageId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [3.0.0+] [[#GetCallerAppletIdentityInfoStack]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [4.0.0+] [[#GetNextReturnDestinationAppletIdentityInfo]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [4.0.0+] [[#GetDesirableKeyboardLayout]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#PopExtraStorage]] || &lt;br /&gt;
|-&lt;br /&gt;
| 25 || [[#GetPopExtraStorageEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#UnpopInData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 31 || [[#UnpopExtraStorage]] || &lt;br /&gt;
|-&lt;br /&gt;
| 40 || [2.0.0+] [[#GetIndirectLayerProducerHandle]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [3.0.0+] [[#ReportVisibleError]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [4.0.0+] [[#ReportVisibleErrorWithErrorContext]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [4.0.0+] [[#GetMainAppletApplicationDesiredLanguage]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 70 || [8.0.0+] [[#GetCurrentApplicationId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [6.0.0+] [[#RequestExitToSelf]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [5.0.0+] [[#CreateApplicationAndPushAndRequestToLaunch]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [4.0.0+] [[#CreateGameMovieTrimmer]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [5.0.0+] [[#ReserveResourceForMovieOperation]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [5.0.0+] [[#UnreserveResourceForMovieOperation]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [6.0.0+] [[#GetMainAppletAvailableUsers]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [9.0.0+] [[#GetLaunchStorageInfoForDebug]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 130 || [9.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 140 || [10.0.0+] [[#SetApplicationMemoryReservation]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 150 || [10.0.0+] [[#ShouldSetGpuTimeSliceManually]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 160 || [17.0.0+] [[#Cmd160]] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== PopInData ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== PushOutData ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== PopInteractiveInData ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== PushInteractiveOutData ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== GetPopInDataEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== GetPopInteractiveInDataEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== ExitProcessAndReturn ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Exits the LibraryApplet and returns to running the title which launched this LibraryApplet ([[qlaunch]] for example).&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== GetLibraryAppletInfo ====&lt;br /&gt;
No input, returns an output [[#LibraryAppletInfo]].&lt;br /&gt;
&lt;br /&gt;
==== GetMainAppletIdentityInfo ====&lt;br /&gt;
No input, returns an output [[#AppletIdentityInfo]].&lt;br /&gt;
&lt;br /&gt;
==== CanUseApplicationCore ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
==== GetCallerAppletIdentityInfo ====&lt;br /&gt;
No input, returns an output [[#AppletIdentityInfo]].&lt;br /&gt;
&lt;br /&gt;
==== GetMainAppletApplicationControlProperty ====&lt;br /&gt;
No input, takes a type-0x16 output buffer.&lt;br /&gt;
&lt;br /&gt;
This gets the [[NACP_Format|control.nacp]].&lt;br /&gt;
&lt;br /&gt;
==== GetMainAppletStorageId ====&lt;br /&gt;
No input, returns an output u8 storageId.&lt;br /&gt;
&lt;br /&gt;
==== GetCallerAppletIdentityInfoStack ====&lt;br /&gt;
Takes a type-0x6 output buffer containing an array of [[#AppletIdentityInfo]], and returns an output s32 total_entries.&lt;br /&gt;
&lt;br /&gt;
==== GetNextReturnDestinationAppletIdentityInfo ====&lt;br /&gt;
No input, returns an output [[#AppletIdentityInfo]].&lt;br /&gt;
&lt;br /&gt;
==== GetDesirableKeyboardLayout ====&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
The output u32 is &amp;quot;nn::settings::KeyboardLayout&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This gets the value previously set by [[#SetDesirableKeyboardLayout]]. An error is returned if it&#039;s not set.&lt;br /&gt;
&lt;br /&gt;
==== PopExtraStorage ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== GetPopExtraStorageEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== UnpopInData ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== UnpopExtraStorage ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== GetIndirectLayerProducerHandle ====&lt;br /&gt;
No input, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
==== ReportVisibleError ====&lt;br /&gt;
Takes an input [[Error_Applet#ErrorCode|ErrorCode]], no output.&lt;br /&gt;
&lt;br /&gt;
==== ReportVisibleErrorWithErrorContext ====&lt;br /&gt;
Takes an input [[Error_Applet#ErrorCode|ErrorCode]] and a type-0x15 input buffer containing an [[Error_Applet#ErrorContext|ErrorContext]], no output.&lt;br /&gt;
&lt;br /&gt;
==== GetMainAppletApplicationDesiredLanguage ====&lt;br /&gt;
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].&lt;br /&gt;
&lt;br /&gt;
==== GetCurrentApplicationId ====&lt;br /&gt;
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].&lt;br /&gt;
&lt;br /&gt;
Gets the [[NCM_services#ApplicationId|ApplicationId]] for the currently running Application. ApplicationId=0 when no Application is running.&lt;br /&gt;
&lt;br /&gt;
==== RequestExitToSelf ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#RequestExit]] except this is for the current applet.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationAndPushAndRequestToLaunch ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input #IStorage, no output.&lt;br /&gt;
&lt;br /&gt;
This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].&lt;br /&gt;
&lt;br /&gt;
==== CreateGameMovieTrimmer ====&lt;br /&gt;
Takes an input u64 size and a TransferMemory handle, returns a GRC [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].&lt;br /&gt;
&lt;br /&gt;
This is a wrapper for GRC [[GRC_services#OpenGameMovieTrimmer|OpenGameMovieTrimmer]].&lt;br /&gt;
&lt;br /&gt;
Official sw uses an user-buffer for the tmem, with permissions=0.&lt;br /&gt;
&lt;br /&gt;
==== ReserveResourceForMovieOperation ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Updates state fields. This must be used before [[#CreateGameMovieTrimmer]].&lt;br /&gt;
&lt;br /&gt;
==== UnreserveResourceForMovieOperation ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Updates state fields. This must be used once finished with [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].&lt;br /&gt;
&lt;br /&gt;
==== GetMainAppletAvailableUsers ====&lt;br /&gt;
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output u8 bool and a s32 &#039;&#039;&#039;total_entries&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This gets the userIDs previously set by [[#SetUsers]].&lt;br /&gt;
&lt;br /&gt;
The size of the output buffer in entries must be at least 8.&lt;br /&gt;
&lt;br /&gt;
Normally the output bool is set to 0, however when no users are available it&#039;s set to 1 with &#039;&#039;&#039;total_entries&#039;&#039;&#039; = -1.&lt;br /&gt;
&lt;br /&gt;
==== SetApplicationMemoryReservation ====&lt;br /&gt;
Takes an input u64, no output.&lt;br /&gt;
&lt;br /&gt;
An Application must be currently running. The input u64 must be 0x1000-byte aligned.&lt;br /&gt;
&lt;br /&gt;
==== ShouldSetGpuTimeSliceManually ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
==== Cmd160 ====&lt;br /&gt;
No input, returns an output u64. Currently always returns 0.&lt;br /&gt;
&lt;br /&gt;
== IOverlayAppletProxy ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IOverlayAppletProxy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetSelfController || Returns an [[#ISelfController]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetWindowController || Returns an [[#IWindowController]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetAudioController || Returns an [[#IAudioController]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetDisplayController || Returns an [[#IDisplayController]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].&lt;br /&gt;
|-&lt;br /&gt;
| 20 || GetOverlayFunctions || Returns an [[#IOverlayFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IOverlayFunctions ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IOverlayFunctions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#BeginToWatchShortHomeButtonMessage]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#EndToWatchShortHomeButtonMessage]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetApplicationIdForLogo]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#SetGpuTimeSliceBoost]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [2.0.0+] [[#SetAutoSleepTimeAndDimmingTimeEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [2.0.0+] [[#TerminateApplicationAndSetReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [3.0.0+] [[#SetScreenShotPermissionGlobally]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [6.0.0+] [[#StartShutdownSequenceForOverlay]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [6.0.0+] [[#StartRebootSequenceForOverlay]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [14.0.0+] SetHandlingTouchScreenInputEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [9.0.0+] [[#SetHealthWarningShowingState]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [10.0.0+] [[#IsHealthWarningRequired]]&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [5.0.0+] [[#BeginToObserveHidInputForDevelop]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== BeginToWatchShortHomeButtonMessage ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== EndToWatchShortHomeButtonMessage ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== GetApplicationIdForLogo ====&lt;br /&gt;
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].&lt;br /&gt;
&lt;br /&gt;
Gets the ApplicationId for displaying the logo screen during application launch.&lt;br /&gt;
&lt;br /&gt;
When no application is running, this returns success with ApplicationId=0.&lt;br /&gt;
&lt;br /&gt;
==== SetGpuTimeSliceBoost ====&lt;br /&gt;
Takes an input u64, no output.&lt;br /&gt;
&lt;br /&gt;
==== SetAutoSleepTimeAndDimmingTimeEnabled ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== TerminateApplicationAndSetReason ====&lt;br /&gt;
Takes an input u32 Result, no output.&lt;br /&gt;
&lt;br /&gt;
==== SetScreenShotPermissionGlobally ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== StartShutdownSequenceForOverlay ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== StartRebootSequenceForOverlay ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== SetHandlingHomeButtonShortPressedEnabled ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== SetHealthWarningShowingState ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
This writes the input bool into state, signals an Event, and returns 0.&lt;br /&gt;
&lt;br /&gt;
==== IsHealthWarningRequired ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
==== SetRequiresGpuResourceUse ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Just returns 0.&lt;br /&gt;
&lt;br /&gt;
==== BeginToObserveHidInputForDevelop ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Sets various state fields and signals an userspace-event.&lt;br /&gt;
&lt;br /&gt;
Enables HID input for the OverlayApplet, without disabling input for the foreground applet.&lt;br /&gt;
&lt;br /&gt;
== IApplicationProxy ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IApplicationProxy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetSelfController || Returns an [[#ISelfController]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetWindowController || Returns an [[#IWindowController]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetAudioController || Returns an [[#IAudioController]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetDisplayController || Returns an [[#IDisplayController]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].&lt;br /&gt;
|-&lt;br /&gt;
| 20 || GetApplicationFunctions || Returns an [[#IApplicationFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IApplicationFunctions ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IApplicationFunctions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#PopLaunchParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#CreateApplicationAndPushAndRequestToStart]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#EnsureSaveData]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetDesiredLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [[#SetTerminateResult]]&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [[#GetDisplayVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [3.0.0+] ExtendSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 26 || [3.0.0+] GetSaveDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 27 || [5.0.0+] CreateCacheStorage&lt;br /&gt;
|-&lt;br /&gt;
| 28 || [11.0.0+] [[#GetSaveDataSizeMax]]&lt;br /&gt;
|-&lt;br /&gt;
| 29 || [11.0.0+] [[#GetCacheStorageMax]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]]&lt;br /&gt;
|-&lt;br /&gt;
| 32 || [[#BeginBlockingHomeButton]]&lt;br /&gt;
|-&lt;br /&gt;
| 33 || [[#EndBlockingHomeButton]]&lt;br /&gt;
|-&lt;br /&gt;
| 34 || [10.0.0-15.0.1] [[#SelectApplicationLicense]]&lt;br /&gt;
|-&lt;br /&gt;
| 35 || [11.0.0+] [[#GetDeviceSaveDataSizeMax]]&lt;br /&gt;
|-&lt;br /&gt;
| 36 || [14.0.0+] GetLimitedApplicationLicense&lt;br /&gt;
|-&lt;br /&gt;
| 37 || [14.0.0+] GetLimitedApplicationLicenseUpgradableEvent&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [[#NotifyRunning]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [2.0.0+] [[#GetPseudoDeviceId]]&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]]&lt;br /&gt;
|-&lt;br /&gt;
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]]&lt;br /&gt;
|-&lt;br /&gt;
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]]&lt;br /&gt;
|-&lt;br /&gt;
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 70 || [3.0.0+] [[#RequestToShutdown]]&lt;br /&gt;
|-&lt;br /&gt;
| 71 || [3.0.0+] [[#RequestToReboot]]&lt;br /&gt;
|-&lt;br /&gt;
| 72 || [10.0.0+] [[#RequestToSleep]]&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]]&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]] &lt;br /&gt;
|-&lt;br /&gt;
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]]&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]]&lt;br /&gt;
|-&lt;br /&gt;
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]]&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [5.0.0+] [[#ExecuteProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 121 || [5.0.0+] [[#ClearUserChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 122 || [5.0.0+] [[#UnpopToUserChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]]&lt;br /&gt;
|-&lt;br /&gt;
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]]&lt;br /&gt;
|-&lt;br /&gt;
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 131 || [11.0.0+] [[#SetDelayTimeToAbortOnGpuError]]&lt;br /&gt;
|-&lt;br /&gt;
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]] &lt;br /&gt;
|-&lt;br /&gt;
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 160 || [9.0.0+] [[#GetHealthWarningDisappearedSystemEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 170 || [9.0.0+] [[#SetHdcpAuthenticationActivated]]&lt;br /&gt;
|-&lt;br /&gt;
| 180 || [10.1.0+] [[#GetLaunchRequiredVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 181 || [10.1.0+] [[#UpgradeLaunchRequiredVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 190 || [11.0.0+] [[#SendServerMaintenanceOverlayNotification]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [11.0.0+] [[#GetLastApplicationExitReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [5.0.0+] [[#CreateMovieMaker]]&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || [5.0.0+] [[#PrepareForJit]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The BOTW game uses this GamePlayRecording functionality from the main-nso &amp;quot;nninitStartup&amp;quot; function, with size 0x6000000(96MiB). The official GamePlayRecording-enable code does the following(this will panic on any failure):&lt;br /&gt;
* [[SVC|Creates]] TransferMemory using the input buffer and size, with permissions=0.&lt;br /&gt;
* Uses [[#InitializeGamePlayRecording]] with the TransferMemory.&lt;br /&gt;
* Closes the TransferMemory handle, + TransferMemory cleanup.&lt;br /&gt;
* Uses [[#SetGamePlayRecordingState]] with value 0x1.&lt;br /&gt;
This GamePlayRecording functionality presumably enables the video-recording usable starting with [[4.0.0]].&lt;br /&gt;
&lt;br /&gt;
==== PopLaunchParameter ====&lt;br /&gt;
Takes an input u32 [[#LaunchParameterKind]], returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
Pops a LaunchParameter [[#IStorage]], the storage will be removed from sysmodule state during this.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationAndPushAndRequestToStart ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input [[#IStorage]], no output. ApplicationId=0 can be used to relaunch the current application.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationAndPushAndRequestToStartForQuest ====&lt;br /&gt;
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]), an input [[NCM_services#ApplicationId|ApplicationId]], and an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationAndRequestToStart ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#CreateApplicationAndPushAndRequestToStart]] except without the input storage, official sw uses this when no input storage is specified.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationAndRequestToStartForQuest ====&lt;br /&gt;
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]) and an input [[NCM_services#ApplicationId|ApplicationId]], no output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except without the input storage, official sw uses this when no input storage is specified.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]], a type-0x15 input buffer containing an [[#ApplicationAttribute]], an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationWithAttributeAndRequestToStartForQuest ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==== EnsureSaveData ====&lt;br /&gt;
Takes an input u128 userID, returns an output u64 size.&lt;br /&gt;
&lt;br /&gt;
Calls sdk func &amp;lt;code&amp;gt;nn::fs::EnsureApplicationSaveData&amp;lt;/code&amp;gt;. [[qlaunch]] also calls this same sdk func directly.&lt;br /&gt;
&lt;br /&gt;
Creates the various savedata as specified by the application [[NACP_Format|control.nacp]] when the savedata doesn&#039;t exist.&lt;br /&gt;
&lt;br /&gt;
Official user-processes launch the dataErase LibraryApplet depending on the Result, the above output size is used with this.&lt;br /&gt;
&lt;br /&gt;
==== GetDesiredLanguage ====&lt;br /&gt;
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].&lt;br /&gt;
&lt;br /&gt;
==== SetTerminateResult ====&lt;br /&gt;
Takes an input u32 &#039;&#039;&#039;Result&#039;&#039;&#039;, no output.&lt;br /&gt;
&lt;br /&gt;
For example, in some cases official apps use this with [[Error_codes|error]] 0x2A2 then uses svcBreak.&lt;br /&gt;
&lt;br /&gt;
==== GetDisplayVersion ====&lt;br /&gt;
No input, returns an output 0x10-byte struct.&lt;br /&gt;
&lt;br /&gt;
The output struct is &amp;quot;nn::oe::DisplayVersion&amp;quot;. This the DisplayVersion string copied from the application [[NACP_Format|control.nacp]], this is always NUL-terminated.&lt;br /&gt;
&lt;br /&gt;
==== GetLaunchStorageInfoForDebug ====&lt;br /&gt;
No input, returns an output u8 [[Filesystem_services#StorageId|StorageId]] and u8 [[Filesystem_services#StorageId|StorageId]].&lt;br /&gt;
&lt;br /&gt;
This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].&lt;br /&gt;
&lt;br /&gt;
==== GetSaveDataSizeMax ====&lt;br /&gt;
No input, returns two ouput s64s.&lt;br /&gt;
&lt;br /&gt;
==== GetCacheStorageMax ====&lt;br /&gt;
No input, returns an output s32 and s64.&lt;br /&gt;
&lt;br /&gt;
==== BeginBlockingHomeButtonShortAndLongPressed ====&lt;br /&gt;
Takes an input s64, no output.&lt;br /&gt;
&lt;br /&gt;
Official user-processes use hard-coded value 0 for the s64.&lt;br /&gt;
&lt;br /&gt;
Starts blocking the Home button.&lt;br /&gt;
&lt;br /&gt;
==== EndBlockingHomeButtonShortAndLongPressed ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Ends the blocking started by [[#BeginBlockingHomeButtonShortAndLongPressed]].&lt;br /&gt;
&lt;br /&gt;
==== BeginBlockingHomeButton ====&lt;br /&gt;
Takes an input s64 nanoseconds, no output. The input nanoseconds can be zero.&lt;br /&gt;
&lt;br /&gt;
==== EndBlockingHomeButton ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== SelectApplicationLicense ====&lt;br /&gt;
Takes an input array of [[#ApplicationLicenseType]], returns an output [[#ApplicationLicenseType]].&lt;br /&gt;
&lt;br /&gt;
==== GetDeviceSaveDataSizeMax ====&lt;br /&gt;
No input, returns two output s64s.&lt;br /&gt;
&lt;br /&gt;
==== NotifyRunning ====&lt;br /&gt;
Takes no input. Returns an output u8 bool, which is ignored by official user-processes.&lt;br /&gt;
&lt;br /&gt;
==== GetPseudoDeviceId ====&lt;br /&gt;
No input, returns an output 0x10-byte &amp;quot;nn::util::Uuid&amp;quot; struct.&lt;br /&gt;
&lt;br /&gt;
The 0x20-byte output data from [[NS_Services|GetSystemSeedForPseudoDeviceId]] followed by the 8-byte [[NACP_Format|SeedForPseudoDeviceId]] from the current control.nacp, is hashed with SHA1. Then &amp;quot;nn::util::GenerateUuidVersion5&amp;quot; is called with the final hash, the output from this is then returned for the Uuid.&lt;br /&gt;
&lt;br /&gt;
==== SetMediaPlaybackStateForApplication ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== IsGamePlayRecordingSupported ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
==== InitializeGamePlayRecording ====&lt;br /&gt;
Takes a TransferMemory handle and an u64 for the size of the TransferMemory. The size must match 0x6000000 otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
==== SetGamePlayRecordingState ====&lt;br /&gt;
Takes an input u32. 0 = disable/pause, 1 = enable/restart.&lt;br /&gt;
&lt;br /&gt;
==== RequestFlushGamePlayingMovieForDebug ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Requests to save the video recording, as if the Capture-button was held.&lt;br /&gt;
&lt;br /&gt;
==== RequestToShutdown ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== RequestToReboot ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== RequestToSleep ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== ExitAndRequestToShowThanksMessage ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Used to exit the application and return to the kiosk menu. Official sw uses [[#UnlockExit]] immediately before this if needed.&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
This throws an error when the cached [[Settings_services#GetQuestFlag]] value is 0.&lt;br /&gt;
&lt;br /&gt;
==== EnableApplicationCrashReport ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== InitializeApplicationCopyrightFrameBuffer ====&lt;br /&gt;
Takes an input TransferMemory handle, an s32 &#039;&#039;&#039;width&#039;&#039;&#039;, an s32 &#039;&#039;&#039;height&#039;&#039;&#039;, an u64 tmem_size, and no output.&lt;br /&gt;
&lt;br /&gt;
tmem_size must be 0x40000-byte aligned. &#039;&#039;&#039;width&#039;&#039;&#039; must be 1-1280, and &#039;&#039;&#039;height&#039;&#039;&#039; must be 1-720.&lt;br /&gt;
&lt;br /&gt;
User-processes create the tmem with an user-specified buffer with permissions=0. &#039;&#039;&#039;width&#039;&#039;&#039; = 1280 and &#039;&#039;&#039;height&#039;&#039;&#039; = 720.&lt;br /&gt;
&lt;br /&gt;
After the validation checks pass the input is passed to [[OMM_services|ommdisp]] cmd500.&lt;br /&gt;
&lt;br /&gt;
This is used as an overlay for screenshots.&lt;br /&gt;
&lt;br /&gt;
==== SetApplicationCopyrightImage ====&lt;br /&gt;
Takes a type-0x45 input buffer, an s32 &#039;&#039;&#039;x&#039;&#039;&#039;, an s32 &#039;&#039;&#039;y&#039;&#039;&#039;, an s32 &#039;&#039;&#039;width&#039;&#039;&#039;, an s32 &#039;&#039;&#039;height&#039;&#039;&#039;, an s32 [[#WindowOriginMode]], and no output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;x&#039;&#039;&#039; and &#039;&#039;&#039;y&#039;&#039;&#039; must not have the negative bit set. &#039;&#039;&#039;width&#039;&#039;&#039; and &#039;&#039;&#039;height&#039;&#039;&#039; must not be &amp;lt;1.&lt;br /&gt;
&lt;br /&gt;
Sets the RGBA8 image for use with [[#InitializeApplicationCopyrightFrameBuffer]]. Overrides the current image, if this was already used previously.&lt;br /&gt;
&lt;br /&gt;
==== SetApplicationCopyrightVisibility ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Sets the visibility for the image set by [[#SetApplicationCopyrightImage]], in screenshots. By default it&#039;s visible.&lt;br /&gt;
&lt;br /&gt;
==== QueryApplicationPlayStatistics ====&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The number of entries in each array is the same.&lt;br /&gt;
&lt;br /&gt;
See also [[NACP_Format#PlayLogQueryCapability|PlayLogQueryCapability]].&lt;br /&gt;
&lt;br /&gt;
This uses [[Shared_Database_services|pdm:qry]] QueryApplicationPlayStatisticsForSystem.&lt;br /&gt;
&lt;br /&gt;
==== QueryApplicationPlayStatisticsByUid ====&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs. &lt;br /&gt;
&lt;br /&gt;
==== ExecuteProgram ====&lt;br /&gt;
Takes an input u32 [[#ProgramSpecifyKind]] and an input u64, no output.&lt;br /&gt;
&lt;br /&gt;
==== ClearUserChannel ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Clears the UserChannel used by [[#UnpopToUserChannel]].&lt;br /&gt;
&lt;br /&gt;
==== UnpopToUserChannel ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
The input storage is pushed to the UserChannel. This is the same channel used by [[#LaunchParameterKind]] value 1.&lt;br /&gt;
&lt;br /&gt;
User-processes create a storage using data specified by the user (written to offset=0 size=inputsize), with max size 0x1000. This storage is then used with this cmd.&lt;br /&gt;
&lt;br /&gt;
==== GetPreviousProgramIndex ====&lt;br /&gt;
No input, returns an output s32.&lt;br /&gt;
&lt;br /&gt;
Gets the ProgramIndex of the Application which launched this title. The output ProgramIndex is -1 when there was no previous title.&lt;br /&gt;
&lt;br /&gt;
==== EnableApplicationAllThreadDumpOnCrash ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== GetGpuErrorDetectedSystemEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==== SetDelayTimeToAbortOnGpuError ====&lt;br /&gt;
Takes an input s64 &amp;quot;nn::TimeSpan&amp;quot;, no output.&lt;br /&gt;
&lt;br /&gt;
==== GetFriendInvitationStorageChannelEvent ====&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
This is exposed by sdknso under &amp;lt;code&amp;gt;nn::friends::&amp;lt;/code&amp;gt;. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.&lt;br /&gt;
&lt;br /&gt;
==== TryPopFromFriendInvitationStorageChannel ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
This uses the same StorageChannel as [[#PushToFriendInvitationStorageChannel]].&lt;br /&gt;
&lt;br /&gt;
This is exposed by sdknso under &amp;lt;code&amp;gt;nn::friends::&amp;lt;/code&amp;gt;. When the storage_size is &amp;lt;0x10, this returns false. &amp;lt;code&amp;gt;data_size = storage_size-0x10;&amp;lt;/code&amp;gt; Then the first 0x10-bytes from storage are read to stack, which is later copied to the output Uid on success prior to returning. Then the storage is read into the specified output buffer with storage-offset 0x10, where the size is &amp;lt;code&amp;gt;size = data_size &amp;gt; buf_size ? buf_size : data_size&amp;lt;/code&amp;gt;. Reading is skipped if size is zero. Afterwards the used size is written to an output param. On success, true is returned.&lt;br /&gt;
&lt;br /&gt;
==== GetNotificationStorageChannelEvent ====&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
This is exposed by sdknso under &amp;lt;code&amp;gt;nn::notification::&amp;lt;/code&amp;gt;. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.&lt;br /&gt;
&lt;br /&gt;
==== TryPopFromNotificationStorageChannel ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
This uses the same StorageChannel as [[#PushToNotificationStorageChannel]].&lt;br /&gt;
&lt;br /&gt;
This is exposed by sdknso under &amp;lt;code&amp;gt;nn::notification::&amp;lt;/code&amp;gt;. The storage is read into the specified output buffer, where the size is &amp;lt;code&amp;gt;size = storage_size &amp;gt; buf_size ? buf_size : storage_size&amp;lt;/code&amp;gt;. Reading is skipped if size is zero. Afterwards the used size is written to an output param.&lt;br /&gt;
&lt;br /&gt;
==== GetHealthWarningDisappearedSystemEvent ====&lt;br /&gt;
No input, returns an output Event with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
==== SetHdcpAuthenticationActivated ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== GetLaunchRequiredVersion ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]], an u64, returns an output [[#LaunchRequiredVersion]].&lt;br /&gt;
&lt;br /&gt;
sdknso passes hard-coded value 0 for the u64.&lt;br /&gt;
&lt;br /&gt;
==== UpgradeLaunchRequiredVersion ====&lt;br /&gt;
Takes an input [[#LaunchRequiredVersion]], an [[NCM_services#ApplicationId|ApplicationId]], an u64, no output.&lt;br /&gt;
&lt;br /&gt;
sdknso passes hard-coded value 0 for the u64.&lt;br /&gt;
&lt;br /&gt;
==== SendServerMaintenanceOverlayNotification ====&lt;br /&gt;
Takes two input [[PCV_services#PosixTime|PosixTime]], no output.&lt;br /&gt;
&lt;br /&gt;
The second input value can optionally be 0.&lt;br /&gt;
&lt;br /&gt;
==== GetLastApplicationExitReason ====&lt;br /&gt;
No input, returns an output s32.&lt;br /&gt;
&lt;br /&gt;
==== StartContinuousRecordingFlushForDebug ====&lt;br /&gt;
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; must be set to 0x1 with size 0x1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
==== CreateMovieMaker ====&lt;br /&gt;
Takes an input u64 size and a TransferMemory handle, returns an [[#IMovieMaker]].&lt;br /&gt;
&lt;br /&gt;
Official sw retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first.&lt;br /&gt;
&lt;br /&gt;
Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.&lt;br /&gt;
&lt;br /&gt;
==== PrepareForJit ====&lt;br /&gt;
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&amp;lt;&amp;gt; for jit-sysmodule process tracking object as an IApplicationFunctions member.&lt;br /&gt;
&lt;br /&gt;
~IApplicationFunctions() includes:&lt;br /&gt;
&lt;br /&gt;
    if (this-&amp;gt;jit_process) {&lt;br /&gt;
        Terminate(this-&amp;gt;jit_process);&lt;br /&gt;
        this-&amp;gt;jit_process = nullptr;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
AM can also optionally launch jit-sysmodule automatically if the [[NACP]] enables it.&lt;br /&gt;
&lt;br /&gt;
=== IMovieMaker ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IMovieMaker&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetGrcMovieMaker]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetLayerHandle]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GetGrcMovieMaker ====&lt;br /&gt;
No input, returns a GRC [[GRC_services|IMovieMaker]].&lt;br /&gt;
&lt;br /&gt;
==== GetLayerHandle ====&lt;br /&gt;
No input, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
== ILibraryAppletCreator ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ILibraryAppletCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateLibraryApplet]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#TerminateAllLibraryApplets]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#AreAnyLibraryAppletsLeft]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#CreateStorage]] || &lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#CreateTransferMemoryStorage]] || &lt;br /&gt;
|-&lt;br /&gt;
| 12 || [2.0.0+] [[#CreateHandleStorage]] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== CreateLibraryApplet ===&lt;br /&gt;
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].&lt;br /&gt;
&lt;br /&gt;
=== TerminateAllLibraryApplets ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.&lt;br /&gt;
&lt;br /&gt;
Terminates all LibraryApplets which were created by the current applet (or by the Application when used from the [[#IApplicationAccessor]] cmd).&lt;br /&gt;
&lt;br /&gt;
=== AreAnyLibraryAppletsLeft ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
=== CreateStorage ===&lt;br /&gt;
Takes an input s64 for the storage size, returns an [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
This allocates a buffer with the specified size which can then be accessed via [[#IStorageAccessor]].&lt;br /&gt;
&lt;br /&gt;
=== CreateTransferMemoryStorage ===&lt;br /&gt;
Takes an input TransferMemory copy-handle, an input u8 bool, and an s64 size, returns an [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
The user-process creates the TransferMemory with permissions=0.&lt;br /&gt;
&lt;br /&gt;
The TransferMemory is mapped, which can then be accessed via [[#IStorageAccessor]]. The input bool controls whether writing to the storage is allowed: [[#Write]] will throw an error if this flag is not set.&lt;br /&gt;
&lt;br /&gt;
=== CreateHandleStorage ===&lt;br /&gt;
Takes an input copy-handle and an input s64, returns an [[#IStorage]]. In some cases the s64 must not have the negative bit set.&lt;br /&gt;
&lt;br /&gt;
The input can be arbitrary, however official sw is only (?) known to use this for TransferMemory (with s64=size).&lt;br /&gt;
&lt;br /&gt;
=== ILibraryAppletAccessor ===&lt;br /&gt;
This is &amp;quot;nn::am::service::ILibraryAppletAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetAppletStateChangedEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#IsCompleted]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#Start]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#RequestExit]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [[#Terminate]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#GetResult]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [10.0.0+] [[#PresetLibraryAppletGpuTimeSliceZero]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#PushInData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#PopOutData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#PushExtraStorage]] || &lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#PushInteractiveInData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 104 || [[#PopInteractiveOutData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 105 || [[#GetPopOutDataEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 106 || [[#GetPopInteractiveOutDataEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [[#NeedsToExitProcess]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [[#GetLibraryAppletInfo]] || &lt;br /&gt;
|-&lt;br /&gt;
| 150 || [[#RequestForAppletToGetForeground]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Commands &amp;lt;=30 are inherited from [[#IAppletAccessor]]. GetLibraryAppletInfo is identical to the [[#ILibraryAppletSelfAccessor]] cmd.&lt;br /&gt;
&lt;br /&gt;
==== SetOutOfFocusApplicationSuspendingEnabled ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Official sw will assert prior to using this if applet-service was not initialized as *Application.&lt;br /&gt;
&lt;br /&gt;
==== PresetLibraryAppletGpuTimeSliceZero ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
sdknso only uses with with [[Software_Keyboard|swkbd-inline]], immediately after creating the LibraryApplet.&lt;br /&gt;
&lt;br /&gt;
==== PushInData ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== PopOutData ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== PushExtraStorage ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== PushInteractiveInData ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== PopInteractiveOutData ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== GetPopOutDataEvent ====&lt;br /&gt;
No input, returns an output handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== GetPopInteractiveOutDataEvent ====&lt;br /&gt;
No input, returns an output event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== NeedsToExitProcess ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
==== RequestForAppletToGetForeground ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
==== GetIndirectLayerConsumerHandle ====&lt;br /&gt;
Takes an input PID and an input u64 AppletResourceUserId, returns an output u64 IndirectLayerConsumerHandle.&lt;br /&gt;
&lt;br /&gt;
Official sw uses this during LibraryApplet creation when [[#LibraryAppletMode]] is 0x3.&lt;br /&gt;
&lt;br /&gt;
== ICommonStateGetter ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ICommonStateGetter&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetEventHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#ReceiveMessage]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetThisAppletKind]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#AllowToEnterSleep]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#DisallowToEnterSleep]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetOperationMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#GetPerformanceMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#GetCradleStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#GetBootMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#GetCurrentFocusState]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#RequestToAcquireSleepLock]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#ReleaseSleepLock]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#ReleaseSleepLockTransiently]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#GetAcquiredSleepLockEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [11.0.0+] [[#GetWakeupCount]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#PushToGeneralChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#GetHomeButtonReaderLockAccessor]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [2.0.0+] [[#GetCradleFwVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [3.0.0+] [[#IsVrModeEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [3.0.0+] [[#SetVrModeEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 53 || [7.0.0+] [[#BeginVrModeEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 54 || [7.0.0+] [[#EndVrModeEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]]&lt;br /&gt;
|-&lt;br /&gt;
| 59 || [11.0.0+] [[#SetVrPositionForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]]&lt;br /&gt;
|-&lt;br /&gt;
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]]&lt;br /&gt;
|-&lt;br /&gt;
| 66 || [6.0.0+] [[#SetCpuBoostMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 67 || [10.0.0+] [[#CancelCpuBoostMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 68 || [11.0.0+] [[#GetBuiltInDisplayType]]&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]]&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]]&lt;br /&gt;
|-&lt;br /&gt;
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [9.1.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [11.0.0+] [[#OpenMyGpuErrorHandler]]&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [13.0.0+] GetAppletLaunchedHistory&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [9.0.0+] [[#GetSettingsPlatformRegion]]&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [10.0.0+] [[#ActivateMigrationService]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [10.0.0+] [[#DeactivateMigrationService]]&lt;br /&gt;
|-&lt;br /&gt;
| 500 || [11.0.0+] [[#DisableSleepTillShutdown]]&lt;br /&gt;
|-&lt;br /&gt;
| 501 || [11.0.0+] [[#SuppressDisablingSleepTemporarily]]&lt;br /&gt;
|-&lt;br /&gt;
| 502 || [12.0.0+] IsSleepEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 503 || [12.0.0+] IsDisablingSleepSuppressed&lt;br /&gt;
|-&lt;br /&gt;
| 600 || [17.0.0+] OpenNamedChannelAsChild&lt;br /&gt;
|-&lt;br /&gt;
| 900 || [11.0.0+] [[#SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 910 || [17.0.0+] GetLaunchRequiredTick&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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]]).&lt;br /&gt;
&lt;br /&gt;
[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.&lt;br /&gt;
&lt;br /&gt;
=== GetEventHandle ===&lt;br /&gt;
No input. Returns an output event handle. This is signalled when a message is available with [[#ReceiveMessage]].&lt;br /&gt;
&lt;br /&gt;
=== ReceiveMessage ===&lt;br /&gt;
No input. Returns an output [[#AppletMessage]]. Error 0x680 indicates no message is available.&lt;br /&gt;
&lt;br /&gt;
=== GetThisAppletKind ===&lt;br /&gt;
No input, returns an output [[#AppletKind]].&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== AllowToEnterSleep ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== DisallowToEnterSleep ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== GetOperationMode ===&lt;br /&gt;
No input. Returns an output u8 for the current [[#OperationMode]].&lt;br /&gt;
&lt;br /&gt;
=== GetPerformanceMode ===&lt;br /&gt;
No input. Returns an output u32 for the current [[#PerformanceMode]].&lt;br /&gt;
&lt;br /&gt;
=== GetCradleStatus ===&lt;br /&gt;
No input, returns an output u8.&lt;br /&gt;
&lt;br /&gt;
This uses [[#omm]] GetCradleStatus.&lt;br /&gt;
&lt;br /&gt;
=== GetBootMode ===&lt;br /&gt;
No input, returns an output u8.&lt;br /&gt;
&lt;br /&gt;
Returns the value from [[Process_Manager_services|pm:bm]] GetBootMode.&lt;br /&gt;
&lt;br /&gt;
=== GetCurrentFocusState ===&lt;br /&gt;
No input. Returns an output u8 [[#FocusState]].&lt;br /&gt;
&lt;br /&gt;
=== RequestToAcquireSleepLock ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseSleepLock ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseSleepLockTransiently ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== GetAcquiredSleepLockEvent ===&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
=== GetWakeupCount ===&lt;br /&gt;
No input, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
=== PushToGeneralChannel ===&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
This is not usable under an Application, however it is usable under a LibraryApplet.&lt;br /&gt;
&lt;br /&gt;
Used for sending requests to [[qlaunch]]. sdk-nso creates a 0x10-byte storage which is sent to this. The following are the functions which use this, with the data written to the storage:&lt;br /&gt;
* &amp;lt;code&amp;gt;RequestHomeMenu&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;5341 4d53 0100 0000 0200 0000 0100 0000&amp;lt;/code&amp;gt; Returns to the main Home Menu, equivalent to pressing the HOME button.&lt;br /&gt;
* &amp;lt;code&amp;gt;RequestJumpToSystemUpdate&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;5341 4d53 0100 0000 0b00 0000 0100 0000&amp;lt;/code&amp;gt; Equivalent to entering &amp;quot;System Update&amp;quot; under System Settings. When leaving this, it returns to the main Home Menu.&lt;br /&gt;
&lt;br /&gt;
=== GetHomeButtonReaderLockAccessor ===&lt;br /&gt;
No input, returns an output [[#ILockAccessor]].&lt;br /&gt;
&lt;br /&gt;
Similar to using [[#GetReaderLockAccessorEx]] with inval=0.&lt;br /&gt;
&lt;br /&gt;
=== GetReaderLockAccessorEx ===&lt;br /&gt;
Takes an input u32, returns an output [[#ILockAccessor]].&lt;br /&gt;
&lt;br /&gt;
The input value must be 0-3. 0 = HomeButton.&lt;br /&gt;
&lt;br /&gt;
=== GetWriterLockAccessorEx ===&lt;br /&gt;
Takes an input u32, returns an output [[#ILockAccessor]].&lt;br /&gt;
&lt;br /&gt;
The input value must be 0-3. 0 = HomeButton.&lt;br /&gt;
&lt;br /&gt;
=== GetCradleFwVersion ===&lt;br /&gt;
No input, returns 4 output u32s.&lt;br /&gt;
&lt;br /&gt;
This uses [[#omm]] GetCradleFwVersion.&lt;br /&gt;
&lt;br /&gt;
=== IsVrModeEnabled ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== SetVrModeEnabled ===&lt;br /&gt;
Takes an input u8 bool flag. No output.&lt;br /&gt;
&lt;br /&gt;
Updates internal AM state fields. If the new state doesn&#039;t match the previous state, this uses the [[Backlight_services]] {Disable/Enable}VrMode command depending on whether flag={disable/enable}.&lt;br /&gt;
&lt;br /&gt;
When the VrMode is set to true, the console shows a screen rendered like vr asking the user to move his face away and hit the &#039;close&#039; button. When this button is pressed, the console resets the vrMode to false.&lt;br /&gt;
&lt;br /&gt;
=== SetLcdBacklighOffEnabled ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Sets whether the LCD screen blacklight is turned off.&lt;br /&gt;
&lt;br /&gt;
=== BeginVrModeEx ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=1.&lt;br /&gt;
&lt;br /&gt;
=== EndVrModeEx ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=0.&lt;br /&gt;
&lt;br /&gt;
=== IsInControllerFirmwareUpdateSection ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== SetVrPositionForDebug ===&lt;br /&gt;
Takes 4 input s32s, no output.&lt;br /&gt;
&lt;br /&gt;
The s32s are: x, y, width, height.&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
width must be 1-1280, height must be 1-720.&lt;br /&gt;
&lt;br /&gt;
x and y must not be negative. x+width must be &amp;lt;=1280. y+height must be &amp;lt;=720.&lt;br /&gt;
&lt;br /&gt;
=== GetDefaultDisplayResolution ===&lt;br /&gt;
No input, returns two output s32s &#039;&#039;&#039;width&#039;&#039;&#039; and &#039;&#039;&#039;height&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== GetDefaultDisplayResolutionChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle with autoclear=true.&lt;br /&gt;
&lt;br /&gt;
=== GetHdcpAuthenticationState ===&lt;br /&gt;
No input, returns an output s32.&lt;br /&gt;
&lt;br /&gt;
=== GetHdcpAuthenticationStateChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle with autoclear=true.&lt;br /&gt;
&lt;br /&gt;
=== SetTvPowerStateMatchingMode ===&lt;br /&gt;
Takes an input s32 [[#TvPowerStateMatchingMode]], no output.&lt;br /&gt;
&lt;br /&gt;
=== GetApplicationIdByContentActionName ===&lt;br /&gt;
Takes a type-0x5 input buffer containing a string, returns an output [[NCM_services#ApplicationId|ApplicationId]].&lt;br /&gt;
&lt;br /&gt;
Gets the ApplicationId for the specified ContentActionName string. Returns an error when the current [[#AppletId]] isn&#039;t 0x04 (when the current applet isn&#039;t a SystemApplication).&lt;br /&gt;
&lt;br /&gt;
=== SetCpuBoostMode ===&lt;br /&gt;
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].&lt;br /&gt;
&lt;br /&gt;
=== CancelCpuBoostMode ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== GetBuiltInDisplayType ===&lt;br /&gt;
No input, returns an output s32.&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
This loads a s32 index from global state (originates from [[SPL_services#GetConfig|GetConfig]] [[SMC#HardwareType|HardwareType]]), Aborts if it&#039;s out-of-bounds, then the following is returned for the output s32: global_array[loaded_index].&lt;br /&gt;
&lt;br /&gt;
=== PerformSystemButtonPressingIfInFocus ===&lt;br /&gt;
Takes an input [[#SystemButtonType]], no output.&lt;br /&gt;
&lt;br /&gt;
Just returns 0 when a state field is not value 1. Verifies that the input button is allowed, then calls the same func as [[#PerformSystemButtonPressing]] internally.&lt;br /&gt;
&lt;br /&gt;
=== SetPerformanceConfigurationChangedNotification ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== GetCurrentPerformanceConfiguration ===&lt;br /&gt;
No input, returns the result of calling [[PPC_services#apm:sys|GetCurrentPerformanceConfiguration]].&lt;br /&gt;
&lt;br /&gt;
=== OpenMyGpuErrorHandler ===&lt;br /&gt;
No input, returns an [[#IGpuErrorHandler]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
=== GetOperationModeSystemInfo ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
This returns the output from [[#GetOperationModeSystemInfo_2|omm GetOperationModeSystemInfo]].&lt;br /&gt;
&lt;br /&gt;
=== GetSettingsPlatformRegion ===&lt;br /&gt;
No input, returns an output u8.&lt;br /&gt;
&lt;br /&gt;
This just returns the output from [[Settings_services#GetPlatformRegion|setsys GetPlatformRegion]].&lt;br /&gt;
&lt;br /&gt;
=== ActivateMigrationService ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Besides various other functionality, if required this eventually uses [[NS_Services|ns]] LaunchLibraryApplet to launch [[Migration_services|migration]].&lt;br /&gt;
&lt;br /&gt;
=== DeactivateMigrationService ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== DisableSleepTillShutdown ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== SuppressDisablingSleepTemporarily ===&lt;br /&gt;
Takes an input u64 &amp;quot;nn::TimeSpanType&amp;quot;, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== IGpuErrorHandler ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IGpuErrorHandler&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [11.0.0+].&lt;br /&gt;
&lt;br /&gt;
This uses various [[NV_services#nvgem:cd|nvgem:cd]] commands.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#GetManualGpuErrorInfoSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#GetManualGpuErrorInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#GetManualGpuErrorDetectionSystemEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#FinishManualGpuErrorHandling]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GetManualGpuErrorInfoSize ====&lt;br /&gt;
No input, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
==== GetManualGpuErrorInfo ====&lt;br /&gt;
Takes a type-0x6 output buffer, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
The OutBuffer_size must be &amp;gt;= the output size from [[#GetManualGpuErrorInfoSize]].&lt;br /&gt;
&lt;br /&gt;
sdknso exposes the buffer as &amp;lt;code&amp;gt;void*&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== GetManualGpuErrorDetectionSystemEvent ====&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
==== FinishManualGpuErrorHandling ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
== ISelfController ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ISelfController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Exit]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#LockExit]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#UnlockExit]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] [[#EnterFatalSection]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [2.0.0+] [[#LeaveFatalSection]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#GetLibraryAppletLaunchableEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#SetScreenShotPermission]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#SetOperationModeChangedNotification]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#SetPerformanceModeChangedNotification]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#SetFocusHandlingMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#SetRestartMessageEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [2.0.0+] [[#SetScreenShotAppletIdentityInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [2.0.0+] [[#SetOutOfFocusSuspendingEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [3.0.0+] [[#SetControllerFirmwareUpdateSection]]&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [3.0.0+] [[#SetRequiresCaptureButtonShortPressedMessage]]&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [3.0.0+] [[#SetAlbumImageOrientation]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [13.0.0+] GetScreenShotProgramId&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [[#CreateManagedDisplayLayer]]&lt;br /&gt;
|-&lt;br /&gt;
| 41 || [4.0.0+] [[#IsSystemBufferSharingEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 42 || [4.0.0+] [[#GetSystemSharedLayerHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 44 || [10.0.0+] [[#CreateManagedDisplaySeparableLayer]]&lt;br /&gt;
|-&lt;br /&gt;
| 45 || [10.0.0+] [[#SetManagedDisplayLayerSeparationMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 46 || [13.0.0+] [[#SetRecordingLayerCompositionEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [[#SetHandlesRequestToDisplay]]&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [[#ApproveToDisplay]]&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#OverrideAutoSleepTimeAndDimmingTime]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || [[#SetMediaPlaybackState]]&lt;br /&gt;
|-&lt;br /&gt;
| 62 || [[#SetIdleTimeDetectionExtension]]&lt;br /&gt;
|-&lt;br /&gt;
| 63 || [[#GetIdleTimeDetectionExtension]]&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [[#SetInputDetectionSourceSet]]&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [2.0.0+] [[#ReportUserIsActive]]&lt;br /&gt;
|-&lt;br /&gt;
| 66 || [3.0.0+] [[#GetCurrentIlluminance]]&lt;br /&gt;
|-&lt;br /&gt;
| 67 || [3.0.0+] [[#IsIlluminanceAvailable]]&lt;br /&gt;
|-&lt;br /&gt;
| 68 || [5.0.0+] [[#SetAutoSleepDisabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 69 || [5.0.0+] [[#IsAutoSleepDisabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 70 || [4.0.0+] [[#ReportMultimediaError]]&lt;br /&gt;
|-&lt;br /&gt;
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 72 || [9.0.0+] [[#SetInputDetectionPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [6.0.0+] [[#GetAccumulatedSuspendedTickValue]]&lt;br /&gt;
|-&lt;br /&gt;
| 91 || [6.0.0+] [[#GetAccumulatedSuspendedTickChangedEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [7.0.0+] [[#SetAlbumImageTakenNotificationEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [11.0.0+] [[#SaveCurrentScreenshot]]&lt;br /&gt;
|-&lt;br /&gt;
| 130 || [13.0.0+] [[#SetRecordVolumeMuted]]&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Exit ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Exits the current applet. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
=== LockExit ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Locks exit process of pressing X to close in HOME Menu for an application or HOME button for an applet. When locked, it will show the &amp;quot;waiting for software to be closed dialog&amp;quot; until UnlockExit is called or a 15 seconds timeout (when the latter occurs, the process is force-terminated).&lt;br /&gt;
&lt;br /&gt;
=== UnlockExit ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Unlocks exit process, if LockExit was previously used.&lt;br /&gt;
&lt;br /&gt;
=== EnterFatalSection ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== LeaveFatalSection ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#EnterFatalSection]] must be executed at least once before executing this command, otherwise error code 0x40080 will be returned. EnterFatalSection and LeaveFatalSection work in pairs, that is, N calls to EnterFatalSection must be performed first in order to perform N executions of LeaveFatalSection. Essentially, these two functions operate like how one would lock and unlock a recursive mutex.&lt;br /&gt;
&lt;br /&gt;
=== GetLibraryAppletLaunchableEvent ===&lt;br /&gt;
No input, returns an output event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
=== SetScreenShotPermission ===&lt;br /&gt;
Takes an input s32. No output.&lt;br /&gt;
&lt;br /&gt;
Controls whether screenshot-capture is allowed.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Inherit from parent applet&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Enable&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Disable&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SetOperationModeChangedNotification ===&lt;br /&gt;
Takes an input u8 bool flag. No output.&lt;br /&gt;
&lt;br /&gt;
=== SetPerformanceModeChangedNotification ===&lt;br /&gt;
Takes an input u8 bool flag. No output.&lt;br /&gt;
&lt;br /&gt;
=== SetFocusHandlingMode ===&lt;br /&gt;
Takes 3 input u8s with each field located immediately after the previous u8, these are bool flags. No output.&lt;br /&gt;
&lt;br /&gt;
=== SetRestartMessageEnabled ===&lt;br /&gt;
Takes an input u8 bool flag, no output.&lt;br /&gt;
&lt;br /&gt;
See [[#AppletMessage]].&lt;br /&gt;
&lt;br /&gt;
=== SetScreenShotAppletIdentityInfo ===&lt;br /&gt;
Takes an input [[#AppletIdentityInfo]], no output.&lt;br /&gt;
&lt;br /&gt;
=== SetOutOfFocusSuspendingEnabled ===&lt;br /&gt;
Takes an input u8 bool flag. No output.&lt;br /&gt;
&lt;br /&gt;
=== SetControllerFirmwareUpdateSection ===&lt;br /&gt;
Takes an input u8 bool flag, no output.&lt;br /&gt;
&lt;br /&gt;
This throws error 0x40280 when the internal state flag already matches the input value.&lt;br /&gt;
&lt;br /&gt;
=== SetRequiresCaptureButtonShortPressedMessage ===&lt;br /&gt;
Takes an input u8 bool flag, no output.&lt;br /&gt;
&lt;br /&gt;
See [[#AppletMessage]].&lt;br /&gt;
&lt;br /&gt;
When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.&lt;br /&gt;
&lt;br /&gt;
=== SetAlbumImageOrientation ===&lt;br /&gt;
Takes an input u32 &amp;quot;nn::album::ImageOrientation&amp;quot;. No output.&lt;br /&gt;
&lt;br /&gt;
The input value must not be &amp;gt;3.&lt;br /&gt;
&lt;br /&gt;
=== SetDesirableKeyboardLayout ===&lt;br /&gt;
Takes an input u32, no output.&lt;br /&gt;
&lt;br /&gt;
The input u32 is &amp;quot;nn::settings::KeyboardLayout&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== CreateManagedDisplayLayer ===&lt;br /&gt;
Returns an output u64 LayerId which is then used by the user-process with [[Display_services#OpenLayer]].&lt;br /&gt;
&lt;br /&gt;
=== IsSystemBufferSharingEnabled ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Not available when the current applet is an Application ([[#AppletId]] == 0x01).&lt;br /&gt;
&lt;br /&gt;
Checks whether SystemBufferSharing is enabled, throwing an error otherwise.&lt;br /&gt;
&lt;br /&gt;
=== GetSystemSharedLayerHandle ===&lt;br /&gt;
No input, returns two output u64s &amp;quot;nn::vi::fbshare::SharedBufferHandle&amp;quot; and &amp;quot;nn::vi::fbshare::SharedLayerHandle&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.&lt;br /&gt;
&lt;br /&gt;
=== GetSystemSharedBufferHandle ===&lt;br /&gt;
No input, returns an output u64 &amp;quot;nn::vi::fbshare::SharedBufferHandle&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.&lt;br /&gt;
&lt;br /&gt;
Same as [[#GetSystemSharedLayerHandle]] except this just gets the SharedBufferHandle.&lt;br /&gt;
&lt;br /&gt;
=== CreateManagedDisplaySeparableLayer ===&lt;br /&gt;
No input, returns two output u64 LayerIds.&lt;br /&gt;
&lt;br /&gt;
sdknso now uses this instead of [[#CreateManagedDisplayLayer]]. sdknso caches the output from the cmd so that it&#039;s only used once. The first u64 is used the same as the original LayerId from [[#CreateManagedDisplayLayer]]. &amp;lt;code&amp;gt;nn::vi::CreateRecordingLayer&amp;lt;/code&amp;gt; uses the second LayerId, the layer creation is identical besides which LayerId is used.&lt;br /&gt;
&lt;br /&gt;
=== SetManagedDisplayLayerSeparationMode ===&lt;br /&gt;
Takes an input u32, no output.&lt;br /&gt;
&lt;br /&gt;
sdknso exposes this as &amp;lt;code&amp;gt;nn::vi::SetRecordingLayerEnabled(bool)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The input u32 must be 0-1.&lt;br /&gt;
&lt;br /&gt;
=== SetRecordingLayerCompositionEnabled ===&lt;br /&gt;
Takes an input bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetHandlesRequestToDisplay ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].&lt;br /&gt;
&lt;br /&gt;
See [[#AppletMessage]].&lt;br /&gt;
&lt;br /&gt;
=== ApproveToDisplay ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Used to handle the notification enabled by [[#SetHandlesRequestToDisplay]].&lt;br /&gt;
&lt;br /&gt;
=== OverrideAutoSleepTimeAndDimmingTime ===&lt;br /&gt;
Takes 4 input s32s, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetMediaPlaybackState ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetIdleTimeDetectionExtension ===&lt;br /&gt;
Takes an input u32, no output.&lt;br /&gt;
&lt;br /&gt;
The input value must be 0-2: 0 = disabled, 1 = Extended, and 2 = ExtendedUnsafe.&lt;br /&gt;
&lt;br /&gt;
=== GetIdleTimeDetectionExtension ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
Returns the value set by [[#SetIdleTimeDetectionExtension]].&lt;br /&gt;
&lt;br /&gt;
=== SetInputDetectionSourceSet ===&lt;br /&gt;
Takes an input u32, no output.&lt;br /&gt;
&lt;br /&gt;
=== ReportUserIsActive ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Uses idle:sys ReportUserIsActive.&lt;br /&gt;
&lt;br /&gt;
Reports that the user is active, for idle detection (screen dimming / auto-sleep). This is equivalent to when the user uses HID input.&lt;br /&gt;
&lt;br /&gt;
=== GetCurrentIlluminance ===&lt;br /&gt;
No input, returns an output float.&lt;br /&gt;
&lt;br /&gt;
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue, where only the output float is used.&lt;br /&gt;
&lt;br /&gt;
=== IsIlluminanceAvailable ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Uses [[Backlight_services|lbl]] command IsAmbientLightSensorAvailable.&lt;br /&gt;
&lt;br /&gt;
User-processes can use this to determine whether to continue with using GetCurrentIlluminance(Ex).&lt;br /&gt;
&lt;br /&gt;
=== SetAutoSleepDisabled ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== IsAutoSleepDisabled ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== ReportMultimediaError ===&lt;br /&gt;
Takes an input Result and a type-0x5 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer contains a 0x138-byte &amp;quot;movie::MultimediaTelemetryReport&amp;quot; struct.&lt;br /&gt;
&lt;br /&gt;
=== GetCurrentIlluminanceEx ===&lt;br /&gt;
No input, returns an output u8 bool and float.&lt;br /&gt;
&lt;br /&gt;
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.&lt;br /&gt;
&lt;br /&gt;
=== SetInputDetectionPolicy ===&lt;br /&gt;
Takes an input [[#InputDetectionPolicy]], no output.&lt;br /&gt;
&lt;br /&gt;
=== SetWirelessPriorityMode ===&lt;br /&gt;
Takes an input s32 [[#WirelessPriorityMode]], no output.&lt;br /&gt;
&lt;br /&gt;
=== GetAccumulatedSuspendedTickValue ===&lt;br /&gt;
No input, returns an output u64 tick value.&lt;br /&gt;
&lt;br /&gt;
Gets the total time in ticks that the process was suspended, relative to when the applet-service was last initialized.&lt;br /&gt;
&lt;br /&gt;
=== GetAccumulatedSuspendedTickChangedEvent ===&lt;br /&gt;
No input, returns an output Event handle with autoclear=true.&lt;br /&gt;
&lt;br /&gt;
This is signaled when the output from [[#GetAccumulatedSuspendedTickValue]] is updated.&lt;br /&gt;
&lt;br /&gt;
=== SetAlbumImageTakenNotificationEnabled ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
See [[#AppletMessage]].&lt;br /&gt;
&lt;br /&gt;
=== SetApplicationAlbumUserData ===&lt;br /&gt;
Takes a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer contains arbitrary UserData.&lt;br /&gt;
&lt;br /&gt;
The size must be &amp;lt;=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.&lt;br /&gt;
&lt;br /&gt;
=== SaveCurrentScreenshot ===&lt;br /&gt;
Takes an input s32 [[Capture_services#AlbumReportOption|AlbumReportOption]], no output.&lt;br /&gt;
&lt;br /&gt;
sdknso exposes this under &amp;quot;nn::album::&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== SetRecordVolumeMuted ===&lt;br /&gt;
Takes an input bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== GetDebugStorageChannel ===&lt;br /&gt;
No input, returns an output [[#IStorageChannel]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; must be set to 0x1 with size 0x1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
== IStorageChannel ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IStorageChannel&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [7.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Push || No input, returns an output [[#IStorage]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Unpop || No input, returns an output [[#IStorage]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Pop || No input, returns an output [[#IStorage]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetPopEventHandle || No input, returns an output handle.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Clear || No input/output.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== IWindowController ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IWindowController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateWindow]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetAppletResourceUserId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [6.0.0+] [[#GetAppletResourceUserIdOfCallerApplet]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#AcquireForegroundRights]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#ReleaseForegroundRights]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#RejectToChangeIntoBackground]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [7.0.0+] [[#SetAppletWindowVisibility]] || &lt;br /&gt;
|-&lt;br /&gt;
| 21 || [7.0.0+] [[#SetAppletGpuTimeSlice]] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== CreateWindow ===&lt;br /&gt;
Takes an input u32, returns an output [[#IWindow]].&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== GetAppletResourceUserId ===&lt;br /&gt;
No input, returns an output u64 [[#AppletResourceUserId]].&lt;br /&gt;
&lt;br /&gt;
=== GetAppletResourceUserIdOfCallerApplet ===&lt;br /&gt;
No input, returns an output u64 [[#AppletResourceUserId]].&lt;br /&gt;
&lt;br /&gt;
=== AcquireForegroundRights ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseForegroundRights ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== RejectToChangeIntoBackground ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== SetAppletWindowVisibility ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetAppletGpuTimeSlice ===&lt;br /&gt;
Takes an input s64, no output.&lt;br /&gt;
&lt;br /&gt;
The input s64 must not be negative.&lt;br /&gt;
&lt;br /&gt;
== IAudioController ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IAudioController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#SetExpectedMasterVolume]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetMainAppletExpectedMasterVolume]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetLibraryAppletExpectedMasterVolume]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#ChangeMainAppletMasterVolume]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#SetTransparentVolumeRate]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
GetMainAppletExpectedMasterVolume/SetExpectedMasterVolume are used for saving/restoring state for LibraryApplet launching, with SetExpectedMasterVolume being used with new state prior to launching a LibraryApplet. With official sw these applet funcs are used directly in the main-codebin.&lt;br /&gt;
&lt;br /&gt;
=== SetExpectedMasterVolume ===&lt;br /&gt;
Takes two input floats, no output.&lt;br /&gt;
&lt;br /&gt;
Writes the input floats to state: first one is used by [[#GetMainAppletExpectedMasterVolume]], second one is used by [[#GetLibraryAppletExpectedMasterVolume]].&lt;br /&gt;
&lt;br /&gt;
=== GetMainAppletExpectedMasterVolume ===&lt;br /&gt;
No input, returns an output float.&lt;br /&gt;
&lt;br /&gt;
=== GetLibraryAppletExpectedMasterVolume ===&lt;br /&gt;
No input, returns an output float.&lt;br /&gt;
&lt;br /&gt;
=== ChangeMainAppletMasterVolume ===&lt;br /&gt;
Takes an input float and an input u64, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetTransparentVolumeRate ===&lt;br /&gt;
Takes an input float, no output.&lt;br /&gt;
&lt;br /&gt;
== IDisplayController ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IDisplayController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetLastForegroundCaptureImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#UpdateLastForegroundCaptureImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetLastApplicationCaptureImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetCallerAppletCaptureImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#UpdateCallerAppletCaptureImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetLastForegroundCaptureImageEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#GetLastApplicationCaptureImageEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#GetCallerAppletCaptureImageEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [2.0.0+] [[#TakeScreenShotOfOwnLayer]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [5.0.0+] [[#CopyBetweenCaptureBuffers]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#AcquireLastApplicationCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#ReleaseLastApplicationCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#AcquireLastForegroundCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#ReleaseLastForegroundCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#AcquireCallerAppletCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [[#ReleaseCallerAppletCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#AcquireLastApplicationCaptureBufferEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [[#AcquireLastForegroundCaptureBufferEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [[#AcquireCallerAppletCaptureBufferEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [3.0.0+] [[#ClearCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [3.0.0+] [[#ClearAppletTransitionBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [4.0.0+] [[#AcquireLastApplicationCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [4.0.0+] [[#ReleaseLastApplicationCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [4.0.0+] [[#AcquireLastForegroundCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] [[#ReleaseLastForegroundCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 26 || [4.0.0+] [[#AcquireCallerAppletCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 27 || [4.0.0+] [[#ReleaseCallerAppletCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 28 || [6.0.0+] [[#TakeScreenShotOfOwnLayerEx]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetLastForegroundCaptureImage ===&lt;br /&gt;
Takes a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== UpdateLastForegroundCaptureImage ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== GetLastApplicationCaptureImage ===&lt;br /&gt;
Takes a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== GetCallerAppletCaptureImage ===&lt;br /&gt;
Takes a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== UpdateCallerAppletCaptureImage ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#UpdateLastForegroundCaptureImage]], except this passes param value 2 instead of 1.&lt;br /&gt;
&lt;br /&gt;
=== GetLastForegroundCaptureImageEx ===&lt;br /&gt;
Takes a type-0x6 output buffer, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
The buffer size must match 0x384000.&lt;br /&gt;
&lt;br /&gt;
=== GetLastApplicationCaptureImageEx ===&lt;br /&gt;
Takes a type-0x6 output buffer, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
The buffer size must match 0x384000.&lt;br /&gt;
&lt;br /&gt;
Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 0 instead of 1.&lt;br /&gt;
&lt;br /&gt;
=== GetCallerAppletCaptureImageEx ===&lt;br /&gt;
Takes a type-0x6 output buffer, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
The buffer size must match 0x384000.&lt;br /&gt;
&lt;br /&gt;
Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 2 instead of 1.&lt;br /&gt;
&lt;br /&gt;
=== TakeScreenShotOfOwnLayer ===&lt;br /&gt;
Takes an input u8 bool and a s32, no output.&lt;br /&gt;
&lt;br /&gt;
=== CopyBetweenCaptureBuffers ===&lt;br /&gt;
Takes two input s32s, no output.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastApplicationCaptureBuffer ===&lt;br /&gt;
No input, returns an output handle.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseLastApplicationCaptureBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Clears a state field if it&#039;s not already 0, returning an error otherwise. On newer sysvers: then a func is called which just returns 0, then this cmd returns 0.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastForegroundCaptureBuffer ===&lt;br /&gt;
No input, returns an output handle.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseLastForegroundCaptureBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.&lt;br /&gt;
&lt;br /&gt;
=== AcquireCallerAppletCaptureBuffer ===&lt;br /&gt;
No input, returns an output handle.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseCallerAppletCaptureBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastApplicationCaptureBufferEx ===&lt;br /&gt;
No input, returns an output TransferMemory handle and an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
The state field used by [[#ReleaseLastApplicationCaptureBuffer]] must be 0. Calls a func which just returns an error (this is only the case on newer sysvers), hence this cmd will just return that error. If that func would have returned successfully, the state field would be set to 1 and the cmd would return 0.&lt;br /&gt;
&lt;br /&gt;
On old sysvers, the output TransferMemory is size 0x384000 with permissions=RW.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastForegroundCaptureBufferEx ===&lt;br /&gt;
No input, returns an output TransferMemory handle and an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseLastForegroundCaptureBuffer]] state field, and uses a different input param value for the called func.&lt;br /&gt;
&lt;br /&gt;
=== AcquireCallerAppletCaptureBufferEx ===&lt;br /&gt;
No input, returns an output TransferMemory handle and an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseCallerAppletCaptureBuffer]] state field, and uses a different input param value for the called func.&lt;br /&gt;
&lt;br /&gt;
=== ClearCaptureBuffer ===&lt;br /&gt;
Takes an input u8 bool, a s32 CaptureSharedBuffer, and an u32 color, returns no output.&lt;br /&gt;
&lt;br /&gt;
Clear the input CaptureSharedBuffer with the specified RGBA8 color.&lt;br /&gt;
&lt;br /&gt;
=== ClearAppletTransitionBuffer ===&lt;br /&gt;
Takes an input u32, no output.&lt;br /&gt;
&lt;br /&gt;
Clear the AppletTransitionBuffer with the specified RGBA8 color.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastApplicationCaptureSharedBuffer ===&lt;br /&gt;
No input, returns an output u8 bool and an s32.&lt;br /&gt;
&lt;br /&gt;
This loads data from state.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseLastApplicationCaptureSharedBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Depending on whether a state field is 0, this just returns an error or returns 0.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastForegroundCaptureSharedBuffer ===&lt;br /&gt;
No input, returns an output u8 bool and an s32.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseLastForegroundCaptureSharedBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.&lt;br /&gt;
&lt;br /&gt;
=== AcquireCallerAppletCaptureSharedBuffer ===&lt;br /&gt;
No input, returns an output u8 bool and an s32.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseCallerAppletCaptureSharedBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.&lt;br /&gt;
&lt;br /&gt;
=== TakeScreenShotOfOwnLayerEx ===&lt;br /&gt;
Takes two input u8 bools and a s32, no output.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#TakeScreenShotOfOwnLayer]], except the last bool param is the last cmd param bool instead of hard-coded 0. This flag indicates whether the screenshot should be taken Immediately.&lt;br /&gt;
&lt;br /&gt;
== ISystemAppletControllerForDebug ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ISystemAppletControllerForDebug&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RequestLaunchApplicationForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [7.0.0+] [[#GetDebugStorageChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [7.0.0+] [[#CreateStorageForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [12.0.0+] [[#CreateCradleFirmwareUpdaterForDebug]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetDebugStorageChannel ===&lt;br /&gt;
No input. Returns an output [[#IStorageChannel]].&lt;br /&gt;
&lt;br /&gt;
=== CreateStorageForDebug ===&lt;br /&gt;
Takes a total of 8-bytes of input. Returns an [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
=== CreateCradleFirmwareUpdaterForDebug ===&lt;br /&gt;
No input. Returns an [[#ICradleFirmwareUpdater]].&lt;br /&gt;
&lt;br /&gt;
== IProcessWindingController ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IProcessWindingController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetLaunchReason]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#OpenCallingLibraryApplet]] || &lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#PushContext]] || &lt;br /&gt;
|-&lt;br /&gt;
| 22 || [[#PopContext]] || &lt;br /&gt;
|-&lt;br /&gt;
| 23 || [[#CancelWindingReservation]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#WindAndDoReserved]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [[#ReserveToStartAndWaitAndUnwindThis]] || &lt;br /&gt;
|-&lt;br /&gt;
| 41 || [4.0.0+] [[#ReserveToStartAndWait]] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetLaunchReason ===&lt;br /&gt;
No input, returns an output [[#AppletProcessLaunchReason]].&lt;br /&gt;
&lt;br /&gt;
Used by LibraryApplets.&lt;br /&gt;
&lt;br /&gt;
=== OpenCallingLibraryApplet ===&lt;br /&gt;
No input, returns an output [[#ILibraryAppletAccessor]].&lt;br /&gt;
&lt;br /&gt;
The objptr from state is cleared during this, an error is thrown if it&#039;s already 0.&lt;br /&gt;
&lt;br /&gt;
=== PushContext ===&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
=== PopContext ===&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
=== CancelWindingReservation ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== WindAndDoReserved ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== ReserveToStartAndWaitAndUnwindThis ===&lt;br /&gt;
Takes an input [[#ILibraryAppletAccessor]], no output.&lt;br /&gt;
&lt;br /&gt;
=== ReserveToStartAndWait ===&lt;br /&gt;
Takes an input [[#ILibraryAppletAccessor]], no output.&lt;br /&gt;
&lt;br /&gt;
== IDebugFunctions ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IDebugFunctions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#NotifyMessageToHomeMenuForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [1.0.0-9.2.0] [[#OpenMainApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#PerformSystemButtonPressing]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#InvalidateTransitionLayer]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [12.0.0+] RequestLaunchApplicationByApplicationLaunchInfoForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [15.0.0+] AddSystemProgramIdAndAppletIdForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [16.0.0+] AddOperationConfirmedLibraryAppletIdForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 52 || [17.0.0+] GetProgramIdFromAppletIdForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [10.0.0+] [[#CancelCpuBoostModeForApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]]&lt;br /&gt;
|-&lt;br /&gt;
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]]&lt;br /&gt;
|-&lt;br /&gt;
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]]&lt;br /&gt;
|-&lt;br /&gt;
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 131 || [9.0.0+] [[#FriendInvitationClearApplicationParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 140 || [14.0.0+] RestrictPowerOperationForSecureLaunchModeForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [15.0.0+] CreateFloatingLibraryAppletAccepterForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [16.0.0+] TerminateAllRunningApplicationsForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 900 || [12.0.0+] GetGrcProcessLaunchedSystemEvent&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== NotifyMessageToHomeMenuForDebug ===&lt;br /&gt;
Takes an input [[#AppletMessage]], no output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== OpenMainApplication ===&lt;br /&gt;
No input, returns an output [[#IApplicationAccessor]].&lt;br /&gt;
&lt;br /&gt;
Should not be used when no Application is running (svcBreak).&lt;br /&gt;
&lt;br /&gt;
=== PerformSystemButtonPressing ===&lt;br /&gt;
Takes an input [[#SystemButtonType]], no output.&lt;br /&gt;
&lt;br /&gt;
=== InvalidateTransitionLayer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== RequestLaunchApplicationWithUserAndArgumentForDebug ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]]).&lt;br /&gt;
&lt;br /&gt;
=== GetAppletResourceUsageInfo ===&lt;br /&gt;
No input, returns an output [[#AppletResourceUsageInfo]].&lt;br /&gt;
&lt;br /&gt;
=== SetCpuBoostModeForApplet ===&lt;br /&gt;
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
=== CancelCpuBoostModeForApplet ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== PushToAppletBoundChannelForDebug ===&lt;br /&gt;
Takes an input [[#IStorage]] and a s32, no output.&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== TryPopFromAppletBoundChannelForDebug ===&lt;br /&gt;
Takes an input s32, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
The s32 must not be 0 and must match the value previously saved by [[#PushToAppletBoundChannelForDebug]], otherwise errors are returned. Then the output storage is popped from the StorageChannel.&lt;br /&gt;
&lt;br /&gt;
=== AlarmSettingNotificationEnableAppEventReserve ===&lt;br /&gt;
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.&lt;br /&gt;
&lt;br /&gt;
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.&lt;br /&gt;
&lt;br /&gt;
=== AlarmSettingNotificationDisableAppEventReserve ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Clears the StorageChannel/saved-ApplicationId used by [[#AlarmSettingNotificationEnableAppEventReserve]].&lt;br /&gt;
&lt;br /&gt;
=== AlarmSettingNotificationPushAppEventNotify ===&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#PushToNotificationStorageChannel]] except this uses the MainApplication.&lt;br /&gt;
&lt;br /&gt;
=== FriendInvitationSetApplicationParameter ===&lt;br /&gt;
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.&lt;br /&gt;
&lt;br /&gt;
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.&lt;br /&gt;
&lt;br /&gt;
=== FriendInvitationClearApplicationParameter ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Clears the StorageChannel/saved-ApplicationId used by [[#FriendInvitationSetApplicationParameter]].&lt;br /&gt;
&lt;br /&gt;
=== FriendInvitationPushApplicationParameter ===&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#PushToFriendInvitationStorageChannel]] except this uses the MainApplication.&lt;br /&gt;
&lt;br /&gt;
== IStorage ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IStorage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Open || No input. Returns an [[#IStorageAccessor]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [2.0.0+] OpenTransferStorage || No input. Returns an [[#ITransferStorageAccessor]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Open can only be used when the IStorage was created by [[#CreateStorage]] or [[#CreateTransferMemoryStorage]]. OpenTransferStorage can only be used when the IStorage was created by [[#CreateHandleStorage]].&lt;br /&gt;
&lt;br /&gt;
Only 1 *Accessor session can be open for each IStorage at a time.&lt;br /&gt;
&lt;br /&gt;
== IStorageAccessor ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IStorageAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetSize || No input. Returns an s64.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Read || Takes an input s64 and a type-0x22 output buffer.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ITransferStorageAccessor ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ITransferStorageAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetSize || No input. Returns an output s64.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetHandle || No input. Returns an output s64 and handle.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These commands return the data originally from [[#CreateHandleStorage]] input, both return the same s64.&lt;br /&gt;
&lt;br /&gt;
= appletOE =&lt;br /&gt;
This is &amp;quot;nn::am::service::IApplicationProxyService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#OpenApplicationProxy]] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is used by all regular-applications, including [[flog]] and &amp;quot;Retail Interactive Display Menu&amp;quot;. Only one session can be open for this service at a time.&lt;br /&gt;
&lt;br /&gt;
== OpenApplicationProxy ==&lt;br /&gt;
Returns an [[#IApplicationProxy]]. See [[#appletAE]].&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.&lt;br /&gt;
&lt;br /&gt;
= idle:sys =&lt;br /&gt;
This is &amp;quot;nn::idle::detail::IPolicyManagerSystem&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This was moved to [[OMM_services|omm]] with [14.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetAutoPowerDownEvent&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [7.0.0+] IsAutoPowerDownRequested ([1.0.0-3.0.2] )&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [1.0.0-3.0.2]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#SetHandlingContext]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || LoadAndApplySettings&lt;br /&gt;
|-&lt;br /&gt;
| 5 || ReportUserIsActive&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SetHandlingContext ==&lt;br /&gt;
[3.0.0+] Now takes an additional 0x10-bytes of input.&lt;br /&gt;
&lt;br /&gt;
[13.0.0+] Total input size is now 0x30 instead of 0x38.&lt;br /&gt;
&lt;br /&gt;
= omm =&lt;br /&gt;
This is &amp;quot;nn::omm::detail::IOperationModeManager&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Operation Mode Manager (OMM) is a service responsible for arbitrating the operation changes between docked and handheld modes.&lt;br /&gt;
Besides [[PTM_services|PTM]], this is the only service that interacts with the [[Dock]] through [[USB_services|usb:pd*]].&lt;br /&gt;
&lt;br /&gt;
This was moved to [[OMM_services|omm]] with [14.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetOperationMode&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetOperationModeChangeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 2 || EnableAudioVisual&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DisableAudioVisual&lt;br /&gt;
|-&lt;br /&gt;
| 4 || EnterSleepAndWait&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetCradleStatus&lt;br /&gt;
|-&lt;br /&gt;
| 6 || FadeInDisplay&lt;br /&gt;
|-&lt;br /&gt;
| 7 || FadeOutDisplay&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [2.0.0+] GetCradleFwVersion&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [2.0.0+] NotifyCecSettingsChanged&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [3.0.0+] SetOperationModePolicy&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [3.0.0+] GetDefaultDisplayResolution&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [3.0.0+] UpdateDefaultDisplayResolution&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [3.0.0+] ShouldSleepOnBoot&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [4.0.0+] NotifyHdcpApplicationExecutionStarted&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [4.0.0+] NotifyHdcpApplicationExecutionFinished&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [4.0.0+] NotifyHdcpApplicationDrawingStarted&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [4.0.0+] NotifyHdcpApplicationDrawingFinished&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [4.0.0+] GetHdcpAuthenticationFailedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [4.0.0+] GetHdcpAuthenticationFailedEmulationEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [4.0.0+] SetHdcpAuthenticationFailedEmulation&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [4.0.0+] GetHdcpStateChangeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [4.0.0+] GetHdcpState&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [5.0.0+] ShowCardUpdateProcessing&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [5.0.0+] SetApplicationCecSettingsAndNotifyChanged&lt;br /&gt;
|-&lt;br /&gt;
| 26 || [7.0.0+] [[#GetOperationModeSystemInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 27 || [9.0.0+] GetAppletFullAwakingSystemEvent&lt;br /&gt;
|-&lt;br /&gt;
| 28 || [12.0.0+] [[#CreateCradleFirmwareUpdater]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GetOperationModeSystemInfo ==&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
This is used by [[#GetOperationModeSystemInfo|ICommonStateGetter GetOperationModeSystemInfo]].&lt;br /&gt;
&lt;br /&gt;
== CreateCradleFirmwareUpdater ==&lt;br /&gt;
No input. Returns an [[#ICradleFirmwareUpdater]].&lt;br /&gt;
&lt;br /&gt;
== ICradleFirmwareUpdater ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ICradleFirmwareUpdater&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [12.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Start&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Finish&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetUpdateDeviceStatus&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetUpdateProgress&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetUpdateDeviceStatusChangeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetUpdateProgress2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= spsm =&lt;br /&gt;
This is &amp;quot;nn::spsm::detail::IPowerStateInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was moved to [[OMM_services|omm]] with [14.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetCurrentState&lt;br /&gt;
|-&lt;br /&gt;
| 1 || EnterSleep&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetLastWakeReason&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Shutdown&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetNotificationMessageEventHandle&lt;br /&gt;
|-&lt;br /&gt;
| 5 || ReceiveNotificationMessage&lt;br /&gt;
|-&lt;br /&gt;
| 6 || AnalyzeLogForLastSleepWakeSequence&lt;br /&gt;
|-&lt;br /&gt;
| 7 || ResetEventLog&lt;br /&gt;
|-&lt;br /&gt;
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence&lt;br /&gt;
|-&lt;br /&gt;
| 9 || ChangeHomeButtonLongPressingTime&lt;br /&gt;
|-&lt;br /&gt;
| 10 || PutErrorState&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [1.0.0-3.0.2] InvalidateCurrentHomeButtonPressing&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] Cmd11 now takes a total of 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
= tcap =&lt;br /&gt;
This is &amp;quot;nn::tcap::server::IManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was removed with [11.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetContinuousHighSkinTemperatureEvent&lt;br /&gt;
|-&lt;br /&gt;
| 1 || SetOperationMode&lt;br /&gt;
|-&lt;br /&gt;
| 2 || LoadAndApplySettings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= caps:su =&lt;br /&gt;
This is &amp;quot;nn::capsrv::sf::IScreenShotApplicationService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [6.0.0+].&lt;br /&gt;
&lt;br /&gt;
This can be used by applications to save screenshots.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 32 || [7.0.0+] SetShimLibraryVersion || Takes a total of 0x10-bytes of input and a PID, no output.&lt;br /&gt;
|-&lt;br /&gt;
| 201 || SaveScreenShot || &lt;br /&gt;
|-&lt;br /&gt;
| 203 || SaveScreenShotEx0 || &lt;br /&gt;
|-&lt;br /&gt;
| 205 || [8.0.0+] SaveScreenShotEx1 || &lt;br /&gt;
|-&lt;br /&gt;
| 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.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SetShimLibraryVersion&#039;&#039;&#039; is a wrapper for [[Capture_services|caps:c]] cmd33. Commands &#039;&#039;&#039;SaveScreenShot&#039;&#039;&#039;, &#039;&#039;&#039;SaveScreenShotEx0&#039;&#039;&#039;, &#039;&#039;&#039;SaveScreenShotEx1&#039;&#039;&#039; and &#039;&#039;&#039;SaveScreenShotEx2&#039;&#039;&#039; are wrappers for [[Display_services|caps:sc]] cmd210.&lt;br /&gt;
&lt;br /&gt;
== SaveScreenShot ==&lt;br /&gt;
Takes two input u32s, an u64 AppletResourceUserId, a PID, and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].&lt;br /&gt;
&lt;br /&gt;
Official user-processes doesn&#039;t use this, instead [[#SaveScreenShotEx0]] is used: ScreenShotAttributeEx0 is all-zero, except +4 is set to an input u32 and u32 +0xC = 0x1.&lt;br /&gt;
&lt;br /&gt;
This cmd internally uses an all-zero ScreenShotAttributeEx0, with u32 +0 = input u32 and u32 +0x8 = 0x3.&lt;br /&gt;
&lt;br /&gt;
== SaveScreenShotEx0 ==&lt;br /&gt;
Takes an input 0x40-byte struct &#039;&#039;&#039;ScreenShotAttributeEx0&#039;&#039;&#039;, an input u32, an input u64 AppletResourceUserId, a PID, and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].&lt;br /&gt;
&lt;br /&gt;
== SaveScreenShotEx1 ==&lt;br /&gt;
Takes an input 0x40-byte struct &#039;&#039;&#039;ScreenShotAttributeEx0&#039;&#039;&#039;, an input u32, an input u64 AppletResourceUserId, a PID, a type-0x15 input buffer containing an [[Capture_services|ApplicationData]], and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].&lt;br /&gt;
&lt;br /&gt;
== SaveScreenShotEx2 ==&lt;br /&gt;
Takes an input 0x40-byte struct &#039;&#039;&#039;ScreenShotAttributeEx0&#039;&#039;&#039;, 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]].&lt;br /&gt;
&lt;br /&gt;
= apm =&lt;br /&gt;
This is &amp;quot;nn::am::service::IApmManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [8.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#OpenSession]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetPerformanceMode&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [7.0.0+] [[#IsCpuOverclockEnabled]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== OpenSession ==&lt;br /&gt;
Returns an [[#ISession]].&lt;br /&gt;
&lt;br /&gt;
== IsCpuOverclockEnabled ==&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
== ISession ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IApmSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || SetPerformanceConfiguration&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetPerformanceConfiguration&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [8.0.0+] SetCpuOverclockEnabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Library Applets =&lt;br /&gt;
This section documents library applet launching.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Once the applet finishes running successfully, [[#ILibraryAppletAccessor]] PopOutData can be used to get the applet-specific [[#IStorage]] containing the applet output data.&lt;br /&gt;
&lt;br /&gt;
== CommonArguments ==&lt;br /&gt;
The first [[#CreateStorage|IStorage]] passed to applets should contain the common library applet arguments. This is populated by &amp;lt;code&amp;gt;nn::la::CommonArgumentsWriter&amp;lt;/code&amp;gt; and has the following format.&lt;br /&gt;
&lt;br /&gt;
This struct is 0x20-bytes.&lt;br /&gt;
&lt;br /&gt;
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&#039;s 8-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Typical Value || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 4 || 1 || Common Arguments version&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 4 || 0x20 || Common Arguments size&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 4 || || Library applet version (API version)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 4 || 0 || Theme color&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 1 || 0 || Play startup sound&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AppletId =&lt;br /&gt;
This is &amp;quot;nn::applet::AppletId&amp;quot;. See also [[:Category:Library Applets]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! ProgramId&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| &lt;br /&gt;
| Application (not valid for use with LibraryApplets)&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 010000000000100C&lt;br /&gt;
| OverlayApplet (overlayDisp)&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| 0100000000001000&lt;br /&gt;
| SystemAppletMenu (qlaunch)&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 0100000000001012&lt;br /&gt;
| SystemApplication (starter)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A&lt;br /&gt;
| 0100000000001001&lt;br /&gt;
| [[Auth_Applet|LibraryAppletAuth (auth)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0B&lt;br /&gt;
| 0100000000001002&lt;br /&gt;
| [[Cabinet_Applet|LibraryAppletCabinet (cabinet)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C&lt;br /&gt;
| 0100000000001003&lt;br /&gt;
| [[Controller_Applet|LibraryAppletController (controller)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0D&lt;br /&gt;
| 0100000000001004&lt;br /&gt;
| LibraryAppletDataErase (dataErase)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E&lt;br /&gt;
| 0100000000001005&lt;br /&gt;
| [[Error_Applet|LibraryAppletError (error)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0F&lt;br /&gt;
| 0100000000001006&lt;br /&gt;
| LibraryAppletNetConnect (netConnect)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0100000000001007&lt;br /&gt;
| [[Profile_Selector|LibraryAppletPlayerSelect (playerSelect)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| 0100000000001008&lt;br /&gt;
| [[Software_Keyboard|LibraryAppletSwkbd (swkbd)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0100000000001009&lt;br /&gt;
| [[MiiEdit_Applet|LibraryAppletMiiEdit (miiEdit)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x13&lt;br /&gt;
| 010000000000100A&lt;br /&gt;
| [[Internet_Browser#010000000000100A|LibraryAppletWeb (web)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 010000000000100B&lt;br /&gt;
| [[Internet_Browser#ShopN|LibraryAppletShop (shop)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x15&lt;br /&gt;
| 010000000000100D&lt;br /&gt;
| [[Album_Applet|LibraryAppletPhotoViewer (photoViewer)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x16&lt;br /&gt;
| 010000000000100E&lt;br /&gt;
| LibraryAppletSet (set)&lt;br /&gt;
|-&lt;br /&gt;
| 0x17&lt;br /&gt;
| 010000000000100F&lt;br /&gt;
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0100000000001010&lt;br /&gt;
| [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x19&lt;br /&gt;
| 0100000000001011&lt;br /&gt;
| [[Internet_Browser#WifiWebAuthApplet|LibraryAppletWifiWebAuth (wifiWebAuth)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A&lt;br /&gt;
| 0100000000001013&lt;br /&gt;
| [[MyPage_Applet|LibraryAppletMyPage (myPage)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B&lt;br /&gt;
| 010000000000101A&lt;br /&gt;
| LibraryAppletGift (gift)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 010000000000101C&lt;br /&gt;
| LibraryAppletUserMigration (userMigration)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D&lt;br /&gt;
| 010000000000101D&lt;br /&gt;
| [9.0.0+] LibraryAppletPreomiaSys (EncounterSys)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E&lt;br /&gt;
| 0100000000001020&lt;br /&gt;
| [9.0.0+] LibraryAppletStory (story)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F&lt;br /&gt;
| 010070000E3C0000&lt;br /&gt;
| [9.0.0+] LibraryAppletPreomiaUsr (EncounterUsr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 010086000E49C000&lt;br /&gt;
| [9.0.0+] LibraryAppletPreomiaUsrDummy (EncounterUsrDummy)&lt;br /&gt;
|-&lt;br /&gt;
| 0x21&lt;br /&gt;
| 0100000000001038&lt;br /&gt;
| [10.0.0+] LibraryAppletSample (sample)&lt;br /&gt;
|-&lt;br /&gt;
| 0x22&lt;br /&gt;
| 0100000000001007&lt;br /&gt;
| [13.0.0+] LibraryAppletPromoteQualification (playerSelect)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32&lt;br /&gt;
| 010000000000100F&lt;br /&gt;
| [17.0.0+] [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x33&lt;br /&gt;
| 010000000000100F&lt;br /&gt;
| [17.0.0+] [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x35&lt;br /&gt;
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)&lt;br /&gt;
| [17.0.0+] [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] ([16.0.0-16.1.0] )&lt;br /&gt;
|-&lt;br /&gt;
| 0x36&lt;br /&gt;
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)&lt;br /&gt;
| [17.0.0+] [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] ([16.0.0-16.1.0] )&lt;br /&gt;
|-&lt;br /&gt;
| 0x37&lt;br /&gt;
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)&lt;br /&gt;
| [17.0.0+] [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] ([16.0.0-16.1.0] )&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0100000000001043&lt;br /&gt;
| [16.0.0-16.1.0]&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E8&lt;br /&gt;
| &lt;br /&gt;
| [10.0.0-16.1.0] DevlopmentTool&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F1&lt;br /&gt;
| 010000000000D619&lt;br /&gt;
| [10.0.0-16.1.0] CombinationLA&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F2&lt;br /&gt;
| 010000000000D610&lt;br /&gt;
| [10.0.0-16.1.0] AeSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F3&lt;br /&gt;
| 010000000000D611&lt;br /&gt;
| [10.0.0-16.1.0] AeOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F4&lt;br /&gt;
| 010000000000D612&lt;br /&gt;
| [10.0.0-16.1.0] AeStarter&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F5&lt;br /&gt;
| 010000000000D613&lt;br /&gt;
| [10.0.0-16.1.0] AeLibraryAppletAlone&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F6&lt;br /&gt;
| 010000000000D614&lt;br /&gt;
| [10.0.0-16.1.0] AeLibraryApplet1&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F7&lt;br /&gt;
| 010000000000D615&lt;br /&gt;
| [10.0.0-16.1.0] AeLibraryApplet2&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F8&lt;br /&gt;
| 010000000000D616&lt;br /&gt;
| [10.0.0-16.1.0] AeLibraryApplet3&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F9&lt;br /&gt;
| 010000000000D617&lt;br /&gt;
| [10.0.0-16.1.0] AeLibraryApplet4&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FA&lt;br /&gt;
| 010000000000D60A&lt;br /&gt;
| [10.0.0-16.1.0] AppletISA&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FB&lt;br /&gt;
| 010000000000D60B&lt;br /&gt;
| [10.0.0-16.1.0] AppletIOA&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FC&lt;br /&gt;
| 010000000000D60C&lt;br /&gt;
| [10.0.0-16.1.0] AppletISTA&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FD&lt;br /&gt;
| 010000000000D60D&lt;br /&gt;
| [10.0.0-16.1.0] AppletILA1&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FE&lt;br /&gt;
| 010000000000D60E&lt;br /&gt;
| [10.0.0-16.1.0] AppletILA2&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000DC&lt;br /&gt;
| 010000000000D619&lt;br /&gt;
| [17.0.0+] CombinationLA&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000E6&lt;br /&gt;
| 010000000000D610&lt;br /&gt;
| [17.0.0+] AeSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000E7&lt;br /&gt;
| 010000000000D611&lt;br /&gt;
| [17.0.0+] AeOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000E8&lt;br /&gt;
| 010000000000D612&lt;br /&gt;
| [17.0.0+] AeStarter&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000E9&lt;br /&gt;
| 010000000000D613&lt;br /&gt;
| [17.0.0+] AeLibraryAppletAlone&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000EA&lt;br /&gt;
| 010000000000D614&lt;br /&gt;
| [17.0.0+] AeLibraryApplet1&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000EB&lt;br /&gt;
| 010000000000D615&lt;br /&gt;
| [17.0.0+] AeLibraryApplet2&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000EC&lt;br /&gt;
| 010000000000D616&lt;br /&gt;
| [17.0.0+] AeLibraryApplet3&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000ED&lt;br /&gt;
| 010000000000D617&lt;br /&gt;
| [17.0.0+] AeLibraryApplet4&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000F0&lt;br /&gt;
| 010000000000D60A&lt;br /&gt;
| [17.0.0+] AppletISA&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000F1&lt;br /&gt;
| 010000000000D60B&lt;br /&gt;
| [17.0.0+] AppletIOA&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000F2&lt;br /&gt;
| 010000000000D60C&lt;br /&gt;
| [17.0.0+] AppletISTA&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000F3&lt;br /&gt;
| 010000000000D60D&lt;br /&gt;
| [17.0.0+] AppletILA1&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000F4&lt;br /&gt;
| 010000000000D60E&lt;br /&gt;
| [17.0.0+] AppletILA2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= LibraryAppletMode =&lt;br /&gt;
This is &amp;quot;nn::applet::LibraryAppletMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| AllForeground&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| PartialForeground&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| NoUi&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| PartialForegroundWithIndirectDisplay (see also [[#GetIndirectLayerConsumerHandle]], only used by swkbd [[Software_Keyboard|InlineKeyboard]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| AllForegroundInitiallyHidden (can be used by [7.0.0+] [[Internet_Browser|WebSession]])&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AppletMessage =&lt;br /&gt;
This is &amp;quot;nn::am::AppletMessage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ChangeIntoForeground&lt;br /&gt;
|-&lt;br /&gt;
| 2 || ChangeIntoBackground&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Exit&lt;br /&gt;
|-&lt;br /&gt;
| 6 || ApplicationExited&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [[#FocusState|FocusStateChanged]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#SetRestartMessageEnabled|Resume]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || DetectShortPressingHomeButton&lt;br /&gt;
|-&lt;br /&gt;
| 21 || DetectLongPressingHomeButton&lt;br /&gt;
|-&lt;br /&gt;
| 22 || DetectShortPressingPowerButton&lt;br /&gt;
|-&lt;br /&gt;
| 23 || DetectMiddlePressingPowerButton&lt;br /&gt;
|-&lt;br /&gt;
| 24 || DetectLongPressingPowerButton&lt;br /&gt;
|-&lt;br /&gt;
| 25 || RequestToPrepareSleep&lt;br /&gt;
|-&lt;br /&gt;
| 26 || FinishedSleepSequence&lt;br /&gt;
|-&lt;br /&gt;
| 27 || SleepRequiredByHighTemperature&lt;br /&gt;
|-&lt;br /&gt;
| 28 || SleepRequiredByLowBattery&lt;br /&gt;
|-&lt;br /&gt;
| 29 || AutoPowerDown&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#OperationMode|OperationModeChanged]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [[#PerformanceMode|PerformanceModeChanged]]&lt;br /&gt;
|-&lt;br /&gt;
| 32 || DetectReceivingCecSystemStandby&lt;br /&gt;
|-&lt;br /&gt;
| 33 || SdCardRemoved&lt;br /&gt;
|-&lt;br /&gt;
| 50 || LaunchApplicationRequested&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [[#SetHandlesRequestToDisplay|RequestToDisplay]]&lt;br /&gt;
|-&lt;br /&gt;
| 55 || ShowApplicationLogo&lt;br /&gt;
|-&lt;br /&gt;
| 56 || HideApplicationLogo&lt;br /&gt;
|-&lt;br /&gt;
| 57 || ForceHideApplicationLogo&lt;br /&gt;
|-&lt;br /&gt;
| 60 || FloatingApplicationDetected&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [[#SetRequiresCaptureButtonShortPressedMessage|DetectShortPressingCaptureButton]]&lt;br /&gt;
|-&lt;br /&gt;
| 92 || [[#SetAlbumImageTakenNotificationEnabled|AlbumScreenShotTaken]]&lt;br /&gt;
|-&lt;br /&gt;
| 93 || AlbumRecordingSaved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= OperationMode =&lt;br /&gt;
This is &amp;quot;nn::oe::OperationMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Handheld&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Console&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= PerformanceMode =&lt;br /&gt;
This is &amp;quot;nn::oe::PerformanceMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| -1 || Invalid&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Normal&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Boost&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= FocusState =&lt;br /&gt;
This is &amp;quot;nn::oe::FocusState&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 || InFocus&lt;br /&gt;
|-&lt;br /&gt;
| 2 || OutOfFocus&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Background&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= CpuBoostMode =&lt;br /&gt;
This is &amp;quot;nn::oe::CpuBoostMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Normal&lt;br /&gt;
|-&lt;br /&gt;
| 1 || FastLoad&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= WindowOriginMode =&lt;br /&gt;
This is &amp;quot;nn::oe::WindowOriginMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || LowerLeft&lt;br /&gt;
|-&lt;br /&gt;
| 1 || UpperLeft&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= WirelessPriorityMode =&lt;br /&gt;
This is &amp;quot;nn::oe::WirelessPriorityMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Default&lt;br /&gt;
|-&lt;br /&gt;
| 1 || OptimizedForWlan&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= TvPowerStateMatchingMode =&lt;br /&gt;
This is &amp;quot;nn::oe::TvPowerStateMatchingMode&amp;quot;. This is used with [[#SetTvPowerStateMatchingMode]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Unknown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= SystemButtonType =&lt;br /&gt;
This is &amp;quot;nn::am::service::SystemButtonType&amp;quot;. This is used with [[#PerformSystemButtonPressingIfInFocus]]/[[#PerformSystemButtonPressing]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 || PerformHomeButtonShortPressing&lt;br /&gt;
|-&lt;br /&gt;
| 2 || PerformHomeButtonLongPressing&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Short-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Long-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Shutdown the system. Only available with [[#PerformSystemButtonPressing]].&lt;br /&gt;
|-&lt;br /&gt;
| 6 || PerformCaptureButtonShortPressing&lt;br /&gt;
|-&lt;br /&gt;
| 7 || PerformCaptureButtonLongPressing&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= LaunchParameterKind =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 || UserChannel. Application-specific LaunchParameter.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || account PreselectedUser&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Unknown if used by anything?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= LibraryAppletExitReason =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Normal&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Canceled&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Abnormal&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Unexpected&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ProgramSpecifyKind =&lt;br /&gt;
This is &amp;quot;nn::am::service::ProgramSpecifyKind&amp;quot;. This controls the type of the u64 passed to [[#ExecuteProgram]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || u8 ProgramIndex. &amp;quot;ExecuteProgram&amp;quot;. [[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.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[NCM_services#ApplicationId|ApplicationId]]. &amp;quot;JumpToSubApplicationProgramForDevelopment&amp;quot;. Only available when [[Settings_services#GetDebugModeFlag|DebugMode]] is 1.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || u64 = value 0. &amp;quot;RestartProgram&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
ProgramIndex values where the title is not installed should not be used: [[qlaunch]] will display an error message and the current title will become &amp;quot;corrupted&amp;quot;, however Home Menu will have an option to repair it.&lt;br /&gt;
&lt;br /&gt;
= InputDetectionPolicy =&lt;br /&gt;
This is u32 enum &amp;quot;nn::applet::InputDetectionPolicy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Unknown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AppletResourceUserId =&lt;br /&gt;
This is &amp;quot;nn::applet::AppletResourceUserId&amp;quot;. Used by a number of non-AM services.&lt;br /&gt;
&lt;br /&gt;
= AppletAttribute =&lt;br /&gt;
This is &amp;quot;nn::am::AppletAttribute&amp;quot;. This struct is 0x80 bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Flag. When non-zero, two state fields are set to 1.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x7F || Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is used by [[#OpenLibraryAppletProxy]].&lt;br /&gt;
&lt;br /&gt;
= AppletProcessLaunchReason =&lt;br /&gt;
This is &amp;quot;nn::am::service::AppletProcessLaunchReason&amp;quot;. This struct is 0x4-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Flag. When non-zero, LibraryApplets then use [[#OpenCallingLibraryApplet]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x2 || Always 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || Always 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= LibraryAppletInfo =&lt;br /&gt;
This is &amp;quot;nn::am::service::LibraryAppletInfo&amp;quot;. This struct is 0x8-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#AppletId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || [[#LibraryAppletMode]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AppletKind =&lt;br /&gt;
This is &amp;quot;nn::am::service::AppletKind&amp;quot;. This is 8-bytes.&lt;br /&gt;
&lt;br /&gt;
= AppletIdentityInfo =&lt;br /&gt;
This struct is &amp;quot;nn::am::service::AppletIdentityInfo&amp;quot;. This struct is 0x10-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#AppletId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ApplicationAttributeForQuest =&lt;br /&gt;
This struct is &amp;quot;nn::applet::ApplicationAttributeForQuest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || See [[#ApplicationAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || See [[#ApplicationAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x4 || [7.0.0+] See [[#ApplicationAttribute]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
= ApplicationAttribute =&lt;br /&gt;
This struct is &amp;quot;nn::am::ApplicationAttribute&amp;quot;. This struct is 0x20-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x4 || float audio volume. Must be in the range of 0.0f-1.0f. The default is 1.0f.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x14 || Unused. Default is 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Internally AM only uses the first 0xC-bytes from ApplicationAttribute, regardless of the cmd.&lt;br /&gt;
&lt;br /&gt;
= ApplicationLaunchProperty =&lt;br /&gt;
This struct is 0x10-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x4 || Application title-version.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application base title.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application update title.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE || 0x1 || Unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF || 0x1 || Padding.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ApplicationLaunchRequestInfo =&lt;br /&gt;
This is &amp;quot;nn::applet::ApplicationLaunchRequestInfo&amp;quot;. This struct is 0x10-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8 || Unknown. The default is 0x0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AppletResourceUsageInfo =&lt;br /&gt;
This is &amp;quot;nn::am::service::AppletResourceUsageInfo&amp;quot;. This struct is 0x20-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || Unknown counter.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || Unknown counter.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x4 || Output from [[NS_Services|NS GetRightsEnvironmentCountForDebug]].&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x14 || Always zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ApplicationLicenseType =&lt;br /&gt;
This is &amp;quot;nn::oe::ApplicationLicenseType&amp;quot;. This is 1-byte.&lt;br /&gt;
&lt;br /&gt;
= LaunchRequiredVersion =&lt;br /&gt;
This is &amp;quot;nn::oe::LaunchRequiredVersion&amp;quot;. This is a 0x40-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
= ServerEnvironmentType =&lt;br /&gt;
This is &amp;quot;nn::oe::ServerEnvironmentType&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || dd&lt;br /&gt;
|-&lt;br /&gt;
| 1 || lp&lt;br /&gt;
|-&lt;br /&gt;
| 2 || sd&lt;br /&gt;
|-&lt;br /&gt;
| 3 || sp&lt;br /&gt;
|-&lt;br /&gt;
| 4 || dp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Liamwhite</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Applet_Manager_services&amp;diff=12625</id>
		<title>Applet Manager services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Applet_Manager_services&amp;diff=12625"/>
		<updated>2024-01-06T23:17:58Z</updated>

		<summary type="html">&lt;p&gt;Liamwhite: ILibraryAppletSelfAccessor 160&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AM (Applet Manager) provides services for interacting with system applets while abstracting several aspects of power and operation management.&lt;br /&gt;
&lt;br /&gt;
Contains multiple raw images, with at least the following: &amp;quot;NN_OMM_CHARGING_BIN_{begin|end}&amp;quot;(charging icon), low-battery icon, and the Nintendo Switch logo displayed during system boot.&lt;br /&gt;
&lt;br /&gt;
= appletAE =&lt;br /&gt;
This is &amp;quot;nn::am::service::IAllSystemAppletProxiesService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 100 || OpenSystemAppletProxy || Returns an [[#ISystemAppletProxy]].&lt;br /&gt;
|-&lt;br /&gt;
| 200 || OpenLibraryAppletProxyOld ([1.0.0-2.3.0] OpenLibraryAppletProxy) || Returns an [[#ILibraryAppletProxy]].&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [3.0.0+] [[#OpenLibraryAppletProxy]] || Returns an [[#ILibraryAppletProxy]].&lt;br /&gt;
|-&lt;br /&gt;
| 300 || OpenOverlayAppletProxy || Returns an [[#IOverlayAppletProxy]].&lt;br /&gt;
|-&lt;br /&gt;
| 350 || OpenSystemApplicationProxy || Returns an [[#IApplicationProxy]].&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#CreateSelfLibraryAppletCreatorForDevelop]] || &lt;br /&gt;
|-&lt;br /&gt;
| 410 || [6.0.0+] [[#GetSystemAppletControllerForDebug]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [6.0.0+] [[#GetDebugFunctions]] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All of these Open*Proxy commands except [[#OpenLibraryAppletProxy]] take the same input as [[#OpenApplicationProxy]], with the same user-process retry-loop as [[#OpenApplicationProxy]]. These Open*Proxy commands (including appletOE) doesn&#039;t seem to usable from processes which aren&#039;t actual applets (such as sysmodules), at least for applet-types which aren&#039;t already in use.&lt;br /&gt;
&lt;br /&gt;
OpenLibraryAppletProxyOld eventually calls the same func as [[#OpenLibraryAppletProxy]], except that the [[#AppletAttribute]] is all-zero.&lt;br /&gt;
&lt;br /&gt;
This service is used by all system non-regular-applications.&lt;br /&gt;
&lt;br /&gt;
The 01000000000010XX system [[Title_list|titles]] use the following applet types(above Open{type}Proxy commands):&lt;br /&gt;
* &amp;quot;qlaunch&amp;quot;: SystemApplet&lt;br /&gt;
* &amp;quot;overlay&amp;quot;: OverlayApplet&lt;br /&gt;
* &amp;quot;starter&amp;quot;: SystemApplication&lt;br /&gt;
* &amp;quot;maintenance&amp;quot;: SystemApplet&lt;br /&gt;
* All others: LibraryApplet&lt;br /&gt;
&lt;br /&gt;
== OpenLibraryAppletProxy ==&lt;br /&gt;
Returns an [[#ILibraryAppletProxy]].&lt;br /&gt;
&lt;br /&gt;
Takes a [[IPC_Marshalling|reserved]] input u64(official user-processes use hard-coded value 0), a PID,a process copy-handle(cur-proc handle alias), and a type-0x15 input buffer containing an [[#AppletAttribute]].&lt;br /&gt;
&lt;br /&gt;
Official user-processes use the same retry loop with this as the other Open*Proxy commands.&lt;br /&gt;
&lt;br /&gt;
== CreateSelfLibraryAppletCreatorForDevelop ==&lt;br /&gt;
Takes a PID and an input u64 pid_placeholder, returns an [[#ILibraryAppletCreator]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; must be set to 0x1 with size 0x1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
== GetSystemAppletControllerForDebug ==&lt;br /&gt;
No input, returns an [[#ISystemAppletControllerForDebug]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; must be set to 0x1 with size 0x1, and various state checks must pass, otherwise 0 is returned with no output interface.&lt;br /&gt;
&lt;br /&gt;
== GetDebugFunctions ==&lt;br /&gt;
No input, returns an [[#IDebugFunctions]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; must be set to 0x1 with size 0x1, otherwise 0 is returned with no output interface.&lt;br /&gt;
&lt;br /&gt;
== ISystemAppletProxy ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ISystemAppletProxy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetSelfController || Returns an [[#ISelfController]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetWindowController || Returns an [[#IWindowController]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetAudioController || Returns an [[#IAudioController]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetDisplayController || Returns an [[#IDisplayController]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].&lt;br /&gt;
|-&lt;br /&gt;
| 20 || GetHomeMenuFunctions || Returns an [[#IHomeMenuFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 21 || GetGlobalStateController || Returns an [[#IGlobalStateController]].&lt;br /&gt;
|-&lt;br /&gt;
| 22 || GetApplicationCreator || Returns an [[#IApplicationCreator]].&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [7.0.0+] GetAppletCommonFunctions || Returns an [[#IAppletCommonFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IHomeMenuFunctions ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IHomeMenuFunctions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#RequestToGetForeground]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#LockForeground]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#UnlockForeground]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#PopFromGeneralChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetPopFromGeneralChannelEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#GetHomeButtonWriterLockAccessor]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [2.0.0+] [[#GetWriterLockAccessorEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [11.0.0+] [[#IsSleepEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 41 || [12.0.0+] [[#IsRebootEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [16.0.0+] [[#LaunchSystemApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [16.0.0+] [[#LaunchStarter]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [6.0.0+] [[#PopRequestLaunchApplicationForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [9.0.0+] [[#IsForceTerminateApplicationDisabledForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [8.0.0+] [[#LaunchDevMenu]]&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [11.0.0+] [[#SetLastApplicationExitReason]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== RequestToGetForeground ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== LockForeground ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== UnlockForeground ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== PopFromGeneralChannel ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== GetPopFromGeneralChannelEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== GetHomeButtonWriterLockAccessor ====&lt;br /&gt;
No input, returns an output [[#ILockAccessor]].&lt;br /&gt;
&lt;br /&gt;
Similar to using [[#GetWriterLockAccessorEx]] with inval=0.&lt;br /&gt;
&lt;br /&gt;
==== GetWriterLockAccessorEx ====&lt;br /&gt;
Takes an input u32, returns an output [[#ILockAccessor]].&lt;br /&gt;
&lt;br /&gt;
The input value must be 0-3. 0 = HomeButton.&lt;br /&gt;
&lt;br /&gt;
==== IsSleepEnabled ====&lt;br /&gt;
No input, returns an output bool.&lt;br /&gt;
&lt;br /&gt;
==== IsRebootEnabled ====&lt;br /&gt;
No input, returns an output bool.&lt;br /&gt;
&lt;br /&gt;
==== LaunchSystemApplet ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This wraps [[NS_Services|ns]] LaunchSystemApplet, ignoring the u64 returned by that cmd (and other functionality).&lt;br /&gt;
&lt;br /&gt;
==== LaunchStarter ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is similar to [[#LaunchSystemApplet]], except this uses [[NS_Services|ns]] LaunchLibraryApplet with a ProgramId from global state.&lt;br /&gt;
&lt;br /&gt;
The global state field is initialized elsewhere with the value of [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!starter_id&amp;lt;/code&amp;gt;, defaulting to ProgramId 0100000000001012 ([[Title_list|starter]]) if not available.&lt;br /&gt;
&lt;br /&gt;
==== PopRequestLaunchApplicationForDebug ====&lt;br /&gt;
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output [[NCM_services#ApplicationId|ApplicationId]] and an output s32 &#039;&#039;&#039;total_userIDs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The total entries in the userID buffer must be &amp;gt;= {total userIDs in state}.&lt;br /&gt;
&lt;br /&gt;
==== IsForceTerminateApplicationDisabledForDebug ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
When the cached value loaded from [[Settings_services#GetDebugModeFlag]] is 0 this will just set the bool to 0. Otherwise, the bool is loaded using data from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!disable_force_terminate_application&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== LaunchDevMenu ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
Uses [[NS_Services|ns]] LaunchDevMenu.&lt;br /&gt;
&lt;br /&gt;
This is used by [[qlaunch]]. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== SetLastApplicationExitReason ====&lt;br /&gt;
Takes an input s32, no output.&lt;br /&gt;
&lt;br /&gt;
==== ILockAccessor ====&lt;br /&gt;
This is &amp;quot;nn::am::service::ILockAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#TryLock]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#Unlock]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [10.0.0+] [[#IsLocked]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== TryLock =====&lt;br /&gt;
Takes an input u8 bool flag, returns an output u8 bool flag and a handle.&lt;br /&gt;
&lt;br /&gt;
Official sw waits on the previously loaded event from [[#GetEvent]]. The output flag indicates whether locking was successful, the user-process can try using this cmd again when flag=false.&lt;br /&gt;
&lt;br /&gt;
Official sw only uses inflag=false. Official sw just closes the output handle. The input flag controls whether this returns the output handle.&lt;br /&gt;
&lt;br /&gt;
===== Unlock =====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
===== GetEvent =====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== IsLocked ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== IGlobalStateController ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IGlobalStateController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#RequestToEnterSleep]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#EnterSleep]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#StartSleepSequence]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#StartShutdownSequence]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#StartRebootSequence]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [7.0.0+] [[#IsAutoPowerDownRequested]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#LoadAndApplyIdlePolicySettings]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [2.0.0+] [[#NotifyCecSettingsChanged]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [3.0.0+] [[#SetDefaultHomeButtonLongPressTime]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [3.0.0+] [[#UpdateDefaultDisplayResolution]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [3.0.0+] [[#ShouldSleepOnBoot]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [4.0.0+] [[#GetHdcpAuthenticationFailedEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [12.0.0+] [[#OpenCradleFirmwareUpdater]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== RequestToEnterSleep ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
==== EnterSleep ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
==== StartSleepSequence ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Official sw uses hard-coded input value = 1.&lt;br /&gt;
&lt;br /&gt;
==== StartShutdownSequence ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== StartRebootSequence ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== IsAutoPowerDownRequested ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Uses [[#idle:sys]] cmd1.&lt;br /&gt;
&lt;br /&gt;
==== LoadAndApplyIdlePolicySettings ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Uses [[#idle:sys]] cmd LoadAndApplySettings.&lt;br /&gt;
&lt;br /&gt;
==== NotifyCecSettingsChanged ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Uses [[#omm]] cmd NotifyCecSettingsChanged.&lt;br /&gt;
&lt;br /&gt;
==== SetDefaultHomeButtonLongPressTime ====&lt;br /&gt;
Takes an input s64, no output.&lt;br /&gt;
&lt;br /&gt;
==== UpdateDefaultDisplayResolution ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Uses [[#omm]] cmd UpdateDefaultDisplayResolution.&lt;br /&gt;
&lt;br /&gt;
==== ShouldSleepOnBoot ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Uses [[#omm]] cmd ShouldSleepOnBoot.&lt;br /&gt;
&lt;br /&gt;
==== GetHdcpAuthenticationFailedEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
Uses [[#omm]] cmd GetHdcpAuthenticationFailedEvent.&lt;br /&gt;
&lt;br /&gt;
==== OpenCradleFirmwareUpdater ====&lt;br /&gt;
No input, returns an [[#ICradleFirmwareUpdater]].&lt;br /&gt;
&lt;br /&gt;
=== ICradleFirmwareUpdater ===&lt;br /&gt;
This is &amp;quot;nn::am::service::ICradleFirmwareUpdater&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [12.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || StartUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 1 || FinishUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetCradleDeviceInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetCradleDeviceInfoChangeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetUpdateProgressInfo&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetLastInternalResult&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GetCradleDeviceInfo ====&lt;br /&gt;
No input, returns a 8-byte CradleDeviceInfo.&lt;br /&gt;
&lt;br /&gt;
[13.0.0+] Now returns a total of 0xC-bytes.&lt;br /&gt;
&lt;br /&gt;
=== IApplicationCreator ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IApplicationCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#PopLaunchRequestedApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#CreateSystemApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#PopFloatingApplicationForDevelopment]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[#CreateApplication]]/[[#CreateSystemApplication]] eventually call the same internal func. With [[#CreateApplication]], two ptrs passed to the internal func are NULL, while with [[#CreateSystemApplication]] these are loaded from state. The initial content of [[#ApplicationLaunchRequestInfo]] is all-zero with [[#CreateSystemApplication]], while with [[#CreateApplication]] the first two u32s are value 0x3 with the rest all-zero. The [[#AppletId]] is set to 0x01 with [[#CreateApplication]], while with [[#CreateSystemApplication]] it&#039;s 0x04.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplication ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an [[#IApplicationAccessor]].&lt;br /&gt;
&lt;br /&gt;
==== PopLaunchRequestedApplication ====&lt;br /&gt;
No input, returns an [[#IApplicationAccessor]].&lt;br /&gt;
&lt;br /&gt;
==== CreateSystemApplication ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|SystemApplicationId]], returns an [[#IApplicationAccessor]].&lt;br /&gt;
&lt;br /&gt;
[[qlaunch]] only uses this with a hard-coded id for the &amp;quot;starter&amp;quot; title.&lt;br /&gt;
&lt;br /&gt;
==== PopFloatingApplicationForDevelopment ====&lt;br /&gt;
No input, returns an [[#IApplicationAccessor]].&lt;br /&gt;
&lt;br /&gt;
Should not be used if no FloatingApplication is available (svcBreak).&lt;br /&gt;
&lt;br /&gt;
==== IApplicationAccessor ====&lt;br /&gt;
This is &amp;quot;nn::am::service::IApplicationAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetAppletStateChangedEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#IsCompleted]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#Start]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#RequestExit]] || &lt;br /&gt;
|-&lt;br /&gt;
| 25 || [[#Terminate]] || &lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#GetResult]] || &lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#RequestForApplicationToGetForeground]] || &lt;br /&gt;
|-&lt;br /&gt;
| 110 || [[#TerminateAllLibraryApplets]] || &lt;br /&gt;
|-&lt;br /&gt;
| 111 || [[#AreAnyLibraryAppletsLeft]] || &lt;br /&gt;
|-&lt;br /&gt;
| 112 || [[#GetCurrentLibraryApplet]] || &lt;br /&gt;
|-&lt;br /&gt;
| 120 || [[#GetApplicationId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 121 || [[#PushLaunchParameter]] || &lt;br /&gt;
|-&lt;br /&gt;
| 122 || [[#GetApplicationControlProperty]] || &lt;br /&gt;
|-&lt;br /&gt;
| 123 || [2.0.0+] [[#GetApplicationLaunchProperty]] || &lt;br /&gt;
|-&lt;br /&gt;
| 124 || [6.0.0+] [[#GetApplicationLaunchRequestInfo]] || &lt;br /&gt;
|-&lt;br /&gt;
| 130 || [6.0.0+] [[#SetUsers]] || &lt;br /&gt;
|-&lt;br /&gt;
| 131 || [6.0.0+] [[#CheckRightsEnvironmentAvailable]] || &lt;br /&gt;
|-&lt;br /&gt;
| 132 || [6.0.0+] [[#GetNsRightsEnvironmentHandle]] || &lt;br /&gt;
|-&lt;br /&gt;
| 140 || [6.0.0+] [[#GetDesirableUids]] || &lt;br /&gt;
|-&lt;br /&gt;
| 150 || [6.0.0+] [[#ReportApplicationExitTimeout]] || &lt;br /&gt;
|-&lt;br /&gt;
| 160 || [8.0.0+] [[#SetApplicationAttribute]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 170 || [8.0.0+] [[#HasSaveDataAccessPermission]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 180 || [9.0.0+] [[#PushToFriendInvitationStorageChannel]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 190 || [9.0.0+] [[#PushToNotificationStorageChannel]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [10.0.0+] [[#RequestApplicationSoftReset]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [10.0.0+] [[#RestartApplicationTimer]] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Commands &amp;lt;=30 are inherited from [[#IAppletAccessor]].&lt;br /&gt;
&lt;br /&gt;
===== RequestForApplicationToGetForeground =====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
===== GetCurrentLibraryApplet =====&lt;br /&gt;
No input, returns an output [[#IAppletAccessor]].&lt;br /&gt;
&lt;br /&gt;
===== GetApplicationId =====&lt;br /&gt;
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].&lt;br /&gt;
&lt;br /&gt;
===== PushLaunchParameter =====&lt;br /&gt;
Takes an input u32 [[#LaunchParameterKind]] and an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
===== GetApplicationControlProperty =====&lt;br /&gt;
No input, takes a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
The output buffer must be at least 0x4000-bytes. Returns an error when the [[#AppletId]] is 0x04, aka when the IApplicationAccessor is for a SystemApplication. &lt;br /&gt;
&lt;br /&gt;
This gets the application [[NACP_Format|control.nacp]].&lt;br /&gt;
&lt;br /&gt;
===== GetApplicationLaunchProperty =====&lt;br /&gt;
Takes a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
The output buffer size must be at least 0x10-bytes. Returns an error when the [[#AppletId]] is 0x04, aka when the IApplicationAccessor is for a SystemApplication.&lt;br /&gt;
&lt;br /&gt;
This gets the [[#ApplicationLaunchProperty]].&lt;br /&gt;
&lt;br /&gt;
===== GetApplicationLaunchRequestInfo =====&lt;br /&gt;
No input, returns an output 0x10-byte struct.&lt;br /&gt;
&lt;br /&gt;
This gets the [[#ApplicationLaunchRequestInfo]] from state. The output struct is &amp;quot;nn::applet::ApplicationLaunchRequestInfo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== SetUsers =====&lt;br /&gt;
Takes an input u8 bool flag and a type-0x5 input buffer containing an array of u128 userIDs.&lt;br /&gt;
&lt;br /&gt;
The total entries for the userIDs must be &amp;lt;=8.&lt;br /&gt;
&lt;br /&gt;
When the input flag is true, this just clears the &#039;&#039;&#039;users_available&#039;&#039;&#039; state flag to 0 and returns.&lt;br /&gt;
&lt;br /&gt;
===== CheckRightsEnvironmentAvailable =====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
===== GetNsRightsEnvironmentHandle =====&lt;br /&gt;
No input, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
===== GetDesirableUids =====&lt;br /&gt;
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output s32 &#039;&#039;&#039;total_entries&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Gets a userID listing, this is unrelated to [[#SetUsers]]. [[qlaunch]] only uses 1 userID with this.&lt;br /&gt;
&lt;br /&gt;
The stored entry-count in state must be &amp;lt;= &amp;lt;size of output buffer in entries&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== ReportApplicationExitTimeout =====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
===== SetApplicationAttribute =====&lt;br /&gt;
Takes a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.&lt;br /&gt;
&lt;br /&gt;
===== HasSaveDataAccessPermission =====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u8 bool flag.&lt;br /&gt;
&lt;br /&gt;
Gets whether the savedata specified by the input ApplicationId is accessible. The output flag indicates whether it&#039;s accessible.&lt;br /&gt;
&lt;br /&gt;
If the ApplicationId matches the current application, this immediately returns success with flag=1.&lt;br /&gt;
&lt;br /&gt;
===== PushToFriendInvitationStorageChannel =====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
Clears the FriendInvitation StorageChannel, then pushes the input storage there.&lt;br /&gt;
&lt;br /&gt;
===== PushToNotificationStorageChannel =====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
Clears the Notification StorageChannel, then pushes the input storage there.&lt;br /&gt;
&lt;br /&gt;
[[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.&lt;br /&gt;
&lt;br /&gt;
===== RequestApplicationSoftReset =====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
===== RestartApplicationTimer =====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
===== IAppletAccessor =====&lt;br /&gt;
This is &amp;quot;nn::am::service::IAppletAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetAppletStateChangedEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#IsCompleted]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#Start]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#RequestExit]]&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [[#Terminate]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#GetResult]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GetAppletStateChangedEvent ====&lt;br /&gt;
No input, returns an output event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== IsCompleted ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
==== Start ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== RequestExit ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== Terminate ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== GetResult====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
== IAppletCommonFunctions ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IAppletCommonFunctions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [7.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [9.0.0+] [[#SetTerminateResult]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#ReadThemeStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#WriteThemeStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [9.0.0+] [[#PushToAppletBoundChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [9.0.0+] [[#TryPopFromAppletBoundChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [8.0.0+] [[#GetDisplayLogicalResolution]]&lt;br /&gt;
|-&lt;br /&gt;
| 42 || [8.0.0+] [[#SetDisplayMagnification]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [8.0.0+] [[#SetHomeButtonDoubleClickEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [8.0.0+] [[#GetHomeButtonDoubleClickEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 52 || [10.0.0+] [[#IsHomeButtonShortPressedBlocked]]&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [11.0.0+] [[#IsVrModeCurtainRequired]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || [12.0.0+] IsSleepRequiredByHighTemperature&lt;br /&gt;
|-&lt;br /&gt;
| 62 || [12.0.0+] IsSleepRequiredByLowBattery&lt;br /&gt;
|-&lt;br /&gt;
| 70 || [11.0.0+] [[#SetCpuBoostRequestPriority]]&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [14.0.0+] SetHandlingCaptureButtonShortPressedMessageEnabledForApplet&lt;br /&gt;
|-&lt;br /&gt;
| 81 || [14.0.0+] SetHandlingCaptureButtonLongPressedMessageEnabledForApplet&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [15.0.0+] OpenNamedChannelAsParent&lt;br /&gt;
|-&lt;br /&gt;
| 91 || [15.0.0+] OpenNamedChannelAsChild&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [15.0.0+] SetApplicationCoreUsageMode&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [17.0.0+] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
ReadThemeStorage/WriteThemeStorage: these commands copy data from/to a state buffer and the user specified buffer. The size of the state buffer is 0x400-bytes. The default content of the ThemeStorage prior to using the WriteThemeStorage cmd, is: &amp;lt;code&amp;gt;memset(statebuf, 0xAA, 0x400);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReadThemeStorage ===&lt;br /&gt;
Takes an input u64 &#039;&#039;&#039;offset&#039;&#039;&#039; and a type-0x22 output buffer, returns an output u64 &#039;&#039;&#039;actual_transfer_size&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== WriteThemeStorage ===&lt;br /&gt;
Takes an input u64 &#039;&#039;&#039;offset&#039;&#039;&#039; and a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
=== PushToAppletBoundChannel ===&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
This is similar to [[#PushToAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.&lt;br /&gt;
&lt;br /&gt;
=== TryPopFromAppletBoundChannel ===&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
This is similar to [[#TryPopFromAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.&lt;br /&gt;
&lt;br /&gt;
=== GetDisplayLogicalResolution ===&lt;br /&gt;
No input, returns an output s32 &#039;&#039;&#039;width&#039;&#039;&#039; and s32 &#039;&#039;&#039;height&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== SetDisplayMagnification ===&lt;br /&gt;
Takes an input float &#039;&#039;&#039;x&#039;&#039;&#039;, float &#039;&#039;&#039;y&#039;&#039;&#039;, float &#039;&#039;&#039;width&#039;&#039;&#039;, and float &#039;&#039;&#039;height&#039;&#039;&#039;, no output.&lt;br /&gt;
&lt;br /&gt;
Sets the DisplayMagnification. This is essentially layer image crop, for everything non-Overlay.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;x&#039;&#039;&#039; and &#039;&#039;&#039;width&#039;&#039;&#039; are multiplied with the same width value returned by [[#GetDisplayLogicalResolution]], so these should be in the range 0.0f-1.0f. Likewise for y and height, except these are multipled with the height value.&lt;br /&gt;
&lt;br /&gt;
=== SetHomeButtonDoubleClickEnabled ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== GetHomeButtonDoubleClickEnabled ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== IsHomeButtonShortPressedBlocked ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== IsVrModeCurtainRequired ===&lt;br /&gt;
No input, returns an output bool.&lt;br /&gt;
&lt;br /&gt;
=== SetCpuBoostRequestPriority ===&lt;br /&gt;
Takes an input s32, no output.&lt;br /&gt;
&lt;br /&gt;
== ILibraryAppletProxy ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ILibraryAppletProxy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetSelfController || Returns an [[#ISelfController]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetWindowController || Returns an [[#IWindowController]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetAudioController || Returns an [[#IAudioController]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetDisplayController || Returns an [[#IDisplayController]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].&lt;br /&gt;
|-&lt;br /&gt;
| 20 || OpenLibraryAppletSelfAccessor || Returns an [[#ILibraryAppletSelfAccessor]].&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [15.0.0+] GetHomeMenuFunctions || No input, returns an [[#IHomeMenuFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ILibraryAppletSelfAccessor ===&lt;br /&gt;
This is &amp;quot;nn::am::service::ILibraryAppletSelfAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#PopInData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#PushOutData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#PopInteractiveInData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#PushInteractiveOutData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetPopInDataEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#GetPopInteractiveInDataEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#ExitProcessAndReturn]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#GetLibraryAppletInfo]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#GetMainAppletIdentityInfo]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#CanUseApplicationCore]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#GetCallerAppletIdentityInfo]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [2.0.0+] [[#GetMainAppletApplicationControlProperty]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [2.0.0+] [[#GetMainAppletStorageId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [3.0.0+] [[#GetCallerAppletIdentityInfoStack]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [4.0.0+] [[#GetNextReturnDestinationAppletIdentityInfo]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [4.0.0+] [[#GetDesirableKeyboardLayout]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#PopExtraStorage]] || &lt;br /&gt;
|-&lt;br /&gt;
| 25 || [[#GetPopExtraStorageEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#UnpopInData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 31 || [[#UnpopExtraStorage]] || &lt;br /&gt;
|-&lt;br /&gt;
| 40 || [2.0.0+] [[#GetIndirectLayerProducerHandle]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [3.0.0+] [[#ReportVisibleError]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [4.0.0+] [[#ReportVisibleErrorWithErrorContext]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [4.0.0+] [[#GetMainAppletApplicationDesiredLanguage]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 70 || [8.0.0+] [[#GetCurrentApplicationId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [6.0.0+] [[#RequestExitToSelf]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [5.0.0+] [[#CreateApplicationAndPushAndRequestToLaunch]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [4.0.0+] [[#CreateGameMovieTrimmer]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [5.0.0+] [[#ReserveResourceForMovieOperation]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [5.0.0+] [[#UnreserveResourceForMovieOperation]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [6.0.0+] [[#GetMainAppletAvailableUsers]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [9.0.0+] [[#GetLaunchStorageInfoForDebug]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 130 || [9.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 140 || [10.0.0+] [[#SetApplicationMemoryReservation]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 150 || [10.0.0+] [[#ShouldSetGpuTimeSliceManually]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 160 || [17.0.0+]  || [[#Cmd160]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== PopInData ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== PushOutData ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== PopInteractiveInData ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== PushInteractiveOutData ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== GetPopInDataEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== GetPopInteractiveInDataEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== ExitProcessAndReturn ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Exits the LibraryApplet and returns to running the title which launched this LibraryApplet ([[qlaunch]] for example).&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== GetLibraryAppletInfo ====&lt;br /&gt;
No input, returns an output [[#LibraryAppletInfo]].&lt;br /&gt;
&lt;br /&gt;
==== GetMainAppletIdentityInfo ====&lt;br /&gt;
No input, returns an output [[#AppletIdentityInfo]].&lt;br /&gt;
&lt;br /&gt;
==== CanUseApplicationCore ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
==== GetCallerAppletIdentityInfo ====&lt;br /&gt;
No input, returns an output [[#AppletIdentityInfo]].&lt;br /&gt;
&lt;br /&gt;
==== GetMainAppletApplicationControlProperty ====&lt;br /&gt;
No input, takes a type-0x16 output buffer.&lt;br /&gt;
&lt;br /&gt;
This gets the [[NACP_Format|control.nacp]].&lt;br /&gt;
&lt;br /&gt;
==== GetMainAppletStorageId ====&lt;br /&gt;
No input, returns an output u8 storageId.&lt;br /&gt;
&lt;br /&gt;
==== GetCallerAppletIdentityInfoStack ====&lt;br /&gt;
Takes a type-0x6 output buffer containing an array of [[#AppletIdentityInfo]], and returns an output s32 total_entries.&lt;br /&gt;
&lt;br /&gt;
==== GetNextReturnDestinationAppletIdentityInfo ====&lt;br /&gt;
No input, returns an output [[#AppletIdentityInfo]].&lt;br /&gt;
&lt;br /&gt;
==== GetDesirableKeyboardLayout ====&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
The output u32 is &amp;quot;nn::settings::KeyboardLayout&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This gets the value previously set by [[#SetDesirableKeyboardLayout]]. An error is returned if it&#039;s not set.&lt;br /&gt;
&lt;br /&gt;
==== PopExtraStorage ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== GetPopExtraStorageEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== UnpopInData ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== UnpopExtraStorage ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== GetIndirectLayerProducerHandle ====&lt;br /&gt;
No input, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
==== ReportVisibleError ====&lt;br /&gt;
Takes an input [[Error_Applet#ErrorCode|ErrorCode]], no output.&lt;br /&gt;
&lt;br /&gt;
==== ReportVisibleErrorWithErrorContext ====&lt;br /&gt;
Takes an input [[Error_Applet#ErrorCode|ErrorCode]] and a type-0x15 input buffer containing an [[Error_Applet#ErrorContext|ErrorContext]], no output.&lt;br /&gt;
&lt;br /&gt;
==== GetMainAppletApplicationDesiredLanguage ====&lt;br /&gt;
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].&lt;br /&gt;
&lt;br /&gt;
==== GetCurrentApplicationId ====&lt;br /&gt;
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].&lt;br /&gt;
&lt;br /&gt;
Gets the [[NCM_services#ApplicationId|ApplicationId]] for the currently running Application. ApplicationId=0 when no Application is running.&lt;br /&gt;
&lt;br /&gt;
==== RequestExitToSelf ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#RequestExit]] except this is for the current applet.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationAndPushAndRequestToLaunch ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input #IStorage, no output.&lt;br /&gt;
&lt;br /&gt;
This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].&lt;br /&gt;
&lt;br /&gt;
==== CreateGameMovieTrimmer ====&lt;br /&gt;
Takes an input u64 size and a TransferMemory handle, returns a GRC [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].&lt;br /&gt;
&lt;br /&gt;
This is a wrapper for GRC [[GRC_services#OpenGameMovieTrimmer|OpenGameMovieTrimmer]].&lt;br /&gt;
&lt;br /&gt;
Official sw uses an user-buffer for the tmem, with permissions=0.&lt;br /&gt;
&lt;br /&gt;
==== ReserveResourceForMovieOperation ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Updates state fields. This must be used before [[#CreateGameMovieTrimmer]].&lt;br /&gt;
&lt;br /&gt;
==== UnreserveResourceForMovieOperation ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Updates state fields. This must be used once finished with [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].&lt;br /&gt;
&lt;br /&gt;
==== GetMainAppletAvailableUsers ====&lt;br /&gt;
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output u8 bool and a s32 &#039;&#039;&#039;total_entries&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This gets the userIDs previously set by [[#SetUsers]].&lt;br /&gt;
&lt;br /&gt;
The size of the output buffer in entries must be at least 8.&lt;br /&gt;
&lt;br /&gt;
Normally the output bool is set to 0, however when no users are available it&#039;s set to 1 with &#039;&#039;&#039;total_entries&#039;&#039;&#039; = -1.&lt;br /&gt;
&lt;br /&gt;
==== SetApplicationMemoryReservation ====&lt;br /&gt;
Takes an input u64, no output.&lt;br /&gt;
&lt;br /&gt;
An Application must be currently running. The input u64 must be 0x1000-byte aligned.&lt;br /&gt;
&lt;br /&gt;
==== ShouldSetGpuTimeSliceManually ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
==== Cmd160 ====&lt;br /&gt;
No input, returns an output u64. Currently always returns 0.&lt;br /&gt;
&lt;br /&gt;
== IOverlayAppletProxy ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IOverlayAppletProxy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetSelfController || Returns an [[#ISelfController]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetWindowController || Returns an [[#IWindowController]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetAudioController || Returns an [[#IAudioController]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetDisplayController || Returns an [[#IDisplayController]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].&lt;br /&gt;
|-&lt;br /&gt;
| 20 || GetOverlayFunctions || Returns an [[#IOverlayFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IOverlayFunctions ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IOverlayFunctions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#BeginToWatchShortHomeButtonMessage]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#EndToWatchShortHomeButtonMessage]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetApplicationIdForLogo]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#SetGpuTimeSliceBoost]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [2.0.0+] [[#SetAutoSleepTimeAndDimmingTimeEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [2.0.0+] [[#TerminateApplicationAndSetReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [3.0.0+] [[#SetScreenShotPermissionGlobally]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [6.0.0+] [[#StartShutdownSequenceForOverlay]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [6.0.0+] [[#StartRebootSequenceForOverlay]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [14.0.0+] SetHandlingTouchScreenInputEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [9.0.0+] [[#SetHealthWarningShowingState]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [10.0.0+] [[#IsHealthWarningRequired]]&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [5.0.0+] [[#BeginToObserveHidInputForDevelop]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== BeginToWatchShortHomeButtonMessage ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== EndToWatchShortHomeButtonMessage ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== GetApplicationIdForLogo ====&lt;br /&gt;
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].&lt;br /&gt;
&lt;br /&gt;
Gets the ApplicationId for displaying the logo screen during application launch.&lt;br /&gt;
&lt;br /&gt;
When no application is running, this returns success with ApplicationId=0.&lt;br /&gt;
&lt;br /&gt;
==== SetGpuTimeSliceBoost ====&lt;br /&gt;
Takes an input u64, no output.&lt;br /&gt;
&lt;br /&gt;
==== SetAutoSleepTimeAndDimmingTimeEnabled ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== TerminateApplicationAndSetReason ====&lt;br /&gt;
Takes an input u32 Result, no output.&lt;br /&gt;
&lt;br /&gt;
==== SetScreenShotPermissionGlobally ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== StartShutdownSequenceForOverlay ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== StartRebootSequenceForOverlay ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== SetHandlingHomeButtonShortPressedEnabled ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== SetHealthWarningShowingState ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
This writes the input bool into state, signals an Event, and returns 0.&lt;br /&gt;
&lt;br /&gt;
==== IsHealthWarningRequired ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
==== SetRequiresGpuResourceUse ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Just returns 0.&lt;br /&gt;
&lt;br /&gt;
==== BeginToObserveHidInputForDevelop ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Sets various state fields and signals an userspace-event.&lt;br /&gt;
&lt;br /&gt;
Enables HID input for the OverlayApplet, without disabling input for the foreground applet.&lt;br /&gt;
&lt;br /&gt;
== IApplicationProxy ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IApplicationProxy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetSelfController || Returns an [[#ISelfController]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetWindowController || Returns an [[#IWindowController]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetAudioController || Returns an [[#IAudioController]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetDisplayController || Returns an [[#IDisplayController]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].&lt;br /&gt;
|-&lt;br /&gt;
| 20 || GetApplicationFunctions || Returns an [[#IApplicationFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IApplicationFunctions ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IApplicationFunctions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#PopLaunchParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#CreateApplicationAndPushAndRequestToStart]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#EnsureSaveData]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetDesiredLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [[#SetTerminateResult]]&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [[#GetDisplayVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [3.0.0+] ExtendSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 26 || [3.0.0+] GetSaveDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 27 || [5.0.0+] CreateCacheStorage&lt;br /&gt;
|-&lt;br /&gt;
| 28 || [11.0.0+] [[#GetSaveDataSizeMax]]&lt;br /&gt;
|-&lt;br /&gt;
| 29 || [11.0.0+] [[#GetCacheStorageMax]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]]&lt;br /&gt;
|-&lt;br /&gt;
| 32 || [[#BeginBlockingHomeButton]]&lt;br /&gt;
|-&lt;br /&gt;
| 33 || [[#EndBlockingHomeButton]]&lt;br /&gt;
|-&lt;br /&gt;
| 34 || [10.0.0-15.0.1] [[#SelectApplicationLicense]]&lt;br /&gt;
|-&lt;br /&gt;
| 35 || [11.0.0+] [[#GetDeviceSaveDataSizeMax]]&lt;br /&gt;
|-&lt;br /&gt;
| 36 || [14.0.0+] GetLimitedApplicationLicense&lt;br /&gt;
|-&lt;br /&gt;
| 37 || [14.0.0+] GetLimitedApplicationLicenseUpgradableEvent&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [[#NotifyRunning]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [2.0.0+] [[#GetPseudoDeviceId]]&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]]&lt;br /&gt;
|-&lt;br /&gt;
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]]&lt;br /&gt;
|-&lt;br /&gt;
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]]&lt;br /&gt;
|-&lt;br /&gt;
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 70 || [3.0.0+] [[#RequestToShutdown]]&lt;br /&gt;
|-&lt;br /&gt;
| 71 || [3.0.0+] [[#RequestToReboot]]&lt;br /&gt;
|-&lt;br /&gt;
| 72 || [10.0.0+] [[#RequestToSleep]]&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]]&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]] &lt;br /&gt;
|-&lt;br /&gt;
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]]&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]]&lt;br /&gt;
|-&lt;br /&gt;
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]]&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [5.0.0+] [[#ExecuteProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 121 || [5.0.0+] [[#ClearUserChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 122 || [5.0.0+] [[#UnpopToUserChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]]&lt;br /&gt;
|-&lt;br /&gt;
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]]&lt;br /&gt;
|-&lt;br /&gt;
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 131 || [11.0.0+] [[#SetDelayTimeToAbortOnGpuError]]&lt;br /&gt;
|-&lt;br /&gt;
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]] &lt;br /&gt;
|-&lt;br /&gt;
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 160 || [9.0.0+] [[#GetHealthWarningDisappearedSystemEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 170 || [9.0.0+] [[#SetHdcpAuthenticationActivated]]&lt;br /&gt;
|-&lt;br /&gt;
| 180 || [10.1.0+] [[#GetLaunchRequiredVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 181 || [10.1.0+] [[#UpgradeLaunchRequiredVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 190 || [11.0.0+] [[#SendServerMaintenanceOverlayNotification]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [11.0.0+] [[#GetLastApplicationExitReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [5.0.0+] [[#CreateMovieMaker]]&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || [5.0.0+] [[#PrepareForJit]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The BOTW game uses this GamePlayRecording functionality from the main-nso &amp;quot;nninitStartup&amp;quot; function, with size 0x6000000(96MiB). The official GamePlayRecording-enable code does the following(this will panic on any failure):&lt;br /&gt;
* [[SVC|Creates]] TransferMemory using the input buffer and size, with permissions=0.&lt;br /&gt;
* Uses [[#InitializeGamePlayRecording]] with the TransferMemory.&lt;br /&gt;
* Closes the TransferMemory handle, + TransferMemory cleanup.&lt;br /&gt;
* Uses [[#SetGamePlayRecordingState]] with value 0x1.&lt;br /&gt;
This GamePlayRecording functionality presumably enables the video-recording usable starting with [[4.0.0]].&lt;br /&gt;
&lt;br /&gt;
==== PopLaunchParameter ====&lt;br /&gt;
Takes an input u32 [[#LaunchParameterKind]], returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
Pops a LaunchParameter [[#IStorage]], the storage will be removed from sysmodule state during this.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationAndPushAndRequestToStart ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input [[#IStorage]], no output. ApplicationId=0 can be used to relaunch the current application.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationAndPushAndRequestToStartForQuest ====&lt;br /&gt;
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]), an input [[NCM_services#ApplicationId|ApplicationId]], and an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationAndRequestToStart ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#CreateApplicationAndPushAndRequestToStart]] except without the input storage, official sw uses this when no input storage is specified.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationAndRequestToStartForQuest ====&lt;br /&gt;
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]) and an input [[NCM_services#ApplicationId|ApplicationId]], no output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except without the input storage, official sw uses this when no input storage is specified.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]], a type-0x15 input buffer containing an [[#ApplicationAttribute]], an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationWithAttributeAndRequestToStartForQuest ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==== EnsureSaveData ====&lt;br /&gt;
Takes an input u128 userID, returns an output u64 size.&lt;br /&gt;
&lt;br /&gt;
Calls sdk func &amp;lt;code&amp;gt;nn::fs::EnsureApplicationSaveData&amp;lt;/code&amp;gt;. [[qlaunch]] also calls this same sdk func directly.&lt;br /&gt;
&lt;br /&gt;
Creates the various savedata as specified by the application [[NACP_Format|control.nacp]] when the savedata doesn&#039;t exist.&lt;br /&gt;
&lt;br /&gt;
Official user-processes launch the dataErase LibraryApplet depending on the Result, the above output size is used with this.&lt;br /&gt;
&lt;br /&gt;
==== GetDesiredLanguage ====&lt;br /&gt;
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].&lt;br /&gt;
&lt;br /&gt;
==== SetTerminateResult ====&lt;br /&gt;
Takes an input u32 &#039;&#039;&#039;Result&#039;&#039;&#039;, no output.&lt;br /&gt;
&lt;br /&gt;
For example, in some cases official apps use this with [[Error_codes|error]] 0x2A2 then uses svcBreak.&lt;br /&gt;
&lt;br /&gt;
==== GetDisplayVersion ====&lt;br /&gt;
No input, returns an output 0x10-byte struct.&lt;br /&gt;
&lt;br /&gt;
The output struct is &amp;quot;nn::oe::DisplayVersion&amp;quot;. This the DisplayVersion string copied from the application [[NACP_Format|control.nacp]], this is always NUL-terminated.&lt;br /&gt;
&lt;br /&gt;
==== GetLaunchStorageInfoForDebug ====&lt;br /&gt;
No input, returns an output u8 [[Filesystem_services#StorageId|StorageId]] and u8 [[Filesystem_services#StorageId|StorageId]].&lt;br /&gt;
&lt;br /&gt;
This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].&lt;br /&gt;
&lt;br /&gt;
==== GetSaveDataSizeMax ====&lt;br /&gt;
No input, returns two ouput s64s.&lt;br /&gt;
&lt;br /&gt;
==== GetCacheStorageMax ====&lt;br /&gt;
No input, returns an output s32 and s64.&lt;br /&gt;
&lt;br /&gt;
==== BeginBlockingHomeButtonShortAndLongPressed ====&lt;br /&gt;
Takes an input s64, no output.&lt;br /&gt;
&lt;br /&gt;
Official user-processes use hard-coded value 0 for the s64.&lt;br /&gt;
&lt;br /&gt;
Starts blocking the Home button.&lt;br /&gt;
&lt;br /&gt;
==== EndBlockingHomeButtonShortAndLongPressed ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Ends the blocking started by [[#BeginBlockingHomeButtonShortAndLongPressed]].&lt;br /&gt;
&lt;br /&gt;
==== BeginBlockingHomeButton ====&lt;br /&gt;
Takes an input s64 nanoseconds, no output. The input nanoseconds can be zero.&lt;br /&gt;
&lt;br /&gt;
==== EndBlockingHomeButton ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== SelectApplicationLicense ====&lt;br /&gt;
Takes an input array of [[#ApplicationLicenseType]], returns an output [[#ApplicationLicenseType]].&lt;br /&gt;
&lt;br /&gt;
==== GetDeviceSaveDataSizeMax ====&lt;br /&gt;
No input, returns two output s64s.&lt;br /&gt;
&lt;br /&gt;
==== NotifyRunning ====&lt;br /&gt;
Takes no input. Returns an output u8 bool, which is ignored by official user-processes.&lt;br /&gt;
&lt;br /&gt;
==== GetPseudoDeviceId ====&lt;br /&gt;
No input, returns an output 0x10-byte &amp;quot;nn::util::Uuid&amp;quot; struct.&lt;br /&gt;
&lt;br /&gt;
The 0x20-byte output data from [[NS_Services|GetSystemSeedForPseudoDeviceId]] followed by the 8-byte [[NACP_Format|SeedForPseudoDeviceId]] from the current control.nacp, is hashed with SHA1. Then &amp;quot;nn::util::GenerateUuidVersion5&amp;quot; is called with the final hash, the output from this is then returned for the Uuid.&lt;br /&gt;
&lt;br /&gt;
==== SetMediaPlaybackStateForApplication ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== IsGamePlayRecordingSupported ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
==== InitializeGamePlayRecording ====&lt;br /&gt;
Takes a TransferMemory handle and an u64 for the size of the TransferMemory. The size must match 0x6000000 otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
==== SetGamePlayRecordingState ====&lt;br /&gt;
Takes an input u32. 0 = disable/pause, 1 = enable/restart.&lt;br /&gt;
&lt;br /&gt;
==== RequestFlushGamePlayingMovieForDebug ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Requests to save the video recording, as if the Capture-button was held.&lt;br /&gt;
&lt;br /&gt;
==== RequestToShutdown ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== RequestToReboot ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== RequestToSleep ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== ExitAndRequestToShowThanksMessage ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Used to exit the application and return to the kiosk menu. Official sw uses [[#UnlockExit]] immediately before this if needed.&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
This throws an error when the cached [[Settings_services#GetQuestFlag]] value is 0.&lt;br /&gt;
&lt;br /&gt;
==== EnableApplicationCrashReport ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== InitializeApplicationCopyrightFrameBuffer ====&lt;br /&gt;
Takes an input TransferMemory handle, an s32 &#039;&#039;&#039;width&#039;&#039;&#039;, an s32 &#039;&#039;&#039;height&#039;&#039;&#039;, an u64 tmem_size, and no output.&lt;br /&gt;
&lt;br /&gt;
tmem_size must be 0x40000-byte aligned. &#039;&#039;&#039;width&#039;&#039;&#039; must be 1-1280, and &#039;&#039;&#039;height&#039;&#039;&#039; must be 1-720.&lt;br /&gt;
&lt;br /&gt;
User-processes create the tmem with an user-specified buffer with permissions=0. &#039;&#039;&#039;width&#039;&#039;&#039; = 1280 and &#039;&#039;&#039;height&#039;&#039;&#039; = 720.&lt;br /&gt;
&lt;br /&gt;
After the validation checks pass the input is passed to [[OMM_services|ommdisp]] cmd500.&lt;br /&gt;
&lt;br /&gt;
This is used as an overlay for screenshots.&lt;br /&gt;
&lt;br /&gt;
==== SetApplicationCopyrightImage ====&lt;br /&gt;
Takes a type-0x45 input buffer, an s32 &#039;&#039;&#039;x&#039;&#039;&#039;, an s32 &#039;&#039;&#039;y&#039;&#039;&#039;, an s32 &#039;&#039;&#039;width&#039;&#039;&#039;, an s32 &#039;&#039;&#039;height&#039;&#039;&#039;, an s32 [[#WindowOriginMode]], and no output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;x&#039;&#039;&#039; and &#039;&#039;&#039;y&#039;&#039;&#039; must not have the negative bit set. &#039;&#039;&#039;width&#039;&#039;&#039; and &#039;&#039;&#039;height&#039;&#039;&#039; must not be &amp;lt;1.&lt;br /&gt;
&lt;br /&gt;
Sets the RGBA8 image for use with [[#InitializeApplicationCopyrightFrameBuffer]]. Overrides the current image, if this was already used previously.&lt;br /&gt;
&lt;br /&gt;
==== SetApplicationCopyrightVisibility ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Sets the visibility for the image set by [[#SetApplicationCopyrightImage]], in screenshots. By default it&#039;s visible.&lt;br /&gt;
&lt;br /&gt;
==== QueryApplicationPlayStatistics ====&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The number of entries in each array is the same.&lt;br /&gt;
&lt;br /&gt;
See also [[NACP_Format#PlayLogQueryCapability|PlayLogQueryCapability]].&lt;br /&gt;
&lt;br /&gt;
This uses [[Shared_Database_services|pdm:qry]] QueryApplicationPlayStatisticsForSystem.&lt;br /&gt;
&lt;br /&gt;
==== QueryApplicationPlayStatisticsByUid ====&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs. &lt;br /&gt;
&lt;br /&gt;
==== ExecuteProgram ====&lt;br /&gt;
Takes an input u32 [[#ProgramSpecifyKind]] and an input u64, no output.&lt;br /&gt;
&lt;br /&gt;
==== ClearUserChannel ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Clears the UserChannel used by [[#UnpopToUserChannel]].&lt;br /&gt;
&lt;br /&gt;
==== UnpopToUserChannel ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
The input storage is pushed to the UserChannel. This is the same channel used by [[#LaunchParameterKind]] value 1.&lt;br /&gt;
&lt;br /&gt;
User-processes create a storage using data specified by the user (written to offset=0 size=inputsize), with max size 0x1000. This storage is then used with this cmd.&lt;br /&gt;
&lt;br /&gt;
==== GetPreviousProgramIndex ====&lt;br /&gt;
No input, returns an output s32.&lt;br /&gt;
&lt;br /&gt;
Gets the ProgramIndex of the Application which launched this title. The output ProgramIndex is -1 when there was no previous title.&lt;br /&gt;
&lt;br /&gt;
==== EnableApplicationAllThreadDumpOnCrash ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== GetGpuErrorDetectedSystemEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==== SetDelayTimeToAbortOnGpuError ====&lt;br /&gt;
Takes an input s64 &amp;quot;nn::TimeSpan&amp;quot;, no output.&lt;br /&gt;
&lt;br /&gt;
==== GetFriendInvitationStorageChannelEvent ====&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
This is exposed by sdknso under &amp;lt;code&amp;gt;nn::friends::&amp;lt;/code&amp;gt;. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.&lt;br /&gt;
&lt;br /&gt;
==== TryPopFromFriendInvitationStorageChannel ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
This uses the same StorageChannel as [[#PushToFriendInvitationStorageChannel]].&lt;br /&gt;
&lt;br /&gt;
This is exposed by sdknso under &amp;lt;code&amp;gt;nn::friends::&amp;lt;/code&amp;gt;. When the storage_size is &amp;lt;0x10, this returns false. &amp;lt;code&amp;gt;data_size = storage_size-0x10;&amp;lt;/code&amp;gt; Then the first 0x10-bytes from storage are read to stack, which is later copied to the output Uid on success prior to returning. Then the storage is read into the specified output buffer with storage-offset 0x10, where the size is &amp;lt;code&amp;gt;size = data_size &amp;gt; buf_size ? buf_size : data_size&amp;lt;/code&amp;gt;. Reading is skipped if size is zero. Afterwards the used size is written to an output param. On success, true is returned.&lt;br /&gt;
&lt;br /&gt;
==== GetNotificationStorageChannelEvent ====&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
This is exposed by sdknso under &amp;lt;code&amp;gt;nn::notification::&amp;lt;/code&amp;gt;. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.&lt;br /&gt;
&lt;br /&gt;
==== TryPopFromNotificationStorageChannel ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
This uses the same StorageChannel as [[#PushToNotificationStorageChannel]].&lt;br /&gt;
&lt;br /&gt;
This is exposed by sdknso under &amp;lt;code&amp;gt;nn::notification::&amp;lt;/code&amp;gt;. The storage is read into the specified output buffer, where the size is &amp;lt;code&amp;gt;size = storage_size &amp;gt; buf_size ? buf_size : storage_size&amp;lt;/code&amp;gt;. Reading is skipped if size is zero. Afterwards the used size is written to an output param.&lt;br /&gt;
&lt;br /&gt;
==== GetHealthWarningDisappearedSystemEvent ====&lt;br /&gt;
No input, returns an output Event with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
==== SetHdcpAuthenticationActivated ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== GetLaunchRequiredVersion ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]], an u64, returns an output [[#LaunchRequiredVersion]].&lt;br /&gt;
&lt;br /&gt;
sdknso passes hard-coded value 0 for the u64.&lt;br /&gt;
&lt;br /&gt;
==== UpgradeLaunchRequiredVersion ====&lt;br /&gt;
Takes an input [[#LaunchRequiredVersion]], an [[NCM_services#ApplicationId|ApplicationId]], an u64, no output.&lt;br /&gt;
&lt;br /&gt;
sdknso passes hard-coded value 0 for the u64.&lt;br /&gt;
&lt;br /&gt;
==== SendServerMaintenanceOverlayNotification ====&lt;br /&gt;
Takes two input [[PCV_services#PosixTime|PosixTime]], no output.&lt;br /&gt;
&lt;br /&gt;
The second input value can optionally be 0.&lt;br /&gt;
&lt;br /&gt;
==== GetLastApplicationExitReason ====&lt;br /&gt;
No input, returns an output s32.&lt;br /&gt;
&lt;br /&gt;
==== StartContinuousRecordingFlushForDebug ====&lt;br /&gt;
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; must be set to 0x1 with size 0x1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
==== CreateMovieMaker ====&lt;br /&gt;
Takes an input u64 size and a TransferMemory handle, returns an [[#IMovieMaker]].&lt;br /&gt;
&lt;br /&gt;
Official sw retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first.&lt;br /&gt;
&lt;br /&gt;
Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.&lt;br /&gt;
&lt;br /&gt;
==== PrepareForJit ====&lt;br /&gt;
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&amp;lt;&amp;gt; for jit-sysmodule process tracking object as an IApplicationFunctions member.&lt;br /&gt;
&lt;br /&gt;
~IApplicationFunctions() includes:&lt;br /&gt;
&lt;br /&gt;
    if (this-&amp;gt;jit_process) {&lt;br /&gt;
        Terminate(this-&amp;gt;jit_process);&lt;br /&gt;
        this-&amp;gt;jit_process = nullptr;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
AM can also optionally launch jit-sysmodule automatically if the [[NACP]] enables it.&lt;br /&gt;
&lt;br /&gt;
=== IMovieMaker ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IMovieMaker&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetGrcMovieMaker]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetLayerHandle]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GetGrcMovieMaker ====&lt;br /&gt;
No input, returns a GRC [[GRC_services|IMovieMaker]].&lt;br /&gt;
&lt;br /&gt;
==== GetLayerHandle ====&lt;br /&gt;
No input, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
== ILibraryAppletCreator ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ILibraryAppletCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateLibraryApplet]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#TerminateAllLibraryApplets]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#AreAnyLibraryAppletsLeft]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#CreateStorage]] || &lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#CreateTransferMemoryStorage]] || &lt;br /&gt;
|-&lt;br /&gt;
| 12 || [2.0.0+] [[#CreateHandleStorage]] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== CreateLibraryApplet ===&lt;br /&gt;
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].&lt;br /&gt;
&lt;br /&gt;
=== TerminateAllLibraryApplets ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.&lt;br /&gt;
&lt;br /&gt;
Terminates all LibraryApplets which were created by the current applet (or by the Application when used from the [[#IApplicationAccessor]] cmd).&lt;br /&gt;
&lt;br /&gt;
=== AreAnyLibraryAppletsLeft ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
=== CreateStorage ===&lt;br /&gt;
Takes an input s64 for the storage size, returns an [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
This allocates a buffer with the specified size which can then be accessed via [[#IStorageAccessor]].&lt;br /&gt;
&lt;br /&gt;
=== CreateTransferMemoryStorage ===&lt;br /&gt;
Takes an input TransferMemory copy-handle, an input u8 bool, and an s64 size, returns an [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
The user-process creates the TransferMemory with permissions=0.&lt;br /&gt;
&lt;br /&gt;
The TransferMemory is mapped, which can then be accessed via [[#IStorageAccessor]]. The input bool controls whether writing to the storage is allowed: [[#Write]] will throw an error if this flag is not set.&lt;br /&gt;
&lt;br /&gt;
=== CreateHandleStorage ===&lt;br /&gt;
Takes an input copy-handle and an input s64, returns an [[#IStorage]]. In some cases the s64 must not have the negative bit set.&lt;br /&gt;
&lt;br /&gt;
The input can be arbitrary, however official sw is only (?) known to use this for TransferMemory (with s64=size).&lt;br /&gt;
&lt;br /&gt;
=== ILibraryAppletAccessor ===&lt;br /&gt;
This is &amp;quot;nn::am::service::ILibraryAppletAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetAppletStateChangedEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#IsCompleted]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#Start]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#RequestExit]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [[#Terminate]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#GetResult]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [10.0.0+] [[#PresetLibraryAppletGpuTimeSliceZero]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#PushInData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#PopOutData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#PushExtraStorage]] || &lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#PushInteractiveInData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 104 || [[#PopInteractiveOutData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 105 || [[#GetPopOutDataEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 106 || [[#GetPopInteractiveOutDataEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [[#NeedsToExitProcess]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [[#GetLibraryAppletInfo]] || &lt;br /&gt;
|-&lt;br /&gt;
| 150 || [[#RequestForAppletToGetForeground]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Commands &amp;lt;=30 are inherited from [[#IAppletAccessor]]. GetLibraryAppletInfo is identical to the [[#ILibraryAppletSelfAccessor]] cmd.&lt;br /&gt;
&lt;br /&gt;
==== SetOutOfFocusApplicationSuspendingEnabled ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Official sw will assert prior to using this if applet-service was not initialized as *Application.&lt;br /&gt;
&lt;br /&gt;
==== PresetLibraryAppletGpuTimeSliceZero ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
sdknso only uses with with [[Software_Keyboard|swkbd-inline]], immediately after creating the LibraryApplet.&lt;br /&gt;
&lt;br /&gt;
==== PushInData ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== PopOutData ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== PushExtraStorage ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== PushInteractiveInData ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== PopInteractiveOutData ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== GetPopOutDataEvent ====&lt;br /&gt;
No input, returns an output handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== GetPopInteractiveOutDataEvent ====&lt;br /&gt;
No input, returns an output event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== NeedsToExitProcess ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
==== RequestForAppletToGetForeground ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
==== GetIndirectLayerConsumerHandle ====&lt;br /&gt;
Takes an input PID and an input u64 AppletResourceUserId, returns an output u64 IndirectLayerConsumerHandle.&lt;br /&gt;
&lt;br /&gt;
Official sw uses this during LibraryApplet creation when [[#LibraryAppletMode]] is 0x3.&lt;br /&gt;
&lt;br /&gt;
== ICommonStateGetter ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ICommonStateGetter&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetEventHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#ReceiveMessage]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetThisAppletKind]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#AllowToEnterSleep]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#DisallowToEnterSleep]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetOperationMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#GetPerformanceMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#GetCradleStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#GetBootMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#GetCurrentFocusState]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#RequestToAcquireSleepLock]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#ReleaseSleepLock]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#ReleaseSleepLockTransiently]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#GetAcquiredSleepLockEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [11.0.0+] [[#GetWakeupCount]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#PushToGeneralChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#GetHomeButtonReaderLockAccessor]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [2.0.0+] [[#GetCradleFwVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [3.0.0+] [[#IsVrModeEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [3.0.0+] [[#SetVrModeEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 53 || [7.0.0+] [[#BeginVrModeEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 54 || [7.0.0+] [[#EndVrModeEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]]&lt;br /&gt;
|-&lt;br /&gt;
| 59 || [11.0.0+] [[#SetVrPositionForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]]&lt;br /&gt;
|-&lt;br /&gt;
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]]&lt;br /&gt;
|-&lt;br /&gt;
| 66 || [6.0.0+] [[#SetCpuBoostMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 67 || [10.0.0+] [[#CancelCpuBoostMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 68 || [11.0.0+] [[#GetBuiltInDisplayType]]&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]]&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]]&lt;br /&gt;
|-&lt;br /&gt;
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [9.1.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [11.0.0+] [[#OpenMyGpuErrorHandler]]&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [13.0.0+] GetAppletLaunchedHistory&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [9.0.0+] [[#GetSettingsPlatformRegion]]&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [10.0.0+] [[#ActivateMigrationService]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [10.0.0+] [[#DeactivateMigrationService]]&lt;br /&gt;
|-&lt;br /&gt;
| 500 || [11.0.0+] [[#DisableSleepTillShutdown]]&lt;br /&gt;
|-&lt;br /&gt;
| 501 || [11.0.0+] [[#SuppressDisablingSleepTemporarily]]&lt;br /&gt;
|-&lt;br /&gt;
| 502 || [12.0.0+] IsSleepEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 503 || [12.0.0+] IsDisablingSleepSuppressed&lt;br /&gt;
|-&lt;br /&gt;
| 600 || [17.0.0+] OpenNamedChannelAsChild&lt;br /&gt;
|-&lt;br /&gt;
| 900 || [11.0.0+] [[#SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 910 || [17.0.0+] GetLaunchRequiredTick&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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]]).&lt;br /&gt;
&lt;br /&gt;
[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.&lt;br /&gt;
&lt;br /&gt;
=== GetEventHandle ===&lt;br /&gt;
No input. Returns an output event handle. This is signalled when a message is available with [[#ReceiveMessage]].&lt;br /&gt;
&lt;br /&gt;
=== ReceiveMessage ===&lt;br /&gt;
No input. Returns an output [[#AppletMessage]]. Error 0x680 indicates no message is available.&lt;br /&gt;
&lt;br /&gt;
=== GetThisAppletKind ===&lt;br /&gt;
No input, returns an output [[#AppletKind]].&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== AllowToEnterSleep ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== DisallowToEnterSleep ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== GetOperationMode ===&lt;br /&gt;
No input. Returns an output u8 for the current [[#OperationMode]].&lt;br /&gt;
&lt;br /&gt;
=== GetPerformanceMode ===&lt;br /&gt;
No input. Returns an output u32 for the current [[#PerformanceMode]].&lt;br /&gt;
&lt;br /&gt;
=== GetCradleStatus ===&lt;br /&gt;
No input, returns an output u8.&lt;br /&gt;
&lt;br /&gt;
This uses [[#omm]] GetCradleStatus.&lt;br /&gt;
&lt;br /&gt;
=== GetBootMode ===&lt;br /&gt;
No input, returns an output u8.&lt;br /&gt;
&lt;br /&gt;
Returns the value from [[Process_Manager_services|pm:bm]] GetBootMode.&lt;br /&gt;
&lt;br /&gt;
=== GetCurrentFocusState ===&lt;br /&gt;
No input. Returns an output u8 [[#FocusState]].&lt;br /&gt;
&lt;br /&gt;
=== RequestToAcquireSleepLock ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseSleepLock ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseSleepLockTransiently ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== GetAcquiredSleepLockEvent ===&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
=== GetWakeupCount ===&lt;br /&gt;
No input, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
=== PushToGeneralChannel ===&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
This is not usable under an Application, however it is usable under a LibraryApplet.&lt;br /&gt;
&lt;br /&gt;
Used for sending requests to [[qlaunch]]. sdk-nso creates a 0x10-byte storage which is sent to this. The following are the functions which use this, with the data written to the storage:&lt;br /&gt;
* &amp;lt;code&amp;gt;RequestHomeMenu&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;5341 4d53 0100 0000 0200 0000 0100 0000&amp;lt;/code&amp;gt; Returns to the main Home Menu, equivalent to pressing the HOME button.&lt;br /&gt;
* &amp;lt;code&amp;gt;RequestJumpToSystemUpdate&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;5341 4d53 0100 0000 0b00 0000 0100 0000&amp;lt;/code&amp;gt; Equivalent to entering &amp;quot;System Update&amp;quot; under System Settings. When leaving this, it returns to the main Home Menu.&lt;br /&gt;
&lt;br /&gt;
=== GetHomeButtonReaderLockAccessor ===&lt;br /&gt;
No input, returns an output [[#ILockAccessor]].&lt;br /&gt;
&lt;br /&gt;
Similar to using [[#GetReaderLockAccessorEx]] with inval=0.&lt;br /&gt;
&lt;br /&gt;
=== GetReaderLockAccessorEx ===&lt;br /&gt;
Takes an input u32, returns an output [[#ILockAccessor]].&lt;br /&gt;
&lt;br /&gt;
The input value must be 0-3. 0 = HomeButton.&lt;br /&gt;
&lt;br /&gt;
=== GetWriterLockAccessorEx ===&lt;br /&gt;
Takes an input u32, returns an output [[#ILockAccessor]].&lt;br /&gt;
&lt;br /&gt;
The input value must be 0-3. 0 = HomeButton.&lt;br /&gt;
&lt;br /&gt;
=== GetCradleFwVersion ===&lt;br /&gt;
No input, returns 4 output u32s.&lt;br /&gt;
&lt;br /&gt;
This uses [[#omm]] GetCradleFwVersion.&lt;br /&gt;
&lt;br /&gt;
=== IsVrModeEnabled ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== SetVrModeEnabled ===&lt;br /&gt;
Takes an input u8 bool flag. No output.&lt;br /&gt;
&lt;br /&gt;
Updates internal AM state fields. If the new state doesn&#039;t match the previous state, this uses the [[Backlight_services]] {Disable/Enable}VrMode command depending on whether flag={disable/enable}.&lt;br /&gt;
&lt;br /&gt;
When the VrMode is set to true, the console shows a screen rendered like vr asking the user to move his face away and hit the &#039;close&#039; button. When this button is pressed, the console resets the vrMode to false.&lt;br /&gt;
&lt;br /&gt;
=== SetLcdBacklighOffEnabled ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Sets whether the LCD screen blacklight is turned off.&lt;br /&gt;
&lt;br /&gt;
=== BeginVrModeEx ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=1.&lt;br /&gt;
&lt;br /&gt;
=== EndVrModeEx ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=0.&lt;br /&gt;
&lt;br /&gt;
=== IsInControllerFirmwareUpdateSection ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== SetVrPositionForDebug ===&lt;br /&gt;
Takes 4 input s32s, no output.&lt;br /&gt;
&lt;br /&gt;
The s32s are: x, y, width, height.&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
width must be 1-1280, height must be 1-720.&lt;br /&gt;
&lt;br /&gt;
x and y must not be negative. x+width must be &amp;lt;=1280. y+height must be &amp;lt;=720.&lt;br /&gt;
&lt;br /&gt;
=== GetDefaultDisplayResolution ===&lt;br /&gt;
No input, returns two output s32s &#039;&#039;&#039;width&#039;&#039;&#039; and &#039;&#039;&#039;height&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== GetDefaultDisplayResolutionChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle with autoclear=true.&lt;br /&gt;
&lt;br /&gt;
=== GetHdcpAuthenticationState ===&lt;br /&gt;
No input, returns an output s32.&lt;br /&gt;
&lt;br /&gt;
=== GetHdcpAuthenticationStateChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle with autoclear=true.&lt;br /&gt;
&lt;br /&gt;
=== SetTvPowerStateMatchingMode ===&lt;br /&gt;
Takes an input s32 [[#TvPowerStateMatchingMode]], no output.&lt;br /&gt;
&lt;br /&gt;
=== GetApplicationIdByContentActionName ===&lt;br /&gt;
Takes a type-0x5 input buffer containing a string, returns an output [[NCM_services#ApplicationId|ApplicationId]].&lt;br /&gt;
&lt;br /&gt;
Gets the ApplicationId for the specified ContentActionName string. Returns an error when the current [[#AppletId]] isn&#039;t 0x04 (when the current applet isn&#039;t a SystemApplication).&lt;br /&gt;
&lt;br /&gt;
=== SetCpuBoostMode ===&lt;br /&gt;
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].&lt;br /&gt;
&lt;br /&gt;
=== CancelCpuBoostMode ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== GetBuiltInDisplayType ===&lt;br /&gt;
No input, returns an output s32.&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
This loads a s32 index from global state (originates from [[SPL_services#GetConfig|GetConfig]] [[SMC#HardwareType|HardwareType]]), Aborts if it&#039;s out-of-bounds, then the following is returned for the output s32: global_array[loaded_index].&lt;br /&gt;
&lt;br /&gt;
=== PerformSystemButtonPressingIfInFocus ===&lt;br /&gt;
Takes an input [[#SystemButtonType]], no output.&lt;br /&gt;
&lt;br /&gt;
Just returns 0 when a state field is not value 1. Verifies that the input button is allowed, then calls the same func as [[#PerformSystemButtonPressing]] internally.&lt;br /&gt;
&lt;br /&gt;
=== SetPerformanceConfigurationChangedNotification ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== GetCurrentPerformanceConfiguration ===&lt;br /&gt;
No input, returns the result of calling [[PPC_services#apm:sys|GetCurrentPerformanceConfiguration]].&lt;br /&gt;
&lt;br /&gt;
=== OpenMyGpuErrorHandler ===&lt;br /&gt;
No input, returns an [[#IGpuErrorHandler]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
=== GetOperationModeSystemInfo ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
This returns the output from [[#GetOperationModeSystemInfo_2|omm GetOperationModeSystemInfo]].&lt;br /&gt;
&lt;br /&gt;
=== GetSettingsPlatformRegion ===&lt;br /&gt;
No input, returns an output u8.&lt;br /&gt;
&lt;br /&gt;
This just returns the output from [[Settings_services#GetPlatformRegion|setsys GetPlatformRegion]].&lt;br /&gt;
&lt;br /&gt;
=== ActivateMigrationService ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Besides various other functionality, if required this eventually uses [[NS_Services|ns]] LaunchLibraryApplet to launch [[Migration_services|migration]].&lt;br /&gt;
&lt;br /&gt;
=== DeactivateMigrationService ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== DisableSleepTillShutdown ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== SuppressDisablingSleepTemporarily ===&lt;br /&gt;
Takes an input u64 &amp;quot;nn::TimeSpanType&amp;quot;, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== IGpuErrorHandler ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IGpuErrorHandler&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [11.0.0+].&lt;br /&gt;
&lt;br /&gt;
This uses various [[NV_services#nvgem:cd|nvgem:cd]] commands.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#GetManualGpuErrorInfoSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#GetManualGpuErrorInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#GetManualGpuErrorDetectionSystemEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#FinishManualGpuErrorHandling]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GetManualGpuErrorInfoSize ====&lt;br /&gt;
No input, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
==== GetManualGpuErrorInfo ====&lt;br /&gt;
Takes a type-0x6 output buffer, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
The OutBuffer_size must be &amp;gt;= the output size from [[#GetManualGpuErrorInfoSize]].&lt;br /&gt;
&lt;br /&gt;
sdknso exposes the buffer as &amp;lt;code&amp;gt;void*&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== GetManualGpuErrorDetectionSystemEvent ====&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
==== FinishManualGpuErrorHandling ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
== ISelfController ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ISelfController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Exit]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#LockExit]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#UnlockExit]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] [[#EnterFatalSection]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [2.0.0+] [[#LeaveFatalSection]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#GetLibraryAppletLaunchableEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#SetScreenShotPermission]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#SetOperationModeChangedNotification]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#SetPerformanceModeChangedNotification]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#SetFocusHandlingMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#SetRestartMessageEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [2.0.0+] [[#SetScreenShotAppletIdentityInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [2.0.0+] [[#SetOutOfFocusSuspendingEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [3.0.0+] [[#SetControllerFirmwareUpdateSection]]&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [3.0.0+] [[#SetRequiresCaptureButtonShortPressedMessage]]&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [3.0.0+] [[#SetAlbumImageOrientation]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [13.0.0+] GetScreenShotProgramId&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [[#CreateManagedDisplayLayer]]&lt;br /&gt;
|-&lt;br /&gt;
| 41 || [4.0.0+] [[#IsSystemBufferSharingEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 42 || [4.0.0+] [[#GetSystemSharedLayerHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 44 || [10.0.0+] [[#CreateManagedDisplaySeparableLayer]]&lt;br /&gt;
|-&lt;br /&gt;
| 45 || [10.0.0+] [[#SetManagedDisplayLayerSeparationMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 46 || [13.0.0+] [[#SetRecordingLayerCompositionEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [[#SetHandlesRequestToDisplay]]&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [[#ApproveToDisplay]]&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#OverrideAutoSleepTimeAndDimmingTime]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || [[#SetMediaPlaybackState]]&lt;br /&gt;
|-&lt;br /&gt;
| 62 || [[#SetIdleTimeDetectionExtension]]&lt;br /&gt;
|-&lt;br /&gt;
| 63 || [[#GetIdleTimeDetectionExtension]]&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [[#SetInputDetectionSourceSet]]&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [2.0.0+] [[#ReportUserIsActive]]&lt;br /&gt;
|-&lt;br /&gt;
| 66 || [3.0.0+] [[#GetCurrentIlluminance]]&lt;br /&gt;
|-&lt;br /&gt;
| 67 || [3.0.0+] [[#IsIlluminanceAvailable]]&lt;br /&gt;
|-&lt;br /&gt;
| 68 || [5.0.0+] [[#SetAutoSleepDisabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 69 || [5.0.0+] [[#IsAutoSleepDisabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 70 || [4.0.0+] [[#ReportMultimediaError]]&lt;br /&gt;
|-&lt;br /&gt;
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 72 || [9.0.0+] [[#SetInputDetectionPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [6.0.0+] [[#GetAccumulatedSuspendedTickValue]]&lt;br /&gt;
|-&lt;br /&gt;
| 91 || [6.0.0+] [[#GetAccumulatedSuspendedTickChangedEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [7.0.0+] [[#SetAlbumImageTakenNotificationEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [11.0.0+] [[#SaveCurrentScreenshot]]&lt;br /&gt;
|-&lt;br /&gt;
| 130 || [13.0.0+] [[#SetRecordVolumeMuted]]&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Exit ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Exits the current applet. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
=== LockExit ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Locks exit process of pressing X to close in HOME Menu for an application or HOME button for an applet. When locked, it will show the &amp;quot;waiting for software to be closed dialog&amp;quot; until UnlockExit is called or a 15 seconds timeout (when the latter occurs, the process is force-terminated).&lt;br /&gt;
&lt;br /&gt;
=== UnlockExit ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Unlocks exit process, if LockExit was previously used.&lt;br /&gt;
&lt;br /&gt;
=== EnterFatalSection ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== LeaveFatalSection ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#EnterFatalSection]] must be executed at least once before executing this command, otherwise error code 0x40080 will be returned. EnterFatalSection and LeaveFatalSection work in pairs, that is, N calls to EnterFatalSection must be performed first in order to perform N executions of LeaveFatalSection. Essentially, these two functions operate like how one would lock and unlock a recursive mutex.&lt;br /&gt;
&lt;br /&gt;
=== GetLibraryAppletLaunchableEvent ===&lt;br /&gt;
No input, returns an output event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
=== SetScreenShotPermission ===&lt;br /&gt;
Takes an input s32. No output.&lt;br /&gt;
&lt;br /&gt;
Controls whether screenshot-capture is allowed.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Inherit from parent applet&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Enable&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Disable&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SetOperationModeChangedNotification ===&lt;br /&gt;
Takes an input u8 bool flag. No output.&lt;br /&gt;
&lt;br /&gt;
=== SetPerformanceModeChangedNotification ===&lt;br /&gt;
Takes an input u8 bool flag. No output.&lt;br /&gt;
&lt;br /&gt;
=== SetFocusHandlingMode ===&lt;br /&gt;
Takes 3 input u8s with each field located immediately after the previous u8, these are bool flags. No output.&lt;br /&gt;
&lt;br /&gt;
=== SetRestartMessageEnabled ===&lt;br /&gt;
Takes an input u8 bool flag, no output.&lt;br /&gt;
&lt;br /&gt;
See [[#AppletMessage]].&lt;br /&gt;
&lt;br /&gt;
=== SetScreenShotAppletIdentityInfo ===&lt;br /&gt;
Takes an input [[#AppletIdentityInfo]], no output.&lt;br /&gt;
&lt;br /&gt;
=== SetOutOfFocusSuspendingEnabled ===&lt;br /&gt;
Takes an input u8 bool flag. No output.&lt;br /&gt;
&lt;br /&gt;
=== SetControllerFirmwareUpdateSection ===&lt;br /&gt;
Takes an input u8 bool flag, no output.&lt;br /&gt;
&lt;br /&gt;
This throws error 0x40280 when the internal state flag already matches the input value.&lt;br /&gt;
&lt;br /&gt;
=== SetRequiresCaptureButtonShortPressedMessage ===&lt;br /&gt;
Takes an input u8 bool flag, no output.&lt;br /&gt;
&lt;br /&gt;
See [[#AppletMessage]].&lt;br /&gt;
&lt;br /&gt;
When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.&lt;br /&gt;
&lt;br /&gt;
=== SetAlbumImageOrientation ===&lt;br /&gt;
Takes an input u32 &amp;quot;nn::album::ImageOrientation&amp;quot;. No output.&lt;br /&gt;
&lt;br /&gt;
The input value must not be &amp;gt;3.&lt;br /&gt;
&lt;br /&gt;
=== SetDesirableKeyboardLayout ===&lt;br /&gt;
Takes an input u32, no output.&lt;br /&gt;
&lt;br /&gt;
The input u32 is &amp;quot;nn::settings::KeyboardLayout&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== CreateManagedDisplayLayer ===&lt;br /&gt;
Returns an output u64 LayerId which is then used by the user-process with [[Display_services#OpenLayer]].&lt;br /&gt;
&lt;br /&gt;
=== IsSystemBufferSharingEnabled ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Not available when the current applet is an Application ([[#AppletId]] == 0x01).&lt;br /&gt;
&lt;br /&gt;
Checks whether SystemBufferSharing is enabled, throwing an error otherwise.&lt;br /&gt;
&lt;br /&gt;
=== GetSystemSharedLayerHandle ===&lt;br /&gt;
No input, returns two output u64s &amp;quot;nn::vi::fbshare::SharedBufferHandle&amp;quot; and &amp;quot;nn::vi::fbshare::SharedLayerHandle&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.&lt;br /&gt;
&lt;br /&gt;
=== GetSystemSharedBufferHandle ===&lt;br /&gt;
No input, returns an output u64 &amp;quot;nn::vi::fbshare::SharedBufferHandle&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.&lt;br /&gt;
&lt;br /&gt;
Same as [[#GetSystemSharedLayerHandle]] except this just gets the SharedBufferHandle.&lt;br /&gt;
&lt;br /&gt;
=== CreateManagedDisplaySeparableLayer ===&lt;br /&gt;
No input, returns two output u64 LayerIds.&lt;br /&gt;
&lt;br /&gt;
sdknso now uses this instead of [[#CreateManagedDisplayLayer]]. sdknso caches the output from the cmd so that it&#039;s only used once. The first u64 is used the same as the original LayerId from [[#CreateManagedDisplayLayer]]. &amp;lt;code&amp;gt;nn::vi::CreateRecordingLayer&amp;lt;/code&amp;gt; uses the second LayerId, the layer creation is identical besides which LayerId is used.&lt;br /&gt;
&lt;br /&gt;
=== SetManagedDisplayLayerSeparationMode ===&lt;br /&gt;
Takes an input u32, no output.&lt;br /&gt;
&lt;br /&gt;
sdknso exposes this as &amp;lt;code&amp;gt;nn::vi::SetRecordingLayerEnabled(bool)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The input u32 must be 0-1.&lt;br /&gt;
&lt;br /&gt;
=== SetRecordingLayerCompositionEnabled ===&lt;br /&gt;
Takes an input bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetHandlesRequestToDisplay ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].&lt;br /&gt;
&lt;br /&gt;
See [[#AppletMessage]].&lt;br /&gt;
&lt;br /&gt;
=== ApproveToDisplay ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Used to handle the notification enabled by [[#SetHandlesRequestToDisplay]].&lt;br /&gt;
&lt;br /&gt;
=== OverrideAutoSleepTimeAndDimmingTime ===&lt;br /&gt;
Takes 4 input s32s, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetMediaPlaybackState ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetIdleTimeDetectionExtension ===&lt;br /&gt;
Takes an input u32, no output.&lt;br /&gt;
&lt;br /&gt;
The input value must be 0-2: 0 = disabled, 1 = Extended, and 2 = ExtendedUnsafe.&lt;br /&gt;
&lt;br /&gt;
=== GetIdleTimeDetectionExtension ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
Returns the value set by [[#SetIdleTimeDetectionExtension]].&lt;br /&gt;
&lt;br /&gt;
=== SetInputDetectionSourceSet ===&lt;br /&gt;
Takes an input u32, no output.&lt;br /&gt;
&lt;br /&gt;
=== ReportUserIsActive ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Uses idle:sys ReportUserIsActive.&lt;br /&gt;
&lt;br /&gt;
Reports that the user is active, for idle detection (screen dimming / auto-sleep). This is equivalent to when the user uses HID input.&lt;br /&gt;
&lt;br /&gt;
=== GetCurrentIlluminance ===&lt;br /&gt;
No input, returns an output float.&lt;br /&gt;
&lt;br /&gt;
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue, where only the output float is used.&lt;br /&gt;
&lt;br /&gt;
=== IsIlluminanceAvailable ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Uses [[Backlight_services|lbl]] command IsAmbientLightSensorAvailable.&lt;br /&gt;
&lt;br /&gt;
User-processes can use this to determine whether to continue with using GetCurrentIlluminance(Ex).&lt;br /&gt;
&lt;br /&gt;
=== SetAutoSleepDisabled ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== IsAutoSleepDisabled ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== ReportMultimediaError ===&lt;br /&gt;
Takes an input Result and a type-0x5 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer contains a 0x138-byte &amp;quot;movie::MultimediaTelemetryReport&amp;quot; struct.&lt;br /&gt;
&lt;br /&gt;
=== GetCurrentIlluminanceEx ===&lt;br /&gt;
No input, returns an output u8 bool and float.&lt;br /&gt;
&lt;br /&gt;
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.&lt;br /&gt;
&lt;br /&gt;
=== SetInputDetectionPolicy ===&lt;br /&gt;
Takes an input [[#InputDetectionPolicy]], no output.&lt;br /&gt;
&lt;br /&gt;
=== SetWirelessPriorityMode ===&lt;br /&gt;
Takes an input s32 [[#WirelessPriorityMode]], no output.&lt;br /&gt;
&lt;br /&gt;
=== GetAccumulatedSuspendedTickValue ===&lt;br /&gt;
No input, returns an output u64 tick value.&lt;br /&gt;
&lt;br /&gt;
Gets the total time in ticks that the process was suspended, relative to when the applet-service was last initialized.&lt;br /&gt;
&lt;br /&gt;
=== GetAccumulatedSuspendedTickChangedEvent ===&lt;br /&gt;
No input, returns an output Event handle with autoclear=true.&lt;br /&gt;
&lt;br /&gt;
This is signaled when the output from [[#GetAccumulatedSuspendedTickValue]] is updated.&lt;br /&gt;
&lt;br /&gt;
=== SetAlbumImageTakenNotificationEnabled ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
See [[#AppletMessage]].&lt;br /&gt;
&lt;br /&gt;
=== SetApplicationAlbumUserData ===&lt;br /&gt;
Takes a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer contains arbitrary UserData.&lt;br /&gt;
&lt;br /&gt;
The size must be &amp;lt;=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.&lt;br /&gt;
&lt;br /&gt;
=== SaveCurrentScreenshot ===&lt;br /&gt;
Takes an input s32 [[Capture_services#AlbumReportOption|AlbumReportOption]], no output.&lt;br /&gt;
&lt;br /&gt;
sdknso exposes this under &amp;quot;nn::album::&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== SetRecordVolumeMuted ===&lt;br /&gt;
Takes an input bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== GetDebugStorageChannel ===&lt;br /&gt;
No input, returns an output [[#IStorageChannel]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; must be set to 0x1 with size 0x1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
== IStorageChannel ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IStorageChannel&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [7.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Push || No input, returns an output [[#IStorage]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Unpop || No input, returns an output [[#IStorage]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Pop || No input, returns an output [[#IStorage]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetPopEventHandle || No input, returns an output handle.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Clear || No input/output.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== IWindowController ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IWindowController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateWindow]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetAppletResourceUserId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [6.0.0+] [[#GetAppletResourceUserIdOfCallerApplet]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#AcquireForegroundRights]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#ReleaseForegroundRights]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#RejectToChangeIntoBackground]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [7.0.0+] [[#SetAppletWindowVisibility]] || &lt;br /&gt;
|-&lt;br /&gt;
| 21 || [7.0.0+] [[#SetAppletGpuTimeSlice]] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== CreateWindow ===&lt;br /&gt;
Takes an input u32, returns an output [[#IWindow]].&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== GetAppletResourceUserId ===&lt;br /&gt;
No input, returns an output u64 [[#AppletResourceUserId]].&lt;br /&gt;
&lt;br /&gt;
=== GetAppletResourceUserIdOfCallerApplet ===&lt;br /&gt;
No input, returns an output u64 [[#AppletResourceUserId]].&lt;br /&gt;
&lt;br /&gt;
=== AcquireForegroundRights ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseForegroundRights ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== RejectToChangeIntoBackground ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== SetAppletWindowVisibility ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetAppletGpuTimeSlice ===&lt;br /&gt;
Takes an input s64, no output.&lt;br /&gt;
&lt;br /&gt;
The input s64 must not be negative.&lt;br /&gt;
&lt;br /&gt;
== IAudioController ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IAudioController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#SetExpectedMasterVolume]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetMainAppletExpectedMasterVolume]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetLibraryAppletExpectedMasterVolume]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#ChangeMainAppletMasterVolume]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#SetTransparentVolumeRate]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
GetMainAppletExpectedMasterVolume/SetExpectedMasterVolume are used for saving/restoring state for LibraryApplet launching, with SetExpectedMasterVolume being used with new state prior to launching a LibraryApplet. With official sw these applet funcs are used directly in the main-codebin.&lt;br /&gt;
&lt;br /&gt;
=== SetExpectedMasterVolume ===&lt;br /&gt;
Takes two input floats, no output.&lt;br /&gt;
&lt;br /&gt;
Writes the input floats to state: first one is used by [[#GetMainAppletExpectedMasterVolume]], second one is used by [[#GetLibraryAppletExpectedMasterVolume]].&lt;br /&gt;
&lt;br /&gt;
=== GetMainAppletExpectedMasterVolume ===&lt;br /&gt;
No input, returns an output float.&lt;br /&gt;
&lt;br /&gt;
=== GetLibraryAppletExpectedMasterVolume ===&lt;br /&gt;
No input, returns an output float.&lt;br /&gt;
&lt;br /&gt;
=== ChangeMainAppletMasterVolume ===&lt;br /&gt;
Takes an input float and an input u64, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetTransparentVolumeRate ===&lt;br /&gt;
Takes an input float, no output.&lt;br /&gt;
&lt;br /&gt;
== IDisplayController ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IDisplayController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetLastForegroundCaptureImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#UpdateLastForegroundCaptureImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetLastApplicationCaptureImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetCallerAppletCaptureImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#UpdateCallerAppletCaptureImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetLastForegroundCaptureImageEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#GetLastApplicationCaptureImageEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#GetCallerAppletCaptureImageEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [2.0.0+] [[#TakeScreenShotOfOwnLayer]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [5.0.0+] [[#CopyBetweenCaptureBuffers]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#AcquireLastApplicationCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#ReleaseLastApplicationCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#AcquireLastForegroundCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#ReleaseLastForegroundCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#AcquireCallerAppletCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [[#ReleaseCallerAppletCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#AcquireLastApplicationCaptureBufferEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [[#AcquireLastForegroundCaptureBufferEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [[#AcquireCallerAppletCaptureBufferEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [3.0.0+] [[#ClearCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [3.0.0+] [[#ClearAppletTransitionBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [4.0.0+] [[#AcquireLastApplicationCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [4.0.0+] [[#ReleaseLastApplicationCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [4.0.0+] [[#AcquireLastForegroundCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] [[#ReleaseLastForegroundCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 26 || [4.0.0+] [[#AcquireCallerAppletCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 27 || [4.0.0+] [[#ReleaseCallerAppletCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 28 || [6.0.0+] [[#TakeScreenShotOfOwnLayerEx]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetLastForegroundCaptureImage ===&lt;br /&gt;
Takes a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== UpdateLastForegroundCaptureImage ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== GetLastApplicationCaptureImage ===&lt;br /&gt;
Takes a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== GetCallerAppletCaptureImage ===&lt;br /&gt;
Takes a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== UpdateCallerAppletCaptureImage ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#UpdateLastForegroundCaptureImage]], except this passes param value 2 instead of 1.&lt;br /&gt;
&lt;br /&gt;
=== GetLastForegroundCaptureImageEx ===&lt;br /&gt;
Takes a type-0x6 output buffer, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
The buffer size must match 0x384000.&lt;br /&gt;
&lt;br /&gt;
=== GetLastApplicationCaptureImageEx ===&lt;br /&gt;
Takes a type-0x6 output buffer, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
The buffer size must match 0x384000.&lt;br /&gt;
&lt;br /&gt;
Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 0 instead of 1.&lt;br /&gt;
&lt;br /&gt;
=== GetCallerAppletCaptureImageEx ===&lt;br /&gt;
Takes a type-0x6 output buffer, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
The buffer size must match 0x384000.&lt;br /&gt;
&lt;br /&gt;
Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 2 instead of 1.&lt;br /&gt;
&lt;br /&gt;
=== TakeScreenShotOfOwnLayer ===&lt;br /&gt;
Takes an input u8 bool and a s32, no output.&lt;br /&gt;
&lt;br /&gt;
=== CopyBetweenCaptureBuffers ===&lt;br /&gt;
Takes two input s32s, no output.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastApplicationCaptureBuffer ===&lt;br /&gt;
No input, returns an output handle.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseLastApplicationCaptureBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Clears a state field if it&#039;s not already 0, returning an error otherwise. On newer sysvers: then a func is called which just returns 0, then this cmd returns 0.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastForegroundCaptureBuffer ===&lt;br /&gt;
No input, returns an output handle.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseLastForegroundCaptureBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.&lt;br /&gt;
&lt;br /&gt;
=== AcquireCallerAppletCaptureBuffer ===&lt;br /&gt;
No input, returns an output handle.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseCallerAppletCaptureBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastApplicationCaptureBufferEx ===&lt;br /&gt;
No input, returns an output TransferMemory handle and an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
The state field used by [[#ReleaseLastApplicationCaptureBuffer]] must be 0. Calls a func which just returns an error (this is only the case on newer sysvers), hence this cmd will just return that error. If that func would have returned successfully, the state field would be set to 1 and the cmd would return 0.&lt;br /&gt;
&lt;br /&gt;
On old sysvers, the output TransferMemory is size 0x384000 with permissions=RW.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastForegroundCaptureBufferEx ===&lt;br /&gt;
No input, returns an output TransferMemory handle and an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseLastForegroundCaptureBuffer]] state field, and uses a different input param value for the called func.&lt;br /&gt;
&lt;br /&gt;
=== AcquireCallerAppletCaptureBufferEx ===&lt;br /&gt;
No input, returns an output TransferMemory handle and an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseCallerAppletCaptureBuffer]] state field, and uses a different input param value for the called func.&lt;br /&gt;
&lt;br /&gt;
=== ClearCaptureBuffer ===&lt;br /&gt;
Takes an input u8 bool, a s32 CaptureSharedBuffer, and an u32 color, returns no output.&lt;br /&gt;
&lt;br /&gt;
Clear the input CaptureSharedBuffer with the specified RGBA8 color.&lt;br /&gt;
&lt;br /&gt;
=== ClearAppletTransitionBuffer ===&lt;br /&gt;
Takes an input u32, no output.&lt;br /&gt;
&lt;br /&gt;
Clear the AppletTransitionBuffer with the specified RGBA8 color.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastApplicationCaptureSharedBuffer ===&lt;br /&gt;
No input, returns an output u8 bool and an s32.&lt;br /&gt;
&lt;br /&gt;
This loads data from state.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseLastApplicationCaptureSharedBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Depending on whether a state field is 0, this just returns an error or returns 0.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastForegroundCaptureSharedBuffer ===&lt;br /&gt;
No input, returns an output u8 bool and an s32.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseLastForegroundCaptureSharedBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.&lt;br /&gt;
&lt;br /&gt;
=== AcquireCallerAppletCaptureSharedBuffer ===&lt;br /&gt;
No input, returns an output u8 bool and an s32.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseCallerAppletCaptureSharedBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.&lt;br /&gt;
&lt;br /&gt;
=== TakeScreenShotOfOwnLayerEx ===&lt;br /&gt;
Takes two input u8 bools and a s32, no output.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#TakeScreenShotOfOwnLayer]], except the last bool param is the last cmd param bool instead of hard-coded 0. This flag indicates whether the screenshot should be taken Immediately.&lt;br /&gt;
&lt;br /&gt;
== ISystemAppletControllerForDebug ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ISystemAppletControllerForDebug&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RequestLaunchApplicationForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [7.0.0+] [[#GetDebugStorageChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [7.0.0+] [[#CreateStorageForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [12.0.0+] [[#CreateCradleFirmwareUpdaterForDebug]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetDebugStorageChannel ===&lt;br /&gt;
No input. Returns an output [[#IStorageChannel]].&lt;br /&gt;
&lt;br /&gt;
=== CreateStorageForDebug ===&lt;br /&gt;
Takes a total of 8-bytes of input. Returns an [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
=== CreateCradleFirmwareUpdaterForDebug ===&lt;br /&gt;
No input. Returns an [[#ICradleFirmwareUpdater]].&lt;br /&gt;
&lt;br /&gt;
== IProcessWindingController ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IProcessWindingController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetLaunchReason]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#OpenCallingLibraryApplet]] || &lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#PushContext]] || &lt;br /&gt;
|-&lt;br /&gt;
| 22 || [[#PopContext]] || &lt;br /&gt;
|-&lt;br /&gt;
| 23 || [[#CancelWindingReservation]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#WindAndDoReserved]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [[#ReserveToStartAndWaitAndUnwindThis]] || &lt;br /&gt;
|-&lt;br /&gt;
| 41 || [4.0.0+] [[#ReserveToStartAndWait]] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetLaunchReason ===&lt;br /&gt;
No input, returns an output [[#AppletProcessLaunchReason]].&lt;br /&gt;
&lt;br /&gt;
Used by LibraryApplets.&lt;br /&gt;
&lt;br /&gt;
=== OpenCallingLibraryApplet ===&lt;br /&gt;
No input, returns an output [[#ILibraryAppletAccessor]].&lt;br /&gt;
&lt;br /&gt;
The objptr from state is cleared during this, an error is thrown if it&#039;s already 0.&lt;br /&gt;
&lt;br /&gt;
=== PushContext ===&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
=== PopContext ===&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
=== CancelWindingReservation ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== WindAndDoReserved ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== ReserveToStartAndWaitAndUnwindThis ===&lt;br /&gt;
Takes an input [[#ILibraryAppletAccessor]], no output.&lt;br /&gt;
&lt;br /&gt;
=== ReserveToStartAndWait ===&lt;br /&gt;
Takes an input [[#ILibraryAppletAccessor]], no output.&lt;br /&gt;
&lt;br /&gt;
== IDebugFunctions ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IDebugFunctions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#NotifyMessageToHomeMenuForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [1.0.0-9.2.0] [[#OpenMainApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#PerformSystemButtonPressing]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#InvalidateTransitionLayer]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [12.0.0+] RequestLaunchApplicationByApplicationLaunchInfoForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [15.0.0+] AddSystemProgramIdAndAppletIdForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [16.0.0+] AddOperationConfirmedLibraryAppletIdForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 52 || [17.0.0+] GetProgramIdFromAppletIdForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [10.0.0+] [[#CancelCpuBoostModeForApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]]&lt;br /&gt;
|-&lt;br /&gt;
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]]&lt;br /&gt;
|-&lt;br /&gt;
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]]&lt;br /&gt;
|-&lt;br /&gt;
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 131 || [9.0.0+] [[#FriendInvitationClearApplicationParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 140 || [14.0.0+] RestrictPowerOperationForSecureLaunchModeForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [15.0.0+] CreateFloatingLibraryAppletAccepterForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [16.0.0+] TerminateAllRunningApplicationsForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 900 || [12.0.0+] GetGrcProcessLaunchedSystemEvent&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== NotifyMessageToHomeMenuForDebug ===&lt;br /&gt;
Takes an input [[#AppletMessage]], no output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== OpenMainApplication ===&lt;br /&gt;
No input, returns an output [[#IApplicationAccessor]].&lt;br /&gt;
&lt;br /&gt;
Should not be used when no Application is running (svcBreak).&lt;br /&gt;
&lt;br /&gt;
=== PerformSystemButtonPressing ===&lt;br /&gt;
Takes an input [[#SystemButtonType]], no output.&lt;br /&gt;
&lt;br /&gt;
=== InvalidateTransitionLayer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== RequestLaunchApplicationWithUserAndArgumentForDebug ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]]).&lt;br /&gt;
&lt;br /&gt;
=== GetAppletResourceUsageInfo ===&lt;br /&gt;
No input, returns an output [[#AppletResourceUsageInfo]].&lt;br /&gt;
&lt;br /&gt;
=== SetCpuBoostModeForApplet ===&lt;br /&gt;
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
=== CancelCpuBoostModeForApplet ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== PushToAppletBoundChannelForDebug ===&lt;br /&gt;
Takes an input [[#IStorage]] and a s32, no output.&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== TryPopFromAppletBoundChannelForDebug ===&lt;br /&gt;
Takes an input s32, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
The s32 must not be 0 and must match the value previously saved by [[#PushToAppletBoundChannelForDebug]], otherwise errors are returned. Then the output storage is popped from the StorageChannel.&lt;br /&gt;
&lt;br /&gt;
=== AlarmSettingNotificationEnableAppEventReserve ===&lt;br /&gt;
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.&lt;br /&gt;
&lt;br /&gt;
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.&lt;br /&gt;
&lt;br /&gt;
=== AlarmSettingNotificationDisableAppEventReserve ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Clears the StorageChannel/saved-ApplicationId used by [[#AlarmSettingNotificationEnableAppEventReserve]].&lt;br /&gt;
&lt;br /&gt;
=== AlarmSettingNotificationPushAppEventNotify ===&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#PushToNotificationStorageChannel]] except this uses the MainApplication.&lt;br /&gt;
&lt;br /&gt;
=== FriendInvitationSetApplicationParameter ===&lt;br /&gt;
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.&lt;br /&gt;
&lt;br /&gt;
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.&lt;br /&gt;
&lt;br /&gt;
=== FriendInvitationClearApplicationParameter ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Clears the StorageChannel/saved-ApplicationId used by [[#FriendInvitationSetApplicationParameter]].&lt;br /&gt;
&lt;br /&gt;
=== FriendInvitationPushApplicationParameter ===&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#PushToFriendInvitationStorageChannel]] except this uses the MainApplication.&lt;br /&gt;
&lt;br /&gt;
== IStorage ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IStorage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Open || No input. Returns an [[#IStorageAccessor]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [2.0.0+] OpenTransferStorage || No input. Returns an [[#ITransferStorageAccessor]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Open can only be used when the IStorage was created by [[#CreateStorage]] or [[#CreateTransferMemoryStorage]]. OpenTransferStorage can only be used when the IStorage was created by [[#CreateHandleStorage]].&lt;br /&gt;
&lt;br /&gt;
Only 1 *Accessor session can be open for each IStorage at a time.&lt;br /&gt;
&lt;br /&gt;
== IStorageAccessor ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IStorageAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetSize || No input. Returns an s64.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Read || Takes an input s64 and a type-0x22 output buffer.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ITransferStorageAccessor ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ITransferStorageAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetSize || No input. Returns an output s64.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetHandle || No input. Returns an output s64 and handle.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These commands return the data originally from [[#CreateHandleStorage]] input, both return the same s64.&lt;br /&gt;
&lt;br /&gt;
= appletOE =&lt;br /&gt;
This is &amp;quot;nn::am::service::IApplicationProxyService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#OpenApplicationProxy]] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is used by all regular-applications, including [[flog]] and &amp;quot;Retail Interactive Display Menu&amp;quot;. Only one session can be open for this service at a time.&lt;br /&gt;
&lt;br /&gt;
== OpenApplicationProxy ==&lt;br /&gt;
Returns an [[#IApplicationProxy]]. See [[#appletAE]].&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.&lt;br /&gt;
&lt;br /&gt;
= idle:sys =&lt;br /&gt;
This is &amp;quot;nn::idle::detail::IPolicyManagerSystem&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This was moved to [[OMM_services|omm]] with [14.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetAutoPowerDownEvent&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [7.0.0+] IsAutoPowerDownRequested ([1.0.0-3.0.2] )&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [1.0.0-3.0.2]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#SetHandlingContext]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || LoadAndApplySettings&lt;br /&gt;
|-&lt;br /&gt;
| 5 || ReportUserIsActive&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SetHandlingContext ==&lt;br /&gt;
[3.0.0+] Now takes an additional 0x10-bytes of input.&lt;br /&gt;
&lt;br /&gt;
[13.0.0+] Total input size is now 0x30 instead of 0x38.&lt;br /&gt;
&lt;br /&gt;
= omm =&lt;br /&gt;
This is &amp;quot;nn::omm::detail::IOperationModeManager&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Operation Mode Manager (OMM) is a service responsible for arbitrating the operation changes between docked and handheld modes.&lt;br /&gt;
Besides [[PTM_services|PTM]], this is the only service that interacts with the [[Dock]] through [[USB_services|usb:pd*]].&lt;br /&gt;
&lt;br /&gt;
This was moved to [[OMM_services|omm]] with [14.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetOperationMode&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetOperationModeChangeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 2 || EnableAudioVisual&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DisableAudioVisual&lt;br /&gt;
|-&lt;br /&gt;
| 4 || EnterSleepAndWait&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetCradleStatus&lt;br /&gt;
|-&lt;br /&gt;
| 6 || FadeInDisplay&lt;br /&gt;
|-&lt;br /&gt;
| 7 || FadeOutDisplay&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [2.0.0+] GetCradleFwVersion&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [2.0.0+] NotifyCecSettingsChanged&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [3.0.0+] SetOperationModePolicy&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [3.0.0+] GetDefaultDisplayResolution&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [3.0.0+] UpdateDefaultDisplayResolution&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [3.0.0+] ShouldSleepOnBoot&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [4.0.0+] NotifyHdcpApplicationExecutionStarted&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [4.0.0+] NotifyHdcpApplicationExecutionFinished&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [4.0.0+] NotifyHdcpApplicationDrawingStarted&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [4.0.0+] NotifyHdcpApplicationDrawingFinished&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [4.0.0+] GetHdcpAuthenticationFailedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [4.0.0+] GetHdcpAuthenticationFailedEmulationEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [4.0.0+] SetHdcpAuthenticationFailedEmulation&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [4.0.0+] GetHdcpStateChangeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [4.0.0+] GetHdcpState&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [5.0.0+] ShowCardUpdateProcessing&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [5.0.0+] SetApplicationCecSettingsAndNotifyChanged&lt;br /&gt;
|-&lt;br /&gt;
| 26 || [7.0.0+] [[#GetOperationModeSystemInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 27 || [9.0.0+] GetAppletFullAwakingSystemEvent&lt;br /&gt;
|-&lt;br /&gt;
| 28 || [12.0.0+] [[#CreateCradleFirmwareUpdater]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GetOperationModeSystemInfo ==&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
This is used by [[#GetOperationModeSystemInfo|ICommonStateGetter GetOperationModeSystemInfo]].&lt;br /&gt;
&lt;br /&gt;
== CreateCradleFirmwareUpdater ==&lt;br /&gt;
No input. Returns an [[#ICradleFirmwareUpdater]].&lt;br /&gt;
&lt;br /&gt;
== ICradleFirmwareUpdater ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ICradleFirmwareUpdater&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [12.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Start&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Finish&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetUpdateDeviceStatus&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetUpdateProgress&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetUpdateDeviceStatusChangeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetUpdateProgress2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= spsm =&lt;br /&gt;
This is &amp;quot;nn::spsm::detail::IPowerStateInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was moved to [[OMM_services|omm]] with [14.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetCurrentState&lt;br /&gt;
|-&lt;br /&gt;
| 1 || EnterSleep&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetLastWakeReason&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Shutdown&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetNotificationMessageEventHandle&lt;br /&gt;
|-&lt;br /&gt;
| 5 || ReceiveNotificationMessage&lt;br /&gt;
|-&lt;br /&gt;
| 6 || AnalyzeLogForLastSleepWakeSequence&lt;br /&gt;
|-&lt;br /&gt;
| 7 || ResetEventLog&lt;br /&gt;
|-&lt;br /&gt;
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence&lt;br /&gt;
|-&lt;br /&gt;
| 9 || ChangeHomeButtonLongPressingTime&lt;br /&gt;
|-&lt;br /&gt;
| 10 || PutErrorState&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [1.0.0-3.0.2] InvalidateCurrentHomeButtonPressing&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] Cmd11 now takes a total of 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
= tcap =&lt;br /&gt;
This is &amp;quot;nn::tcap::server::IManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was removed with [11.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetContinuousHighSkinTemperatureEvent&lt;br /&gt;
|-&lt;br /&gt;
| 1 || SetOperationMode&lt;br /&gt;
|-&lt;br /&gt;
| 2 || LoadAndApplySettings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= caps:su =&lt;br /&gt;
This is &amp;quot;nn::capsrv::sf::IScreenShotApplicationService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [6.0.0+].&lt;br /&gt;
&lt;br /&gt;
This can be used by applications to save screenshots.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 32 || [7.0.0+] SetShimLibraryVersion || Takes a total of 0x10-bytes of input and a PID, no output.&lt;br /&gt;
|-&lt;br /&gt;
| 201 || SaveScreenShot || &lt;br /&gt;
|-&lt;br /&gt;
| 203 || SaveScreenShotEx0 || &lt;br /&gt;
|-&lt;br /&gt;
| 205 || [8.0.0+] SaveScreenShotEx1 || &lt;br /&gt;
|-&lt;br /&gt;
| 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.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SetShimLibraryVersion&#039;&#039;&#039; is a wrapper for [[Capture_services|caps:c]] cmd33. Commands &#039;&#039;&#039;SaveScreenShot&#039;&#039;&#039;, &#039;&#039;&#039;SaveScreenShotEx0&#039;&#039;&#039;, &#039;&#039;&#039;SaveScreenShotEx1&#039;&#039;&#039; and &#039;&#039;&#039;SaveScreenShotEx2&#039;&#039;&#039; are wrappers for [[Display_services|caps:sc]] cmd210.&lt;br /&gt;
&lt;br /&gt;
== SaveScreenShot ==&lt;br /&gt;
Takes two input u32s, an u64 AppletResourceUserId, a PID, and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].&lt;br /&gt;
&lt;br /&gt;
Official user-processes doesn&#039;t use this, instead [[#SaveScreenShotEx0]] is used: ScreenShotAttributeEx0 is all-zero, except +4 is set to an input u32 and u32 +0xC = 0x1.&lt;br /&gt;
&lt;br /&gt;
This cmd internally uses an all-zero ScreenShotAttributeEx0, with u32 +0 = input u32 and u32 +0x8 = 0x3.&lt;br /&gt;
&lt;br /&gt;
== SaveScreenShotEx0 ==&lt;br /&gt;
Takes an input 0x40-byte struct &#039;&#039;&#039;ScreenShotAttributeEx0&#039;&#039;&#039;, an input u32, an input u64 AppletResourceUserId, a PID, and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].&lt;br /&gt;
&lt;br /&gt;
== SaveScreenShotEx1 ==&lt;br /&gt;
Takes an input 0x40-byte struct &#039;&#039;&#039;ScreenShotAttributeEx0&#039;&#039;&#039;, an input u32, an input u64 AppletResourceUserId, a PID, a type-0x15 input buffer containing an [[Capture_services|ApplicationData]], and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].&lt;br /&gt;
&lt;br /&gt;
== SaveScreenShotEx2 ==&lt;br /&gt;
Takes an input 0x40-byte struct &#039;&#039;&#039;ScreenShotAttributeEx0&#039;&#039;&#039;, 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]].&lt;br /&gt;
&lt;br /&gt;
= apm =&lt;br /&gt;
This is &amp;quot;nn::am::service::IApmManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [8.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#OpenSession]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetPerformanceMode&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [7.0.0+] [[#IsCpuOverclockEnabled]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== OpenSession ==&lt;br /&gt;
Returns an [[#ISession]].&lt;br /&gt;
&lt;br /&gt;
== IsCpuOverclockEnabled ==&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
== ISession ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IApmSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || SetPerformanceConfiguration&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetPerformanceConfiguration&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [8.0.0+] SetCpuOverclockEnabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Library Applets =&lt;br /&gt;
This section documents library applet launching.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Once the applet finishes running successfully, [[#ILibraryAppletAccessor]] PopOutData can be used to get the applet-specific [[#IStorage]] containing the applet output data.&lt;br /&gt;
&lt;br /&gt;
== CommonArguments ==&lt;br /&gt;
The first [[#CreateStorage|IStorage]] passed to applets should contain the common library applet arguments. This is populated by &amp;lt;code&amp;gt;nn::la::CommonArgumentsWriter&amp;lt;/code&amp;gt; and has the following format.&lt;br /&gt;
&lt;br /&gt;
This struct is 0x20-bytes.&lt;br /&gt;
&lt;br /&gt;
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&#039;s 8-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Typical Value || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 4 || 1 || Common Arguments version&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 4 || 0x20 || Common Arguments size&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 4 || || Library applet version (API version)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 4 || 0 || Theme color&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 1 || 0 || Play startup sound&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AppletId =&lt;br /&gt;
This is &amp;quot;nn::applet::AppletId&amp;quot;. See also [[:Category:Library Applets]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! ProgramId&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| &lt;br /&gt;
| Application (not valid for use with LibraryApplets)&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 010000000000100C&lt;br /&gt;
| OverlayApplet (overlayDisp)&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| 0100000000001000&lt;br /&gt;
| SystemAppletMenu (qlaunch)&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 0100000000001012&lt;br /&gt;
| SystemApplication (starter)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A&lt;br /&gt;
| 0100000000001001&lt;br /&gt;
| [[Auth_Applet|LibraryAppletAuth (auth)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0B&lt;br /&gt;
| 0100000000001002&lt;br /&gt;
| [[Cabinet_Applet|LibraryAppletCabinet (cabinet)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C&lt;br /&gt;
| 0100000000001003&lt;br /&gt;
| [[Controller_Applet|LibraryAppletController (controller)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0D&lt;br /&gt;
| 0100000000001004&lt;br /&gt;
| LibraryAppletDataErase (dataErase)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E&lt;br /&gt;
| 0100000000001005&lt;br /&gt;
| [[Error_Applet|LibraryAppletError (error)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0F&lt;br /&gt;
| 0100000000001006&lt;br /&gt;
| LibraryAppletNetConnect (netConnect)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0100000000001007&lt;br /&gt;
| [[Profile_Selector|LibraryAppletPlayerSelect (playerSelect)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| 0100000000001008&lt;br /&gt;
| [[Software_Keyboard|LibraryAppletSwkbd (swkbd)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0100000000001009&lt;br /&gt;
| [[MiiEdit_Applet|LibraryAppletMiiEdit (miiEdit)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x13&lt;br /&gt;
| 010000000000100A&lt;br /&gt;
| [[Internet_Browser#010000000000100A|LibraryAppletWeb (web)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 010000000000100B&lt;br /&gt;
| [[Internet_Browser#ShopN|LibraryAppletShop (shop)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x15&lt;br /&gt;
| 010000000000100D&lt;br /&gt;
| [[Album_Applet|LibraryAppletPhotoViewer (photoViewer)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x16&lt;br /&gt;
| 010000000000100E&lt;br /&gt;
| LibraryAppletSet (set)&lt;br /&gt;
|-&lt;br /&gt;
| 0x17&lt;br /&gt;
| 010000000000100F&lt;br /&gt;
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0100000000001010&lt;br /&gt;
| [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x19&lt;br /&gt;
| 0100000000001011&lt;br /&gt;
| [[Internet_Browser#WifiWebAuthApplet|LibraryAppletWifiWebAuth (wifiWebAuth)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A&lt;br /&gt;
| 0100000000001013&lt;br /&gt;
| [[MyPage_Applet|LibraryAppletMyPage (myPage)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B&lt;br /&gt;
| 010000000000101A&lt;br /&gt;
| LibraryAppletGift (gift)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 010000000000101C&lt;br /&gt;
| LibraryAppletUserMigration (userMigration)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D&lt;br /&gt;
| 010000000000101D&lt;br /&gt;
| [9.0.0+] LibraryAppletPreomiaSys (EncounterSys)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E&lt;br /&gt;
| 0100000000001020&lt;br /&gt;
| [9.0.0+] LibraryAppletStory (story)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F&lt;br /&gt;
| 010070000E3C0000&lt;br /&gt;
| [9.0.0+] LibraryAppletPreomiaUsr (EncounterUsr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 010086000E49C000&lt;br /&gt;
| [9.0.0+] LibraryAppletPreomiaUsrDummy (EncounterUsrDummy)&lt;br /&gt;
|-&lt;br /&gt;
| 0x21&lt;br /&gt;
| 0100000000001038&lt;br /&gt;
| [10.0.0+] LibraryAppletSample (sample)&lt;br /&gt;
|-&lt;br /&gt;
| 0x22&lt;br /&gt;
| 0100000000001007&lt;br /&gt;
| [13.0.0+] LibraryAppletPromoteQualification (playerSelect)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32&lt;br /&gt;
| 010000000000100F&lt;br /&gt;
| [17.0.0+] [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x33&lt;br /&gt;
| 010000000000100F&lt;br /&gt;
| [17.0.0+] [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x35&lt;br /&gt;
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)&lt;br /&gt;
| [17.0.0+] [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] ([16.0.0-16.1.0] )&lt;br /&gt;
|-&lt;br /&gt;
| 0x36&lt;br /&gt;
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)&lt;br /&gt;
| [17.0.0+] [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] ([16.0.0-16.1.0] )&lt;br /&gt;
|-&lt;br /&gt;
| 0x37&lt;br /&gt;
| [17.0.0+] 0100000000001010 ([16.0.0-16.1.0] 0100000000001042)&lt;br /&gt;
| [17.0.0+] [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]] ([16.0.0-16.1.0] )&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0100000000001043&lt;br /&gt;
| [16.0.0-16.1.0]&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E8&lt;br /&gt;
| &lt;br /&gt;
| [10.0.0-16.1.0] DevlopmentTool&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F1&lt;br /&gt;
| 010000000000D619&lt;br /&gt;
| [10.0.0-16.1.0] CombinationLA&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F2&lt;br /&gt;
| 010000000000D610&lt;br /&gt;
| [10.0.0-16.1.0] AeSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F3&lt;br /&gt;
| 010000000000D611&lt;br /&gt;
| [10.0.0-16.1.0] AeOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F4&lt;br /&gt;
| 010000000000D612&lt;br /&gt;
| [10.0.0-16.1.0] AeStarter&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F5&lt;br /&gt;
| 010000000000D613&lt;br /&gt;
| [10.0.0-16.1.0] AeLibraryAppletAlone&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F6&lt;br /&gt;
| 010000000000D614&lt;br /&gt;
| [10.0.0-16.1.0] AeLibraryApplet1&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F7&lt;br /&gt;
| 010000000000D615&lt;br /&gt;
| [10.0.0-16.1.0] AeLibraryApplet2&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F8&lt;br /&gt;
| 010000000000D616&lt;br /&gt;
| [10.0.0-16.1.0] AeLibraryApplet3&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F9&lt;br /&gt;
| 010000000000D617&lt;br /&gt;
| [10.0.0-16.1.0] AeLibraryApplet4&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FA&lt;br /&gt;
| 010000000000D60A&lt;br /&gt;
| [10.0.0-16.1.0] AppletISA&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FB&lt;br /&gt;
| 010000000000D60B&lt;br /&gt;
| [10.0.0-16.1.0] AppletIOA&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FC&lt;br /&gt;
| 010000000000D60C&lt;br /&gt;
| [10.0.0-16.1.0] AppletISTA&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FD&lt;br /&gt;
| 010000000000D60D&lt;br /&gt;
| [10.0.0-16.1.0] AppletILA1&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FE&lt;br /&gt;
| 010000000000D60E&lt;br /&gt;
| [10.0.0-16.1.0] AppletILA2&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000DC&lt;br /&gt;
| 010000000000D619&lt;br /&gt;
| [17.0.0+] CombinationLA&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000E6&lt;br /&gt;
| 010000000000D610&lt;br /&gt;
| [17.0.0+] AeSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000E7&lt;br /&gt;
| 010000000000D611&lt;br /&gt;
| [17.0.0+] AeOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000E8&lt;br /&gt;
| 010000000000D612&lt;br /&gt;
| [17.0.0+] AeStarter&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000E9&lt;br /&gt;
| 010000000000D613&lt;br /&gt;
| [17.0.0+] AeLibraryAppletAlone&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000EA&lt;br /&gt;
| 010000000000D614&lt;br /&gt;
| [17.0.0+] AeLibraryApplet1&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000EB&lt;br /&gt;
| 010000000000D615&lt;br /&gt;
| [17.0.0+] AeLibraryApplet2&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000EC&lt;br /&gt;
| 010000000000D616&lt;br /&gt;
| [17.0.0+] AeLibraryApplet3&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000ED&lt;br /&gt;
| 010000000000D617&lt;br /&gt;
| [17.0.0+] AeLibraryApplet4&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000F0&lt;br /&gt;
| 010000000000D60A&lt;br /&gt;
| [17.0.0+] AppletISA&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000F1&lt;br /&gt;
| 010000000000D60B&lt;br /&gt;
| [17.0.0+] AppletIOA&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000F2&lt;br /&gt;
| 010000000000D60C&lt;br /&gt;
| [17.0.0+] AppletISTA&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000F3&lt;br /&gt;
| 010000000000D60D&lt;br /&gt;
| [17.0.0+] AppletILA1&lt;br /&gt;
|-&lt;br /&gt;
| 0x700000F4&lt;br /&gt;
| 010000000000D60E&lt;br /&gt;
| [17.0.0+] AppletILA2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= LibraryAppletMode =&lt;br /&gt;
This is &amp;quot;nn::applet::LibraryAppletMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| AllForeground&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| PartialForeground&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| NoUi&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| PartialForegroundWithIndirectDisplay (see also [[#GetIndirectLayerConsumerHandle]], only used by swkbd [[Software_Keyboard|InlineKeyboard]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| AllForegroundInitiallyHidden (can be used by [7.0.0+] [[Internet_Browser|WebSession]])&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AppletMessage =&lt;br /&gt;
This is &amp;quot;nn::am::AppletMessage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ChangeIntoForeground&lt;br /&gt;
|-&lt;br /&gt;
| 2 || ChangeIntoBackground&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Exit&lt;br /&gt;
|-&lt;br /&gt;
| 6 || ApplicationExited&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [[#FocusState|FocusStateChanged]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#SetRestartMessageEnabled|Resume]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || DetectShortPressingHomeButton&lt;br /&gt;
|-&lt;br /&gt;
| 21 || DetectLongPressingHomeButton&lt;br /&gt;
|-&lt;br /&gt;
| 22 || DetectShortPressingPowerButton&lt;br /&gt;
|-&lt;br /&gt;
| 23 || DetectMiddlePressingPowerButton&lt;br /&gt;
|-&lt;br /&gt;
| 24 || DetectLongPressingPowerButton&lt;br /&gt;
|-&lt;br /&gt;
| 25 || RequestToPrepareSleep&lt;br /&gt;
|-&lt;br /&gt;
| 26 || FinishedSleepSequence&lt;br /&gt;
|-&lt;br /&gt;
| 27 || SleepRequiredByHighTemperature&lt;br /&gt;
|-&lt;br /&gt;
| 28 || SleepRequiredByLowBattery&lt;br /&gt;
|-&lt;br /&gt;
| 29 || AutoPowerDown&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#OperationMode|OperationModeChanged]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [[#PerformanceMode|PerformanceModeChanged]]&lt;br /&gt;
|-&lt;br /&gt;
| 32 || DetectReceivingCecSystemStandby&lt;br /&gt;
|-&lt;br /&gt;
| 33 || SdCardRemoved&lt;br /&gt;
|-&lt;br /&gt;
| 50 || LaunchApplicationRequested&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [[#SetHandlesRequestToDisplay|RequestToDisplay]]&lt;br /&gt;
|-&lt;br /&gt;
| 55 || ShowApplicationLogo&lt;br /&gt;
|-&lt;br /&gt;
| 56 || HideApplicationLogo&lt;br /&gt;
|-&lt;br /&gt;
| 57 || ForceHideApplicationLogo&lt;br /&gt;
|-&lt;br /&gt;
| 60 || FloatingApplicationDetected&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [[#SetRequiresCaptureButtonShortPressedMessage|DetectShortPressingCaptureButton]]&lt;br /&gt;
|-&lt;br /&gt;
| 92 || [[#SetAlbumImageTakenNotificationEnabled|AlbumScreenShotTaken]]&lt;br /&gt;
|-&lt;br /&gt;
| 93 || AlbumRecordingSaved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= OperationMode =&lt;br /&gt;
This is &amp;quot;nn::oe::OperationMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Handheld&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Console&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= PerformanceMode =&lt;br /&gt;
This is &amp;quot;nn::oe::PerformanceMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| -1 || Invalid&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Normal&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Boost&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= FocusState =&lt;br /&gt;
This is &amp;quot;nn::oe::FocusState&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 || InFocus&lt;br /&gt;
|-&lt;br /&gt;
| 2 || OutOfFocus&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Background&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= CpuBoostMode =&lt;br /&gt;
This is &amp;quot;nn::oe::CpuBoostMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Normal&lt;br /&gt;
|-&lt;br /&gt;
| 1 || FastLoad&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= WindowOriginMode =&lt;br /&gt;
This is &amp;quot;nn::oe::WindowOriginMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || LowerLeft&lt;br /&gt;
|-&lt;br /&gt;
| 1 || UpperLeft&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= WirelessPriorityMode =&lt;br /&gt;
This is &amp;quot;nn::oe::WirelessPriorityMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Default&lt;br /&gt;
|-&lt;br /&gt;
| 1 || OptimizedForWlan&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= TvPowerStateMatchingMode =&lt;br /&gt;
This is &amp;quot;nn::oe::TvPowerStateMatchingMode&amp;quot;. This is used with [[#SetTvPowerStateMatchingMode]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Unknown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= SystemButtonType =&lt;br /&gt;
This is &amp;quot;nn::am::service::SystemButtonType&amp;quot;. This is used with [[#PerformSystemButtonPressingIfInFocus]]/[[#PerformSystemButtonPressing]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 || PerformHomeButtonShortPressing&lt;br /&gt;
|-&lt;br /&gt;
| 2 || PerformHomeButtonLongPressing&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Short-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Long-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Shutdown the system. Only available with [[#PerformSystemButtonPressing]].&lt;br /&gt;
|-&lt;br /&gt;
| 6 || PerformCaptureButtonShortPressing&lt;br /&gt;
|-&lt;br /&gt;
| 7 || PerformCaptureButtonLongPressing&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= LaunchParameterKind =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 || UserChannel. Application-specific LaunchParameter.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || account PreselectedUser&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Unknown if used by anything?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= LibraryAppletExitReason =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Normal&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Canceled&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Abnormal&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Unexpected&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ProgramSpecifyKind =&lt;br /&gt;
This is &amp;quot;nn::am::service::ProgramSpecifyKind&amp;quot;. This controls the type of the u64 passed to [[#ExecuteProgram]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || u8 ProgramIndex. &amp;quot;ExecuteProgram&amp;quot;. [[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.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[NCM_services#ApplicationId|ApplicationId]]. &amp;quot;JumpToSubApplicationProgramForDevelopment&amp;quot;. Only available when [[Settings_services#GetDebugModeFlag|DebugMode]] is 1.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || u64 = value 0. &amp;quot;RestartProgram&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
ProgramIndex values where the title is not installed should not be used: [[qlaunch]] will display an error message and the current title will become &amp;quot;corrupted&amp;quot;, however Home Menu will have an option to repair it.&lt;br /&gt;
&lt;br /&gt;
= InputDetectionPolicy =&lt;br /&gt;
This is u32 enum &amp;quot;nn::applet::InputDetectionPolicy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Unknown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AppletResourceUserId =&lt;br /&gt;
This is &amp;quot;nn::applet::AppletResourceUserId&amp;quot;. Used by a number of non-AM services.&lt;br /&gt;
&lt;br /&gt;
= AppletAttribute =&lt;br /&gt;
This is &amp;quot;nn::am::AppletAttribute&amp;quot;. This struct is 0x80 bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Flag. When non-zero, two state fields are set to 1.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x7F || Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is used by [[#OpenLibraryAppletProxy]].&lt;br /&gt;
&lt;br /&gt;
= AppletProcessLaunchReason =&lt;br /&gt;
This is &amp;quot;nn::am::service::AppletProcessLaunchReason&amp;quot;. This struct is 0x4-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Flag. When non-zero, LibraryApplets then use [[#OpenCallingLibraryApplet]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x2 || Always 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || Always 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= LibraryAppletInfo =&lt;br /&gt;
This is &amp;quot;nn::am::service::LibraryAppletInfo&amp;quot;. This struct is 0x8-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#AppletId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || [[#LibraryAppletMode]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AppletKind =&lt;br /&gt;
This is &amp;quot;nn::am::service::AppletKind&amp;quot;. This is 8-bytes.&lt;br /&gt;
&lt;br /&gt;
= AppletIdentityInfo =&lt;br /&gt;
This struct is &amp;quot;nn::am::service::AppletIdentityInfo&amp;quot;. This struct is 0x10-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#AppletId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ApplicationAttributeForQuest =&lt;br /&gt;
This struct is &amp;quot;nn::applet::ApplicationAttributeForQuest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || See [[#ApplicationAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || See [[#ApplicationAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x4 || [7.0.0+] See [[#ApplicationAttribute]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
= ApplicationAttribute =&lt;br /&gt;
This struct is &amp;quot;nn::am::ApplicationAttribute&amp;quot;. This struct is 0x20-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x4 || float audio volume. Must be in the range of 0.0f-1.0f. The default is 1.0f.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x14 || Unused. Default is 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Internally AM only uses the first 0xC-bytes from ApplicationAttribute, regardless of the cmd.&lt;br /&gt;
&lt;br /&gt;
= ApplicationLaunchProperty =&lt;br /&gt;
This struct is 0x10-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x4 || Application title-version.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application base title.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application update title.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE || 0x1 || Unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF || 0x1 || Padding.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ApplicationLaunchRequestInfo =&lt;br /&gt;
This is &amp;quot;nn::applet::ApplicationLaunchRequestInfo&amp;quot;. This struct is 0x10-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8 || Unknown. The default is 0x0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AppletResourceUsageInfo =&lt;br /&gt;
This is &amp;quot;nn::am::service::AppletResourceUsageInfo&amp;quot;. This struct is 0x20-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || Unknown counter.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || Unknown counter.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x4 || Output from [[NS_Services|NS GetRightsEnvironmentCountForDebug]].&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x14 || Always zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ApplicationLicenseType =&lt;br /&gt;
This is &amp;quot;nn::oe::ApplicationLicenseType&amp;quot;. This is 1-byte.&lt;br /&gt;
&lt;br /&gt;
= LaunchRequiredVersion =&lt;br /&gt;
This is &amp;quot;nn::oe::LaunchRequiredVersion&amp;quot;. This is a 0x40-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
= ServerEnvironmentType =&lt;br /&gt;
This is &amp;quot;nn::oe::ServerEnvironmentType&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || dd&lt;br /&gt;
|-&lt;br /&gt;
| 1 || lp&lt;br /&gt;
|-&lt;br /&gt;
| 2 || sd&lt;br /&gt;
|-&lt;br /&gt;
| 3 || sp&lt;br /&gt;
|-&lt;br /&gt;
| 4 || dp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Liamwhite</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Applet_Manager_services&amp;diff=12474</id>
		<title>Applet Manager services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Applet_Manager_services&amp;diff=12474"/>
		<updated>2023-09-23T17:28:26Z</updated>

		<summary type="html">&lt;p&gt;Liamwhite: /* AppletAttribute */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;AM (Applet Manager) provides services for interacting with system applets while abstracting several aspects of power and operation management.&lt;br /&gt;
&lt;br /&gt;
Contains multiple raw images, with at least the following: &amp;quot;NN_OMM_CHARGING_BIN_{begin|end}&amp;quot;(charging icon), low-battery icon, and the Nintendo Switch logo displayed during system boot.&lt;br /&gt;
&lt;br /&gt;
= appletAE =&lt;br /&gt;
This is &amp;quot;nn::am::service::IAllSystemAppletProxiesService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 100 || OpenSystemAppletProxy || Returns an [[#ISystemAppletProxy]].&lt;br /&gt;
|-&lt;br /&gt;
| 200 || OpenLibraryAppletProxyOld ([1.0.0-2.3.0] OpenLibraryAppletProxy) || Returns an [[#ILibraryAppletProxy]].&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [3.0.0+] [[#OpenLibraryAppletProxy]] || Returns an [[#ILibraryAppletProxy]].&lt;br /&gt;
|-&lt;br /&gt;
| 300 || OpenOverlayAppletProxy || Returns an [[#IOverlayAppletProxy]].&lt;br /&gt;
|-&lt;br /&gt;
| 350 || OpenSystemApplicationProxy || Returns an [[#IApplicationProxy]].&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#CreateSelfLibraryAppletCreatorForDevelop]] || &lt;br /&gt;
|-&lt;br /&gt;
| 410 || [6.0.0+] [[#GetSystemAppletControllerForDebug]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [6.0.0+] [[#GetDebugFunctions]] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All of these Open*Proxy commands except [[#OpenLibraryAppletProxy]] take the same input as [[#OpenApplicationProxy]], with the same user-process retry-loop as [[#OpenApplicationProxy]]. These Open*Proxy commands (including appletOE) doesn&#039;t seem to usable from processes which aren&#039;t actual applets (such as sysmodules), at least for applet-types which aren&#039;t already in use.&lt;br /&gt;
&lt;br /&gt;
OpenLibraryAppletProxyOld eventually calls the same func as [[#OpenLibraryAppletProxy]], except that the [[#AppletAttribute]] is all-zero.&lt;br /&gt;
&lt;br /&gt;
This service is used by all system non-regular-applications.&lt;br /&gt;
&lt;br /&gt;
The 01000000000010XX system [[Title_list|titles]] use the following applet types(above Open{type}Proxy commands):&lt;br /&gt;
* &amp;quot;qlaunch&amp;quot;: SystemApplet&lt;br /&gt;
* &amp;quot;overlay&amp;quot;: OverlayApplet&lt;br /&gt;
* &amp;quot;starter&amp;quot;: SystemApplication&lt;br /&gt;
* &amp;quot;maintenance&amp;quot;: SystemApplet&lt;br /&gt;
* All others: LibraryApplet&lt;br /&gt;
&lt;br /&gt;
== OpenLibraryAppletProxy ==&lt;br /&gt;
Returns an [[#ILibraryAppletProxy]].&lt;br /&gt;
&lt;br /&gt;
Takes a [[IPC_Marshalling|reserved]] input u64(official user-processes use hard-coded value 0), a PID,a process copy-handle(cur-proc handle alias), and a type-0x15 input buffer containing an [[#AppletAttribute]].&lt;br /&gt;
&lt;br /&gt;
Official user-processes use the same retry loop with this as the other Open*Proxy commands.&lt;br /&gt;
&lt;br /&gt;
== CreateSelfLibraryAppletCreatorForDevelop ==&lt;br /&gt;
Takes a PID and an input u64 pid_placeholder, returns an [[#ILibraryAppletCreator]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; must be set to 0x1 with size 0x1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
== GetSystemAppletControllerForDebug ==&lt;br /&gt;
No input, returns an [[#ISystemAppletControllerForDebug]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; must be set to 0x1 with size 0x1, and various state checks must pass, otherwise 0 is returned with no output interface.&lt;br /&gt;
&lt;br /&gt;
== GetDebugFunctions ==&lt;br /&gt;
No input, returns an [[#IDebugFunctions]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; must be set to 0x1 with size 0x1, otherwise 0 is returned with no output interface.&lt;br /&gt;
&lt;br /&gt;
== ISystemAppletProxy ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ISystemAppletProxy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetSelfController || Returns an [[#ISelfController]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetWindowController || Returns an [[#IWindowController]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetAudioController || Returns an [[#IAudioController]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetDisplayController || Returns an [[#IDisplayController]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].&lt;br /&gt;
|-&lt;br /&gt;
| 20 || GetHomeMenuFunctions || Returns an [[#IHomeMenuFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 21 || GetGlobalStateController || Returns an [[#IGlobalStateController]].&lt;br /&gt;
|-&lt;br /&gt;
| 22 || GetApplicationCreator || Returns an [[#IApplicationCreator]].&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [7.0.0+] GetAppletCommonFunctions || Returns an [[#IAppletCommonFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IHomeMenuFunctions ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IHomeMenuFunctions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#RequestToGetForeground]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#LockForeground]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#UnlockForeground]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#PopFromGeneralChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetPopFromGeneralChannelEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#GetHomeButtonWriterLockAccessor]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [2.0.0+] [[#GetWriterLockAccessorEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [11.0.0+] [[#IsSleepEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 41 || [12.0.0+] [[#IsRebootEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [16.0.0+] [[#LaunchSystemApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [16.0.0+] [[#LaunchStarter]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [6.0.0+] [[#PopRequestLaunchApplicationForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [9.0.0+] [[#IsForceTerminateApplicationDisabledForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [8.0.0+] [[#LaunchDevMenu]]&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [11.0.0+] [[#SetLastApplicationExitReason]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== RequestToGetForeground ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== LockForeground ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== UnlockForeground ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== PopFromGeneralChannel ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== GetPopFromGeneralChannelEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== GetHomeButtonWriterLockAccessor ====&lt;br /&gt;
No input, returns an output [[#ILockAccessor]].&lt;br /&gt;
&lt;br /&gt;
Similar to using [[#GetWriterLockAccessorEx]] with inval=0.&lt;br /&gt;
&lt;br /&gt;
==== GetWriterLockAccessorEx ====&lt;br /&gt;
Takes an input u32, returns an output [[#ILockAccessor]].&lt;br /&gt;
&lt;br /&gt;
The input value must be 0-3. 0 = HomeButton.&lt;br /&gt;
&lt;br /&gt;
==== IsSleepEnabled ====&lt;br /&gt;
No input, returns an output bool.&lt;br /&gt;
&lt;br /&gt;
==== IsRebootEnabled ====&lt;br /&gt;
No input, returns an output bool.&lt;br /&gt;
&lt;br /&gt;
==== LaunchSystemApplet ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This wraps [[NS_Services|ns]] LaunchSystemApplet, ignoring the u64 returned by that cmd (and other functionality).&lt;br /&gt;
&lt;br /&gt;
==== LaunchStarter ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is similar to [[#LaunchSystemApplet]], except this uses [[NS_Services|ns]] LaunchLibraryApplet with a ProgramId from global state.&lt;br /&gt;
&lt;br /&gt;
The global state field is initialized elsewhere with the value of [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!starter_id&amp;lt;/code&amp;gt;, defaulting to ProgramId 0100000000001012 ([[Title_list|starter]]) if not available.&lt;br /&gt;
&lt;br /&gt;
==== PopRequestLaunchApplicationForDebug ====&lt;br /&gt;
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output [[NCM_services#ApplicationId|ApplicationId]] and an output s32 &#039;&#039;&#039;total_userIDs&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The total entries in the userID buffer must be &amp;gt;= {total userIDs in state}.&lt;br /&gt;
&lt;br /&gt;
==== IsForceTerminateApplicationDisabledForDebug ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
When the cached value loaded from [[Settings_services#GetDebugModeFlag]] is 0 this will just set the bool to 0. Otherwise, the bool is loaded using data from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!disable_force_terminate_application&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== LaunchDevMenu ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
Uses [[NS_Services|ns]] LaunchDevMenu.&lt;br /&gt;
&lt;br /&gt;
This is used by [[qlaunch]]. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== SetLastApplicationExitReason ====&lt;br /&gt;
Takes an input s32, no output.&lt;br /&gt;
&lt;br /&gt;
==== ILockAccessor ====&lt;br /&gt;
This is &amp;quot;nn::am::service::ILockAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#TryLock]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#Unlock]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [10.0.0+] [[#IsLocked]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== TryLock =====&lt;br /&gt;
Takes an input u8 bool flag, returns an output u8 bool flag and a handle.&lt;br /&gt;
&lt;br /&gt;
Official sw waits on the previously loaded event from [[#GetEvent]]. The output flag indicates whether locking was successful, the user-process can try using this cmd again when flag=false.&lt;br /&gt;
&lt;br /&gt;
Official sw only uses inflag=false. Official sw just closes the output handle. The input flag controls whether this returns the output handle.&lt;br /&gt;
&lt;br /&gt;
===== Unlock =====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
===== GetEvent =====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== IsLocked ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== IGlobalStateController ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IGlobalStateController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#RequestToEnterSleep]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#EnterSleep]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#StartSleepSequence]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#StartShutdownSequence]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#StartRebootSequence]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [7.0.0+] [[#IsAutoPowerDownRequested]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#LoadAndApplyIdlePolicySettings]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [2.0.0+] [[#NotifyCecSettingsChanged]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [3.0.0+] [[#SetDefaultHomeButtonLongPressTime]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [3.0.0+] [[#UpdateDefaultDisplayResolution]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [3.0.0+] [[#ShouldSleepOnBoot]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [4.0.0+] [[#GetHdcpAuthenticationFailedEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [12.0.0+] [[#OpenCradleFirmwareUpdater]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== RequestToEnterSleep ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
==== EnterSleep ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
==== StartSleepSequence ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Official sw uses hard-coded input value = 1.&lt;br /&gt;
&lt;br /&gt;
==== StartShutdownSequence ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== StartRebootSequence ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== IsAutoPowerDownRequested ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Uses [[#idle:sys]] cmd1.&lt;br /&gt;
&lt;br /&gt;
==== LoadAndApplyIdlePolicySettings ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Uses [[#idle:sys]] cmd LoadAndApplySettings.&lt;br /&gt;
&lt;br /&gt;
==== NotifyCecSettingsChanged ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Uses [[#omm]] cmd NotifyCecSettingsChanged.&lt;br /&gt;
&lt;br /&gt;
==== SetDefaultHomeButtonLongPressTime ====&lt;br /&gt;
Takes an input s64, no output.&lt;br /&gt;
&lt;br /&gt;
==== UpdateDefaultDisplayResolution ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Uses [[#omm]] cmd UpdateDefaultDisplayResolution.&lt;br /&gt;
&lt;br /&gt;
==== ShouldSleepOnBoot ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Uses [[#omm]] cmd ShouldSleepOnBoot.&lt;br /&gt;
&lt;br /&gt;
==== GetHdcpAuthenticationFailedEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
Uses [[#omm]] cmd GetHdcpAuthenticationFailedEvent.&lt;br /&gt;
&lt;br /&gt;
==== OpenCradleFirmwareUpdater ====&lt;br /&gt;
No input, returns an [[#ICradleFirmwareUpdater]].&lt;br /&gt;
&lt;br /&gt;
=== ICradleFirmwareUpdater ===&lt;br /&gt;
This is &amp;quot;nn::am::service::ICradleFirmwareUpdater&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [12.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || StartUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 1 || FinishUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetCradleDeviceInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetCradleDeviceInfoChangeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetUpdateProgressInfo&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetLastInternalResult&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GetCradleDeviceInfo ====&lt;br /&gt;
No input, returns a 8-byte CradleDeviceInfo.&lt;br /&gt;
&lt;br /&gt;
[13.0.0+] Now returns a total of 0xC-bytes.&lt;br /&gt;
&lt;br /&gt;
=== IApplicationCreator ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IApplicationCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#PopLaunchRequestedApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#CreateSystemApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#PopFloatingApplicationForDevelopment]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[#CreateApplication]]/[[#CreateSystemApplication]] eventually call the same internal func. With [[#CreateApplication]], two ptrs passed to the internal func are NULL, while with [[#CreateSystemApplication]] these are loaded from state. The initial content of [[#ApplicationLaunchRequestInfo]] is all-zero with [[#CreateSystemApplication]], while with [[#CreateApplication]] the first two u32s are value 0x3 with the rest all-zero. The [[#AppletId]] is set to 0x01 with [[#CreateApplication]], while with [[#CreateSystemApplication]] it&#039;s 0x04.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplication ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an [[#IApplicationAccessor]].&lt;br /&gt;
&lt;br /&gt;
==== PopLaunchRequestedApplication ====&lt;br /&gt;
No input, returns an [[#IApplicationAccessor]].&lt;br /&gt;
&lt;br /&gt;
==== CreateSystemApplication ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|SystemApplicationId]], returns an [[#IApplicationAccessor]].&lt;br /&gt;
&lt;br /&gt;
[[qlaunch]] only uses this with a hard-coded id for the &amp;quot;starter&amp;quot; title.&lt;br /&gt;
&lt;br /&gt;
==== PopFloatingApplicationForDevelopment ====&lt;br /&gt;
No input, returns an [[#IApplicationAccessor]].&lt;br /&gt;
&lt;br /&gt;
Should not be used if no FloatingApplication is available (svcBreak).&lt;br /&gt;
&lt;br /&gt;
==== IApplicationAccessor ====&lt;br /&gt;
This is &amp;quot;nn::am::service::IApplicationAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetAppletStateChangedEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#IsCompleted]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#Start]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#RequestExit]] || &lt;br /&gt;
|-&lt;br /&gt;
| 25 || [[#Terminate]] || &lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#GetResult]] || &lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#RequestForApplicationToGetForeground]] || &lt;br /&gt;
|-&lt;br /&gt;
| 110 || [[#TerminateAllLibraryApplets]] || &lt;br /&gt;
|-&lt;br /&gt;
| 111 || [[#AreAnyLibraryAppletsLeft]] || &lt;br /&gt;
|-&lt;br /&gt;
| 112 || [[#GetCurrentLibraryApplet]] || &lt;br /&gt;
|-&lt;br /&gt;
| 120 || [[#GetApplicationId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 121 || [[#PushLaunchParameter]] || &lt;br /&gt;
|-&lt;br /&gt;
| 122 || [[#GetApplicationControlProperty]] || &lt;br /&gt;
|-&lt;br /&gt;
| 123 || [2.0.0+] [[#GetApplicationLaunchProperty]] || &lt;br /&gt;
|-&lt;br /&gt;
| 124 || [6.0.0+] [[#GetApplicationLaunchRequestInfo]] || &lt;br /&gt;
|-&lt;br /&gt;
| 130 || [6.0.0+] [[#SetUsers]] || &lt;br /&gt;
|-&lt;br /&gt;
| 131 || [6.0.0+] [[#CheckRightsEnvironmentAvailable]] || &lt;br /&gt;
|-&lt;br /&gt;
| 132 || [6.0.0+] [[#GetNsRightsEnvironmentHandle]] || &lt;br /&gt;
|-&lt;br /&gt;
| 140 || [6.0.0+] [[#GetDesirableUids]] || &lt;br /&gt;
|-&lt;br /&gt;
| 150 || [6.0.0+] [[#ReportApplicationExitTimeout]] || &lt;br /&gt;
|-&lt;br /&gt;
| 160 || [8.0.0+] [[#SetApplicationAttribute]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 170 || [8.0.0+] [[#HasSaveDataAccessPermission]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 180 || [9.0.0+] [[#PushToFriendInvitationStorageChannel]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 190 || [9.0.0+] [[#PushToNotificationStorageChannel]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [10.0.0+] [[#RequestApplicationSoftReset]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [10.0.0+] [[#RestartApplicationTimer]] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Commands &amp;lt;=30 are inherited from [[#IAppletAccessor]].&lt;br /&gt;
&lt;br /&gt;
===== RequestForApplicationToGetForeground =====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
===== GetCurrentLibraryApplet =====&lt;br /&gt;
No input, returns an output [[#IAppletAccessor]].&lt;br /&gt;
&lt;br /&gt;
===== GetApplicationId =====&lt;br /&gt;
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].&lt;br /&gt;
&lt;br /&gt;
===== PushLaunchParameter =====&lt;br /&gt;
Takes an input u32 [[#LaunchParameterKind]] and an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
===== GetApplicationControlProperty =====&lt;br /&gt;
No input, takes a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
The output buffer must be at least 0x4000-bytes. Returns an error when the [[#AppletId]] is 0x04, aka when the IApplicationAccessor is for a SystemApplication. &lt;br /&gt;
&lt;br /&gt;
This gets the application [[NACP_Format|control.nacp]].&lt;br /&gt;
&lt;br /&gt;
===== GetApplicationLaunchProperty =====&lt;br /&gt;
Takes a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
The output buffer size must be at least 0x10-bytes. Returns an error when the [[#AppletId]] is 0x04, aka when the IApplicationAccessor is for a SystemApplication.&lt;br /&gt;
&lt;br /&gt;
This gets the [[#ApplicationLaunchProperty]].&lt;br /&gt;
&lt;br /&gt;
===== GetApplicationLaunchRequestInfo =====&lt;br /&gt;
No input, returns an output 0x10-byte struct.&lt;br /&gt;
&lt;br /&gt;
This gets the [[#ApplicationLaunchRequestInfo]] from state. The output struct is &amp;quot;nn::applet::ApplicationLaunchRequestInfo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== SetUsers =====&lt;br /&gt;
Takes an input u8 bool flag and a type-0x5 input buffer containing an array of u128 userIDs.&lt;br /&gt;
&lt;br /&gt;
The total entries for the userIDs must be &amp;lt;=8.&lt;br /&gt;
&lt;br /&gt;
When the input flag is true, this just clears the &#039;&#039;&#039;users_available&#039;&#039;&#039; state flag to 0 and returns.&lt;br /&gt;
&lt;br /&gt;
===== CheckRightsEnvironmentAvailable =====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
===== GetNsRightsEnvironmentHandle =====&lt;br /&gt;
No input, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
===== GetDesirableUids =====&lt;br /&gt;
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output s32 &#039;&#039;&#039;total_entries&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Gets a userID listing, this is unrelated to [[#SetUsers]]. [[qlaunch]] only uses 1 userID with this.&lt;br /&gt;
&lt;br /&gt;
The stored entry-count in state must be &amp;lt;= &amp;lt;size of output buffer in entries&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== ReportApplicationExitTimeout =====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
===== SetApplicationAttribute =====&lt;br /&gt;
Takes a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.&lt;br /&gt;
&lt;br /&gt;
===== HasSaveDataAccessPermission =====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]], returns an output u8 bool flag.&lt;br /&gt;
&lt;br /&gt;
Gets whether the savedata specified by the input ApplicationId is accessible. The output flag indicates whether it&#039;s accessible.&lt;br /&gt;
&lt;br /&gt;
If the ApplicationId matches the current application, this immediately returns success with flag=1.&lt;br /&gt;
&lt;br /&gt;
===== PushToFriendInvitationStorageChannel =====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
Clears the FriendInvitation StorageChannel, then pushes the input storage there.&lt;br /&gt;
&lt;br /&gt;
===== PushToNotificationStorageChannel =====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
Clears the Notification StorageChannel, then pushes the input storage there.&lt;br /&gt;
&lt;br /&gt;
[[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.&lt;br /&gt;
&lt;br /&gt;
===== RequestApplicationSoftReset =====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
===== RestartApplicationTimer =====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
===== IAppletAccessor =====&lt;br /&gt;
This is &amp;quot;nn::am::service::IAppletAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetAppletStateChangedEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#IsCompleted]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#Start]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#RequestExit]]&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [[#Terminate]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#GetResult]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GetAppletStateChangedEvent ====&lt;br /&gt;
No input, returns an output event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== IsCompleted ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
==== Start ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== RequestExit ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== Terminate ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== GetResult====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
== IAppletCommonFunctions ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IAppletCommonFunctions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [7.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [9.0.0+] [[#SetTerminateResult]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#ReadThemeStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#WriteThemeStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [9.0.0+] [[#PushToAppletBoundChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [9.0.0+] [[#TryPopFromAppletBoundChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [8.0.0+] [[#GetDisplayLogicalResolution]]&lt;br /&gt;
|-&lt;br /&gt;
| 42 || [8.0.0+] [[#SetDisplayMagnification]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [8.0.0+] [[#SetHomeButtonDoubleClickEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [8.0.0+] [[#GetHomeButtonDoubleClickEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 52 || [10.0.0+] [[#IsHomeButtonShortPressedBlocked]]&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [11.0.0+] [[#IsVrModeCurtainRequired]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || [12.0.0+] IsSleepRequiredByHighTemperature&lt;br /&gt;
|-&lt;br /&gt;
| 62 || [12.0.0+] IsSleepRequiredByLowBattery&lt;br /&gt;
|-&lt;br /&gt;
| 70 || [11.0.0+] [[#SetCpuBoostRequestPriority]]&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [14.0.0+] SetHandlingCaptureButtonShortPressedMessageEnabledForApplet&lt;br /&gt;
|-&lt;br /&gt;
| 81 || [14.0.0+] SetHandlingCaptureButtonLongPressedMessageEnabledForApplet&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [15.0.0+] OpenNamedChannelAsParent&lt;br /&gt;
|-&lt;br /&gt;
| 91 || [15.0.0+] OpenNamedChannelAsChild&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [15.0.0+] SetApplicationCoreUsageMode&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
ReadThemeStorage/WriteThemeStorage: these commands copy data from/to a state buffer and the user specified buffer. The size of the state buffer is 0x400-bytes. The default content of the ThemeStorage prior to using the WriteThemeStorage cmd, is: &amp;lt;code&amp;gt;memset(statebuf, 0xAA, 0x400);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ReadThemeStorage ===&lt;br /&gt;
Takes an input u64 &#039;&#039;&#039;offset&#039;&#039;&#039; and a type-0x22 output buffer, returns an output u64 &#039;&#039;&#039;actual_transfer_size&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== WriteThemeStorage ===&lt;br /&gt;
Takes an input u64 &#039;&#039;&#039;offset&#039;&#039;&#039; and a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
=== PushToAppletBoundChannel ===&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
This is similar to [[#PushToAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.&lt;br /&gt;
&lt;br /&gt;
=== TryPopFromAppletBoundChannel ===&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
This is similar to [[#TryPopFromAppletBoundChannelForDebug]] (no DebugMode check), except the used s32 is loaded from elsewhere and must be in the range 31-32.&lt;br /&gt;
&lt;br /&gt;
=== GetDisplayLogicalResolution ===&lt;br /&gt;
No input, returns an output s32 &#039;&#039;&#039;width&#039;&#039;&#039; and s32 &#039;&#039;&#039;height&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== SetDisplayMagnification ===&lt;br /&gt;
Takes an input float &#039;&#039;&#039;x&#039;&#039;&#039;, float &#039;&#039;&#039;y&#039;&#039;&#039;, float &#039;&#039;&#039;width&#039;&#039;&#039;, and float &#039;&#039;&#039;height&#039;&#039;&#039;, no output.&lt;br /&gt;
&lt;br /&gt;
Sets the DisplayMagnification. This is essentially layer image crop, for everything non-Overlay.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;x&#039;&#039;&#039; and &#039;&#039;&#039;width&#039;&#039;&#039; are multiplied with the same width value returned by [[#GetDisplayLogicalResolution]], so these should be in the range 0.0f-1.0f. Likewise for y and height, except these are multipled with the height value.&lt;br /&gt;
&lt;br /&gt;
=== SetHomeButtonDoubleClickEnabled ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== GetHomeButtonDoubleClickEnabled ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== IsHomeButtonShortPressedBlocked ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== IsVrModeCurtainRequired ===&lt;br /&gt;
No input, returns an output bool.&lt;br /&gt;
&lt;br /&gt;
=== SetCpuBoostRequestPriority ===&lt;br /&gt;
Takes an input s32, no output.&lt;br /&gt;
&lt;br /&gt;
== ILibraryAppletProxy ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ILibraryAppletProxy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetSelfController || Returns an [[#ISelfController]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetWindowController || Returns an [[#IWindowController]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetAudioController || Returns an [[#IAudioController]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetDisplayController || Returns an [[#IDisplayController]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].&lt;br /&gt;
|-&lt;br /&gt;
| 20 || OpenLibraryAppletSelfAccessor || Returns an [[#ILibraryAppletSelfAccessor]].&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [15.0.0+] GetHomeMenuFunctions || No input, returns an [[#IHomeMenuFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ILibraryAppletSelfAccessor ===&lt;br /&gt;
This is &amp;quot;nn::am::service::ILibraryAppletSelfAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#PopInData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#PushOutData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#PopInteractiveInData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#PushInteractiveOutData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetPopInDataEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#GetPopInteractiveInDataEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#ExitProcessAndReturn]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#GetLibraryAppletInfo]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#GetMainAppletIdentityInfo]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#CanUseApplicationCore]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#GetCallerAppletIdentityInfo]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [2.0.0+] [[#GetMainAppletApplicationControlProperty]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [2.0.0+] [[#GetMainAppletStorageId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [3.0.0+] [[#GetCallerAppletIdentityInfoStack]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [4.0.0+] [[#GetNextReturnDestinationAppletIdentityInfo]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [4.0.0+] [[#GetDesirableKeyboardLayout]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#PopExtraStorage]] || &lt;br /&gt;
|-&lt;br /&gt;
| 25 || [[#GetPopExtraStorageEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#UnpopInData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 31 || [[#UnpopExtraStorage]] || &lt;br /&gt;
|-&lt;br /&gt;
| 40 || [2.0.0+] [[#GetIndirectLayerProducerHandle]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [3.0.0+] [[#ReportVisibleError]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [4.0.0+] [[#ReportVisibleErrorWithErrorContext]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [4.0.0+] [[#GetMainAppletApplicationDesiredLanguage]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 70 || [8.0.0+] [[#GetCurrentApplicationId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [6.0.0+] [[#RequestExitToSelf]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [5.0.0+] [[#CreateApplicationAndPushAndRequestToLaunch]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [4.0.0+] [[#CreateGameMovieTrimmer]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [5.0.0+] [[#ReserveResourceForMovieOperation]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [5.0.0+] [[#UnreserveResourceForMovieOperation]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [6.0.0+] [[#GetMainAppletAvailableUsers]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [9.0.0+] [[#GetLaunchStorageInfoForDebug]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 130 || [9.0.0+] [[#GetGpuErrorDetectedSystemEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 140 || [10.0.0+] [[#SetApplicationMemoryReservation]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 150 || [10.0.0+] [[#ShouldSetGpuTimeSliceManually]] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== PopInData ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== PushOutData ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== PopInteractiveInData ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== PushInteractiveOutData ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== GetPopInDataEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== GetPopInteractiveInDataEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== ExitProcessAndReturn ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Exits the LibraryApplet and returns to running the title which launched this LibraryApplet ([[qlaunch]] for example).&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== GetLibraryAppletInfo ====&lt;br /&gt;
No input, returns an output [[#LibraryAppletInfo]].&lt;br /&gt;
&lt;br /&gt;
==== GetMainAppletIdentityInfo ====&lt;br /&gt;
No input, returns an output [[#AppletIdentityInfo]].&lt;br /&gt;
&lt;br /&gt;
==== CanUseApplicationCore ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
==== GetCallerAppletIdentityInfo ====&lt;br /&gt;
No input, returns an output [[#AppletIdentityInfo]].&lt;br /&gt;
&lt;br /&gt;
==== GetMainAppletApplicationControlProperty ====&lt;br /&gt;
No input, takes a type-0x16 output buffer.&lt;br /&gt;
&lt;br /&gt;
This gets the [[NACP_Format|control.nacp]].&lt;br /&gt;
&lt;br /&gt;
==== GetMainAppletStorageId ====&lt;br /&gt;
No input, returns an output u8 storageId.&lt;br /&gt;
&lt;br /&gt;
==== GetCallerAppletIdentityInfoStack ====&lt;br /&gt;
Takes a type-0x6 output buffer containing an array of [[#AppletIdentityInfo]], and returns an output s32 total_entries.&lt;br /&gt;
&lt;br /&gt;
==== GetNextReturnDestinationAppletIdentityInfo ====&lt;br /&gt;
No input, returns an output [[#AppletIdentityInfo]].&lt;br /&gt;
&lt;br /&gt;
==== GetDesirableKeyboardLayout ====&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
The output u32 is &amp;quot;nn::settings::KeyboardLayout&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This gets the value previously set by [[#SetDesirableKeyboardLayout]]. An error is returned if it&#039;s not set.&lt;br /&gt;
&lt;br /&gt;
==== PopExtraStorage ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== GetPopExtraStorageEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== UnpopInData ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== UnpopExtraStorage ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== GetIndirectLayerProducerHandle ====&lt;br /&gt;
No input, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
==== ReportVisibleError ====&lt;br /&gt;
Takes an input [[Error_Applet#ErrorCode|ErrorCode]], no output.&lt;br /&gt;
&lt;br /&gt;
==== ReportVisibleErrorWithErrorContext ====&lt;br /&gt;
Takes an input [[Error_Applet#ErrorCode|ErrorCode]] and a type-0x15 input buffer containing an [[Error_Applet#ErrorContext|ErrorContext]], no output.&lt;br /&gt;
&lt;br /&gt;
==== GetMainAppletApplicationDesiredLanguage ====&lt;br /&gt;
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].&lt;br /&gt;
&lt;br /&gt;
==== GetCurrentApplicationId ====&lt;br /&gt;
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].&lt;br /&gt;
&lt;br /&gt;
Gets the [[NCM_services#ApplicationId|ApplicationId]] for the currently running Application. ApplicationId=0 when no Application is running.&lt;br /&gt;
&lt;br /&gt;
==== RequestExitToSelf ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#RequestExit]] except this is for the current applet.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationAndPushAndRequestToLaunch ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input #IStorage, no output.&lt;br /&gt;
&lt;br /&gt;
This is is similar to [[#CreateApplicationAndPushAndRequestToStart]].&lt;br /&gt;
&lt;br /&gt;
==== CreateGameMovieTrimmer ====&lt;br /&gt;
Takes an input u64 size and a TransferMemory handle, returns a GRC [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].&lt;br /&gt;
&lt;br /&gt;
This is a wrapper for GRC [[GRC_services#OpenGameMovieTrimmer|OpenGameMovieTrimmer]].&lt;br /&gt;
&lt;br /&gt;
Official sw uses an user-buffer for the tmem, with permissions=0.&lt;br /&gt;
&lt;br /&gt;
==== ReserveResourceForMovieOperation ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Updates state fields. This must be used before [[#CreateGameMovieTrimmer]].&lt;br /&gt;
&lt;br /&gt;
==== UnreserveResourceForMovieOperation ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Updates state fields. This must be used once finished with [[GRC_services#IGameMovieTrimmer|IGameMovieTrimmer]].&lt;br /&gt;
&lt;br /&gt;
==== GetMainAppletAvailableUsers ====&lt;br /&gt;
Takes a type-0x6 output buffer containing an array of u128 userIDs, returns an output u8 bool and a s32 &#039;&#039;&#039;total_entries&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This gets the userIDs previously set by [[#SetUsers]].&lt;br /&gt;
&lt;br /&gt;
The size of the output buffer in entries must be at least 8.&lt;br /&gt;
&lt;br /&gt;
Normally the output bool is set to 0, however when no users are available it&#039;s set to 1 with &#039;&#039;&#039;total_entries&#039;&#039;&#039; = -1.&lt;br /&gt;
&lt;br /&gt;
==== SetApplicationMemoryReservation ====&lt;br /&gt;
Takes an input u64, no output.&lt;br /&gt;
&lt;br /&gt;
An Application must be currently running. The input u64 must be 0x1000-byte aligned.&lt;br /&gt;
&lt;br /&gt;
==== ShouldSetGpuTimeSliceManually ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
== IOverlayAppletProxy ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IOverlayAppletProxy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetSelfController || Returns an [[#ISelfController]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetWindowController || Returns an [[#IWindowController]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetAudioController || Returns an [[#IAudioController]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetDisplayController || Returns an [[#IDisplayController]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].&lt;br /&gt;
|-&lt;br /&gt;
| 20 || GetOverlayFunctions || Returns an [[#IOverlayFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [7.0.0+] GetAppletCommonFunctions || No input, returns an [[#IAppletCommonFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [15.0.0+] GetGlobalStateController || No input, returns an [[#IGlobalStateController]].&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IOverlayFunctions ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IOverlayFunctions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#BeginToWatchShortHomeButtonMessage]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#EndToWatchShortHomeButtonMessage]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetApplicationIdForLogo]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#SetGpuTimeSliceBoost]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [2.0.0+] [[#SetAutoSleepTimeAndDimmingTimeEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [2.0.0+] [[#TerminateApplicationAndSetReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [3.0.0+] [[#SetScreenShotPermissionGlobally]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [6.0.0+] [[#StartShutdownSequenceForOverlay]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [6.0.0+] [[#StartRebootSequenceForOverlay]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [8.0.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [14.0.0+] SetHandlingTouchScreenInputEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [9.0.0+] [[#SetHealthWarningShowingState]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [10.0.0+] [[#IsHealthWarningRequired]]&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [7.0.0+] [[#SetRequiresGpuResourceUse]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [5.0.0+] [[#BeginToObserveHidInputForDevelop]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== BeginToWatchShortHomeButtonMessage ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== EndToWatchShortHomeButtonMessage ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== GetApplicationIdForLogo ====&lt;br /&gt;
No input, returns an output [[NCM_services#ApplicationId|ApplicationId]].&lt;br /&gt;
&lt;br /&gt;
Gets the ApplicationId for displaying the logo screen during application launch.&lt;br /&gt;
&lt;br /&gt;
When no application is running, this returns success with ApplicationId=0.&lt;br /&gt;
&lt;br /&gt;
==== SetGpuTimeSliceBoost ====&lt;br /&gt;
Takes an input u64, no output.&lt;br /&gt;
&lt;br /&gt;
==== SetAutoSleepTimeAndDimmingTimeEnabled ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== TerminateApplicationAndSetReason ====&lt;br /&gt;
Takes an input u32 Result, no output.&lt;br /&gt;
&lt;br /&gt;
==== SetScreenShotPermissionGlobally ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== StartShutdownSequenceForOverlay ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== StartRebootSequenceForOverlay ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== SetHandlingHomeButtonShortPressedEnabled ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== SetHealthWarningShowingState ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
This writes the input bool into state, signals an Event, and returns 0.&lt;br /&gt;
&lt;br /&gt;
==== IsHealthWarningRequired ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
==== SetRequiresGpuResourceUse ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Just returns 0.&lt;br /&gt;
&lt;br /&gt;
==== BeginToObserveHidInputForDevelop ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Sets various state fields and signals an userspace-event.&lt;br /&gt;
&lt;br /&gt;
Enables HID input for the OverlayApplet, without disabling input for the foreground applet.&lt;br /&gt;
&lt;br /&gt;
== IApplicationProxy ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IApplicationProxy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetCommonStateGetter || Returns an [[#ICommonStateGetter]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetSelfController || Returns an [[#ISelfController]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetWindowController || Returns an [[#IWindowController]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetAudioController || Returns an [[#IAudioController]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetDisplayController || Returns an [[#IDisplayController]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetProcessWindingController || Returns an [[#IProcessWindingController]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetLibraryAppletCreator || Returns an [[#ILibraryAppletCreator]].&lt;br /&gt;
|-&lt;br /&gt;
| 20 || GetApplicationFunctions || Returns an [[#IApplicationFunctions]].&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || GetDebugFunctions || Returns an [[#IDebugFunctions]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IApplicationFunctions ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IApplicationFunctions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#PopLaunchParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#CreateApplicationAndPushAndRequestToStart]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [3.0.0+] [[#CreateApplicationAndPushAndRequestToStartForQuest]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [4.0.0+] [[#CreateApplicationAndRequestToStart]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [4.0.0+] [[#CreateApplicationAndRequestToStartForQuest]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [7.0.0+] [[#CreateApplicationWithAttributeAndPushAndRequestToStartForQuest]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [7.0.0+] [[#CreateApplicationWithAttributeAndRequestToStartForQuest]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#EnsureSaveData]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetDesiredLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [[#SetTerminateResult]]&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [[#GetDisplayVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [2.0.0+] [[#GetLaunchStorageInfoForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [3.0.0+] ExtendSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 26 || [3.0.0+] GetSaveDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 27 || [5.0.0+] CreateCacheStorage&lt;br /&gt;
|-&lt;br /&gt;
| 28 || [11.0.0+] [[#GetSaveDataSizeMax]]&lt;br /&gt;
|-&lt;br /&gt;
| 29 || [11.0.0+] [[#GetCacheStorageMax]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#BeginBlockingHomeButtonShortAndLongPressed]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [[#EndBlockingHomeButtonShortAndLongPressed]]&lt;br /&gt;
|-&lt;br /&gt;
| 32 || [[#BeginBlockingHomeButton]]&lt;br /&gt;
|-&lt;br /&gt;
| 33 || [[#EndBlockingHomeButton]]&lt;br /&gt;
|-&lt;br /&gt;
| 34 || [10.0.0-15.0.1] [[#SelectApplicationLicense]]&lt;br /&gt;
|-&lt;br /&gt;
| 35 || [11.0.0+] [[#GetDeviceSaveDataSizeMax]]&lt;br /&gt;
|-&lt;br /&gt;
| 36 || [14.0.0+] GetLimitedApplicationLicense&lt;br /&gt;
|-&lt;br /&gt;
| 37 || [14.0.0+] GetLimitedApplicationLicenseUpgradableEvent&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [[#NotifyRunning]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [2.0.0+] [[#GetPseudoDeviceId]]&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [2.0.0+] [[#SetMediaPlaybackStateForApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [3.0.0+] [[#IsGamePlayRecordingSupported]]&lt;br /&gt;
|-&lt;br /&gt;
| 66 || [3.0.0+] [[#InitializeGamePlayRecording]]&lt;br /&gt;
|-&lt;br /&gt;
| 67 || [3.0.0+] [[#SetGamePlayRecordingState]]&lt;br /&gt;
|-&lt;br /&gt;
| 68 || [4.0.0+] [[#RequestFlushGamePlayingMovieForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 70 || [3.0.0+] [[#RequestToShutdown]]&lt;br /&gt;
|-&lt;br /&gt;
| 71 || [3.0.0+] [[#RequestToReboot]]&lt;br /&gt;
|-&lt;br /&gt;
| 72 || [10.0.0+] [[#RequestToSleep]]&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [4.0.0+] [[#ExitAndRequestToShowThanksMessage]]&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [4.0.0+] [[#EnableApplicationCrashReport]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [5.0.0+] [[#InitializeApplicationCopyrightFrameBuffer]] &lt;br /&gt;
|-&lt;br /&gt;
| 101 || [5.0.0+] [[#SetApplicationCopyrightImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [5.0.0+] [[#SetApplicationCopyrightVisibility]]&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [5.0.0+] [[#QueryApplicationPlayStatistics]]&lt;br /&gt;
|-&lt;br /&gt;
| 111 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUid]]&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [5.0.0+] [[#ExecuteProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 121 || [5.0.0+] [[#ClearUserChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 122 || [5.0.0+] [[#UnpopToUserChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 123 || [5.0.0+] [[#GetPreviousProgramIndex]]&lt;br /&gt;
|-&lt;br /&gt;
| 124 || [6.0.0+] [[#EnableApplicationAllThreadDumpOnCrash]]&lt;br /&gt;
|-&lt;br /&gt;
| 130 || [8.0.0+] [[#GetGpuErrorDetectedSystemEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 131 || [11.0.0+] [[#SetDelayTimeToAbortOnGpuError]]&lt;br /&gt;
|-&lt;br /&gt;
| 140 || [9.0.0+] [[#GetFriendInvitationStorageChannelEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 141 || [9.0.0+] [[#TryPopFromFriendInvitationStorageChannel]] &lt;br /&gt;
|-&lt;br /&gt;
| 150 || [9.0.0+] [[#GetNotificationStorageChannelEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 151 || [9.0.0+] [[#TryPopFromNotificationStorageChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 160 || [9.0.0+] [[#GetHealthWarningDisappearedSystemEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 170 || [9.0.0+] [[#SetHdcpAuthenticationActivated]]&lt;br /&gt;
|-&lt;br /&gt;
| 180 || [10.1.0+] [[#GetLaunchRequiredVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 181 || [10.1.0+] [[#UpgradeLaunchRequiredVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 190 || [11.0.0+] [[#SendServerMaintenanceOverlayNotification]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [11.0.0+] [[#GetLastApplicationExitReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 500 || [5.0.0+] [[#StartContinuousRecordingFlushForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [5.0.0+] [[#CreateMovieMaker]]&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || [5.0.0+] [[#PrepareForJit]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The BOTW game uses this GamePlayRecording functionality from the main-nso &amp;quot;nninitStartup&amp;quot; function, with size 0x6000000(96MiB). The official GamePlayRecording-enable code does the following(this will panic on any failure):&lt;br /&gt;
* [[SVC|Creates]] TransferMemory using the input buffer and size, with permissions=0.&lt;br /&gt;
* Uses [[#InitializeGamePlayRecording]] with the TransferMemory.&lt;br /&gt;
* Closes the TransferMemory handle, + TransferMemory cleanup.&lt;br /&gt;
* Uses [[#SetGamePlayRecordingState]] with value 0x1.&lt;br /&gt;
This GamePlayRecording functionality presumably enables the video-recording usable starting with [[4.0.0]].&lt;br /&gt;
&lt;br /&gt;
==== PopLaunchParameter ====&lt;br /&gt;
Takes an input u32 [[#LaunchParameterKind]], returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
Pops a LaunchParameter [[#IStorage]], the storage will be removed from sysmodule state during this.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationAndPushAndRequestToStart ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and an input [[#IStorage]], no output. ApplicationId=0 can be used to relaunch the current application.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationAndPushAndRequestToStartForQuest ====&lt;br /&gt;
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]), an input [[NCM_services#ApplicationId|ApplicationId]], and an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationAndRequestToStart ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]], no output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#CreateApplicationAndPushAndRequestToStart]] except without the input storage, official sw uses this when no input storage is specified.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationAndRequestToStartForQuest ====&lt;br /&gt;
Takes 2 input u32s (loaded from struct [[#ApplicationAttributeForQuest]]) and an input [[NCM_services#ApplicationId|ApplicationId]], no output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#CreateApplicationAndPushAndRequestToStartForQuest]] except without the input storage, official sw uses this when no input storage is specified.&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationWithAttributeAndPushAndRequestToStartForQuest ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]], a type-0x15 input buffer containing an [[#ApplicationAttribute]], an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==== CreateApplicationWithAttributeAndRequestToStartForQuest ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]] and a type-0x15 input buffer containing an [[#ApplicationAttribute]], no output.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
==== EnsureSaveData ====&lt;br /&gt;
Takes an input u128 userID, returns an output u64 size.&lt;br /&gt;
&lt;br /&gt;
Calls sdk func &amp;lt;code&amp;gt;nn::fs::EnsureApplicationSaveData&amp;lt;/code&amp;gt;. [[qlaunch]] also calls this same sdk func directly.&lt;br /&gt;
&lt;br /&gt;
Creates the various savedata as specified by the application [[NACP_Format|control.nacp]] when the savedata doesn&#039;t exist.&lt;br /&gt;
&lt;br /&gt;
Official user-processes launch the dataErase LibraryApplet depending on the Result, the above output size is used with this.&lt;br /&gt;
&lt;br /&gt;
==== GetDesiredLanguage ====&lt;br /&gt;
No input, returns an output [[Settings_services#LanguageCode|LanguageCode]].&lt;br /&gt;
&lt;br /&gt;
==== SetTerminateResult ====&lt;br /&gt;
Takes an input u32 &#039;&#039;&#039;Result&#039;&#039;&#039;, no output.&lt;br /&gt;
&lt;br /&gt;
For example, in some cases official apps use this with [[Error_codes|error]] 0x2A2 then uses svcBreak.&lt;br /&gt;
&lt;br /&gt;
==== GetDisplayVersion ====&lt;br /&gt;
No input, returns an output 0x10-byte struct.&lt;br /&gt;
&lt;br /&gt;
The output struct is &amp;quot;nn::oe::DisplayVersion&amp;quot;. This the DisplayVersion string copied from the application [[NACP_Format|control.nacp]], this is always NUL-terminated.&lt;br /&gt;
&lt;br /&gt;
==== GetLaunchStorageInfoForDebug ====&lt;br /&gt;
No input, returns an output u8 [[Filesystem_services#StorageId|StorageId]] and u8 [[Filesystem_services#StorageId|StorageId]].&lt;br /&gt;
&lt;br /&gt;
This returns two u8s loaded from state, these are the same StorageIds from [[#ApplicationLaunchProperty]].&lt;br /&gt;
&lt;br /&gt;
==== GetSaveDataSizeMax ====&lt;br /&gt;
No input, returns two ouput s64s.&lt;br /&gt;
&lt;br /&gt;
==== GetCacheStorageMax ====&lt;br /&gt;
No input, returns an output s32 and s64.&lt;br /&gt;
&lt;br /&gt;
==== BeginBlockingHomeButtonShortAndLongPressed ====&lt;br /&gt;
Takes an input s64, no output.&lt;br /&gt;
&lt;br /&gt;
Official user-processes use hard-coded value 0 for the s64.&lt;br /&gt;
&lt;br /&gt;
Starts blocking the Home button.&lt;br /&gt;
&lt;br /&gt;
==== EndBlockingHomeButtonShortAndLongPressed ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Ends the blocking started by [[#BeginBlockingHomeButtonShortAndLongPressed]].&lt;br /&gt;
&lt;br /&gt;
==== BeginBlockingHomeButton ====&lt;br /&gt;
Takes an input s64 nanoseconds, no output. The input nanoseconds can be zero.&lt;br /&gt;
&lt;br /&gt;
==== EndBlockingHomeButton ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== SelectApplicationLicense ====&lt;br /&gt;
Takes an input array of [[#ApplicationLicenseType]], returns an output [[#ApplicationLicenseType]].&lt;br /&gt;
&lt;br /&gt;
==== GetDeviceSaveDataSizeMax ====&lt;br /&gt;
No input, returns two output s64s.&lt;br /&gt;
&lt;br /&gt;
==== NotifyRunning ====&lt;br /&gt;
Takes no input. Returns an output u8 bool, which is ignored by official user-processes.&lt;br /&gt;
&lt;br /&gt;
==== GetPseudoDeviceId ====&lt;br /&gt;
No input, returns an output 0x10-byte &amp;quot;nn::util::Uuid&amp;quot; struct.&lt;br /&gt;
&lt;br /&gt;
The 0x20-byte output data from [[NS_Services|GetSystemSeedForPseudoDeviceId]] followed by the 8-byte [[NACP_Format|SeedForPseudoDeviceId]] from the current control.nacp, is hashed with SHA1. Then &amp;quot;nn::util::GenerateUuidVersion5&amp;quot; is called with the final hash, the output from this is then returned for the Uuid.&lt;br /&gt;
&lt;br /&gt;
==== SetMediaPlaybackStateForApplication ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== IsGamePlayRecordingSupported ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
==== InitializeGamePlayRecording ====&lt;br /&gt;
Takes a TransferMemory handle and an u64 for the size of the TransferMemory. The size must match 0x6000000 otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
==== SetGamePlayRecordingState ====&lt;br /&gt;
Takes an input u32. 0 = disable/pause, 1 = enable/restart.&lt;br /&gt;
&lt;br /&gt;
==== RequestFlushGamePlayingMovieForDebug ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Requests to save the video recording, as if the Capture-button was held.&lt;br /&gt;
&lt;br /&gt;
==== RequestToShutdown ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== RequestToReboot ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
==== RequestToSleep ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== ExitAndRequestToShowThanksMessage ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Used to exit the application and return to the kiosk menu. Official sw uses [[#UnlockExit]] immediately before this if needed.&lt;br /&gt;
&lt;br /&gt;
On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
This throws an error when the cached [[Settings_services#GetQuestFlag]] value is 0.&lt;br /&gt;
&lt;br /&gt;
==== EnableApplicationCrashReport ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== InitializeApplicationCopyrightFrameBuffer ====&lt;br /&gt;
Takes an input TransferMemory handle, an s32 &#039;&#039;&#039;width&#039;&#039;&#039;, an s32 &#039;&#039;&#039;height&#039;&#039;&#039;, an u64 tmem_size, and no output.&lt;br /&gt;
&lt;br /&gt;
tmem_size must be 0x40000-byte aligned. &#039;&#039;&#039;width&#039;&#039;&#039; must be 1-1280, and &#039;&#039;&#039;height&#039;&#039;&#039; must be 1-720.&lt;br /&gt;
&lt;br /&gt;
User-processes create the tmem with an user-specified buffer with permissions=0. &#039;&#039;&#039;width&#039;&#039;&#039; = 1280 and &#039;&#039;&#039;height&#039;&#039;&#039; = 720.&lt;br /&gt;
&lt;br /&gt;
After the validation checks pass the input is passed to [[OMM_services|ommdisp]] cmd500.&lt;br /&gt;
&lt;br /&gt;
This is used as an overlay for screenshots.&lt;br /&gt;
&lt;br /&gt;
==== SetApplicationCopyrightImage ====&lt;br /&gt;
Takes a type-0x45 input buffer, an s32 &#039;&#039;&#039;x&#039;&#039;&#039;, an s32 &#039;&#039;&#039;y&#039;&#039;&#039;, an s32 &#039;&#039;&#039;width&#039;&#039;&#039;, an s32 &#039;&#039;&#039;height&#039;&#039;&#039;, an s32 [[#WindowOriginMode]], and no output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;x&#039;&#039;&#039; and &#039;&#039;&#039;y&#039;&#039;&#039; must not have the negative bit set. &#039;&#039;&#039;width&#039;&#039;&#039; and &#039;&#039;&#039;height&#039;&#039;&#039; must not be &amp;lt;1.&lt;br /&gt;
&lt;br /&gt;
Sets the RGBA8 image for use with [[#InitializeApplicationCopyrightFrameBuffer]]. Overrides the current image, if this was already used previously.&lt;br /&gt;
&lt;br /&gt;
==== SetApplicationCopyrightVisibility ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Sets the visibility for the image set by [[#SetApplicationCopyrightImage]], in screenshots. By default it&#039;s visible.&lt;br /&gt;
&lt;br /&gt;
==== QueryApplicationPlayStatistics ====&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The number of entries in each array is the same.&lt;br /&gt;
&lt;br /&gt;
See also [[NACP_Format#PlayLogQueryCapability|PlayLogQueryCapability]].&lt;br /&gt;
&lt;br /&gt;
This uses [[Shared_Database_services|pdm:qry]] QueryApplicationPlayStatisticsForSystem.&lt;br /&gt;
&lt;br /&gt;
==== QueryApplicationPlayStatisticsByUid ====&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Same as [[#QueryApplicationPlayStatistics]] except this uses [[Shared_Database_services|pdm:qry]] cmd16, to get playstats specific to userIDs. &lt;br /&gt;
&lt;br /&gt;
==== ExecuteProgram ====&lt;br /&gt;
Takes an input u32 [[#ProgramSpecifyKind]] and an input u64, no output.&lt;br /&gt;
&lt;br /&gt;
==== ClearUserChannel ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Clears the UserChannel used by [[#UnpopToUserChannel]].&lt;br /&gt;
&lt;br /&gt;
==== UnpopToUserChannel ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
The input storage is pushed to the UserChannel. This is the same channel used by [[#LaunchParameterKind]] value 1.&lt;br /&gt;
&lt;br /&gt;
User-processes create a storage using data specified by the user (written to offset=0 size=inputsize), with max size 0x1000. This storage is then used with this cmd.&lt;br /&gt;
&lt;br /&gt;
==== GetPreviousProgramIndex ====&lt;br /&gt;
No input, returns an output s32.&lt;br /&gt;
&lt;br /&gt;
Gets the ProgramIndex of the Application which launched this title. The output ProgramIndex is -1 when there was no previous title.&lt;br /&gt;
&lt;br /&gt;
==== EnableApplicationAllThreadDumpOnCrash ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== GetGpuErrorDetectedSystemEvent ====&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==== SetDelayTimeToAbortOnGpuError ====&lt;br /&gt;
Takes an input s64 &amp;quot;nn::TimeSpan&amp;quot;, no output.&lt;br /&gt;
&lt;br /&gt;
==== GetFriendInvitationStorageChannelEvent ====&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
This is exposed by sdknso under &amp;lt;code&amp;gt;nn::friends::&amp;lt;/code&amp;gt;. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.&lt;br /&gt;
&lt;br /&gt;
==== TryPopFromFriendInvitationStorageChannel ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
This uses the same StorageChannel as [[#PushToFriendInvitationStorageChannel]].&lt;br /&gt;
&lt;br /&gt;
This is exposed by sdknso under &amp;lt;code&amp;gt;nn::friends::&amp;lt;/code&amp;gt;. When the storage_size is &amp;lt;0x10, this returns false. &amp;lt;code&amp;gt;data_size = storage_size-0x10;&amp;lt;/code&amp;gt; Then the first 0x10-bytes from storage are read to stack, which is later copied to the output Uid on success prior to returning. Then the storage is read into the specified output buffer with storage-offset 0x10, where the size is &amp;lt;code&amp;gt;size = data_size &amp;gt; buf_size ? buf_size : data_size&amp;lt;/code&amp;gt;. Reading is skipped if size is zero. Afterwards the used size is written to an output param. On success, true is returned.&lt;br /&gt;
&lt;br /&gt;
==== GetNotificationStorageChannelEvent ====&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
This is exposed by sdknso under &amp;lt;code&amp;gt;nn::notification::&amp;lt;/code&amp;gt;. This returns a ptr to the cached Event in global state, with the Event being loaded if not previously initialized.&lt;br /&gt;
&lt;br /&gt;
==== TryPopFromNotificationStorageChannel ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
This uses the same StorageChannel as [[#PushToNotificationStorageChannel]].&lt;br /&gt;
&lt;br /&gt;
This is exposed by sdknso under &amp;lt;code&amp;gt;nn::notification::&amp;lt;/code&amp;gt;. The storage is read into the specified output buffer, where the size is &amp;lt;code&amp;gt;size = storage_size &amp;gt; buf_size ? buf_size : storage_size&amp;lt;/code&amp;gt;. Reading is skipped if size is zero. Afterwards the used size is written to an output param.&lt;br /&gt;
&lt;br /&gt;
==== GetHealthWarningDisappearedSystemEvent ====&lt;br /&gt;
No input, returns an output Event with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
==== SetHdcpAuthenticationActivated ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
==== GetLaunchRequiredVersion ====&lt;br /&gt;
Takes an input [[NCM_services#ApplicationId|ApplicationId]], an u64, returns an output [[#LaunchRequiredVersion]].&lt;br /&gt;
&lt;br /&gt;
sdknso passes hard-coded value 0 for the u64.&lt;br /&gt;
&lt;br /&gt;
==== UpgradeLaunchRequiredVersion ====&lt;br /&gt;
Takes an input [[#LaunchRequiredVersion]], an [[NCM_services#ApplicationId|ApplicationId]], an u64, no output.&lt;br /&gt;
&lt;br /&gt;
sdknso passes hard-coded value 0 for the u64.&lt;br /&gt;
&lt;br /&gt;
==== SendServerMaintenanceOverlayNotification ====&lt;br /&gt;
Takes two input [[PCV_services#PosixTime|PosixTime]], no output.&lt;br /&gt;
&lt;br /&gt;
The second input value can optionally be 0.&lt;br /&gt;
&lt;br /&gt;
==== GetLastApplicationExitReason ====&lt;br /&gt;
No input, returns an output s32.&lt;br /&gt;
&lt;br /&gt;
==== StartContinuousRecordingFlushForDebug ====&lt;br /&gt;
Takes an input s64 nanoseconds-value, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; must be set to 0x1 with size 0x1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
==== CreateMovieMaker ====&lt;br /&gt;
Takes an input u64 size and a TransferMemory handle, returns an [[#IMovieMaker]].&lt;br /&gt;
&lt;br /&gt;
Official sw retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first.&lt;br /&gt;
&lt;br /&gt;
Official sw uses permissions=None for the TransferMemory, with an user-specified buffer. The size of the buffer used by official sw is 0x6000000.&lt;br /&gt;
&lt;br /&gt;
==== PrepareForJit ====&lt;br /&gt;
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&amp;lt;&amp;gt; for jit-sysmodule process tracking object as an IApplicationFunctions member.&lt;br /&gt;
&lt;br /&gt;
~IApplicationFunctions() includes:&lt;br /&gt;
&lt;br /&gt;
    if (this-&amp;gt;jit_process) {&lt;br /&gt;
        Terminate(this-&amp;gt;jit_process);&lt;br /&gt;
        this-&amp;gt;jit_process = nullptr;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
AM can also optionally launch jit-sysmodule automatically if the [[NACP]] enables it.&lt;br /&gt;
&lt;br /&gt;
=== IMovieMaker ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IMovieMaker&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetGrcMovieMaker]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetLayerHandle]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GetGrcMovieMaker ====&lt;br /&gt;
No input, returns a GRC [[GRC_services|IMovieMaker]].&lt;br /&gt;
&lt;br /&gt;
==== GetLayerHandle ====&lt;br /&gt;
No input, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
== ILibraryAppletCreator ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ILibraryAppletCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateLibraryApplet]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#TerminateAllLibraryApplets]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#AreAnyLibraryAppletsLeft]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#CreateStorage]] || &lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#CreateTransferMemoryStorage]] || &lt;br /&gt;
|-&lt;br /&gt;
| 12 || [2.0.0+] [[#CreateHandleStorage]] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== CreateLibraryApplet ===&lt;br /&gt;
Takes 2 input u32s [[#AppletId]] and [[#LibraryAppletMode]], returns an [[#ILibraryAppletAccessor]].&lt;br /&gt;
&lt;br /&gt;
=== TerminateAllLibraryApplets ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.&lt;br /&gt;
&lt;br /&gt;
Terminates all LibraryApplets which were created by the current applet (or by the Application when used from the [[#IApplicationAccessor]] cmd).&lt;br /&gt;
&lt;br /&gt;
=== AreAnyLibraryAppletsLeft ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Stubbed with an ILibraryAppletCreator from [[#CreateSelfLibraryAppletCreatorForDevelop]], just returns an error.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
=== CreateStorage ===&lt;br /&gt;
Takes an input s64 for the storage size, returns an [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
This allocates a buffer with the specified size which can then be accessed via [[#IStorageAccessor]].&lt;br /&gt;
&lt;br /&gt;
=== CreateTransferMemoryStorage ===&lt;br /&gt;
Takes an input TransferMemory copy-handle, an input u8 bool, and an s64 size, returns an [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
The user-process creates the TransferMemory with permissions=0.&lt;br /&gt;
&lt;br /&gt;
The TransferMemory is mapped, which can then be accessed via [[#IStorageAccessor]]. The input bool controls whether writing to the storage is allowed: [[#Write]] will throw an error if this flag is not set.&lt;br /&gt;
&lt;br /&gt;
=== CreateHandleStorage ===&lt;br /&gt;
Takes an input copy-handle and an input s64, returns an [[#IStorage]]. In some cases the s64 must not have the negative bit set.&lt;br /&gt;
&lt;br /&gt;
The input can be arbitrary, however official sw is only (?) known to use this for TransferMemory (with s64=size).&lt;br /&gt;
&lt;br /&gt;
=== ILibraryAppletAccessor ===&lt;br /&gt;
This is &amp;quot;nn::am::service::ILibraryAppletAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetAppletStateChangedEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#IsCompleted]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#Start]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#RequestExit]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [[#Terminate]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#GetResult]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [[#SetOutOfFocusApplicationSuspendingEnabled]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [10.0.0+] [[#PresetLibraryAppletGpuTimeSliceZero]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#PushInData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#PopOutData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#PushExtraStorage]] || &lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#PushInteractiveInData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 104 || [[#PopInteractiveOutData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 105 || [[#GetPopOutDataEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 106 || [[#GetPopInteractiveOutDataEvent]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [[#NeedsToExitProcess]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [[#GetLibraryAppletInfo]] || &lt;br /&gt;
|-&lt;br /&gt;
| 150 || [[#RequestForAppletToGetForeground]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 160 || [2.0.0+] [[#GetIndirectLayerConsumerHandle]] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Commands &amp;lt;=30 are inherited from [[#IAppletAccessor]]. GetLibraryAppletInfo is identical to the [[#ILibraryAppletSelfAccessor]] cmd.&lt;br /&gt;
&lt;br /&gt;
==== SetOutOfFocusApplicationSuspendingEnabled ====&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Official sw will assert prior to using this if applet-service was not initialized as *Application.&lt;br /&gt;
&lt;br /&gt;
==== PresetLibraryAppletGpuTimeSliceZero ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
sdknso only uses with with [[Software_Keyboard|swkbd-inline]], immediately after creating the LibraryApplet.&lt;br /&gt;
&lt;br /&gt;
==== PushInData ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== PopOutData ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== PushExtraStorage ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== PushInteractiveInData ====&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
==== PopInteractiveOutData ====&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
==== GetPopOutDataEvent ====&lt;br /&gt;
No input, returns an output handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== GetPopInteractiveOutDataEvent ====&lt;br /&gt;
No input, returns an output event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
==== NeedsToExitProcess ====&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
==== RequestForAppletToGetForeground ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
==== GetIndirectLayerConsumerHandle ====&lt;br /&gt;
Takes an input PID and an input u64 AppletResourceUserId, returns an output u64 IndirectLayerConsumerHandle.&lt;br /&gt;
&lt;br /&gt;
Official sw uses this during LibraryApplet creation when [[#LibraryAppletMode]] is 0x3.&lt;br /&gt;
&lt;br /&gt;
== ICommonStateGetter ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ICommonStateGetter&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetEventHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#ReceiveMessage]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetThisAppletKind]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#AllowToEnterSleep]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#DisallowToEnterSleep]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetOperationMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#GetPerformanceMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#GetCradleStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#GetBootMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#GetCurrentFocusState]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#RequestToAcquireSleepLock]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#ReleaseSleepLock]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#ReleaseSleepLockTransiently]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#GetAcquiredSleepLockEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [11.0.0+] [[#GetWakeupCount]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#PushToGeneralChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#GetHomeButtonReaderLockAccessor]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [2.0.0+] [[#GetReaderLockAccessorEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 32 || [7.0.0+] [[#GetWriterLockAccessorEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [2.0.0+] [[#GetCradleFwVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [3.0.0+] [[#IsVrModeEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [3.0.0+] [[#SetVrModeEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 52 || [4.0.0+] [[#SetLcdBacklighOffEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 53 || [7.0.0+] [[#BeginVrModeEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 54 || [7.0.0+] [[#EndVrModeEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 55 || [3.0.0+] [[#IsInControllerFirmwareUpdateSection]]&lt;br /&gt;
|-&lt;br /&gt;
| 59 || [11.0.0+] [[#SetVrPositionForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [3.0.0+] [[#GetDefaultDisplayResolution]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || [3.0.0+] [[#GetDefaultDisplayResolutionChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 62 || [4.0.0+] [[#GetHdcpAuthenticationState]]&lt;br /&gt;
|-&lt;br /&gt;
| 63 || [4.0.0+] [[#GetHdcpAuthenticationStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [5.0.0+] [[#SetTvPowerStateMatchingMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [5.1.0+] [[#GetApplicationIdByContentActionName]]&lt;br /&gt;
|-&lt;br /&gt;
| 66 || [6.0.0+] [[#SetCpuBoostMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 67 || [10.0.0+] [[#CancelCpuBoostMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 68 || [11.0.0+] [[#GetBuiltInDisplayType]]&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [6.0.0+] [[#PerformSystemButtonPressingIfInFocus]]&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [7.0.0+] [[#SetPerformanceConfigurationChangedNotification]]&lt;br /&gt;
|-&lt;br /&gt;
| 91 || [7.0.0+] [[#GetCurrentPerformanceConfiguration]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [9.1.0+] [[#SetHandlingHomeButtonShortPressedEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [11.0.0+] [[#OpenMyGpuErrorHandler]]&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [13.0.0+] GetAppletLaunchedHistory&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [7.0.0+] [[#GetOperationModeSystemInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [9.0.0+] [[#GetSettingsPlatformRegion]]&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [10.0.0+] [[#ActivateMigrationService]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [10.0.0+] [[#DeactivateMigrationService]]&lt;br /&gt;
|-&lt;br /&gt;
| 500 || [11.0.0+] [[#DisableSleepTillShutdown]]&lt;br /&gt;
|-&lt;br /&gt;
| 501 || [11.0.0+] [[#SuppressDisablingSleepTemporarily]]&lt;br /&gt;
|-&lt;br /&gt;
| 502 || [12.0.0+] IsSleepEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 503 || [12.0.0+] IsDisablingSleepSuppressed&lt;br /&gt;
|-&lt;br /&gt;
| 900 || [11.0.0+] [[#SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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]]).&lt;br /&gt;
&lt;br /&gt;
[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.&lt;br /&gt;
&lt;br /&gt;
=== GetEventHandle ===&lt;br /&gt;
No input. Returns an output event handle. This is signalled when a message is available with [[#ReceiveMessage]].&lt;br /&gt;
&lt;br /&gt;
=== ReceiveMessage ===&lt;br /&gt;
No input. Returns an output [[#AppletMessage]]. Error 0x680 indicates no message is available.&lt;br /&gt;
&lt;br /&gt;
=== GetThisAppletKind ===&lt;br /&gt;
No input, returns an output [[#AppletKind]].&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== AllowToEnterSleep ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== DisallowToEnterSleep ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== GetOperationMode ===&lt;br /&gt;
No input. Returns an output u8 for the current [[#OperationMode]].&lt;br /&gt;
&lt;br /&gt;
=== GetPerformanceMode ===&lt;br /&gt;
No input. Returns an output u32 for the current [[#PerformanceMode]].&lt;br /&gt;
&lt;br /&gt;
=== GetCradleStatus ===&lt;br /&gt;
No input, returns an output u8.&lt;br /&gt;
&lt;br /&gt;
This uses [[#omm]] GetCradleStatus.&lt;br /&gt;
&lt;br /&gt;
=== GetBootMode ===&lt;br /&gt;
No input, returns an output u8.&lt;br /&gt;
&lt;br /&gt;
Returns the value from [[Process_Manager_services|pm:bm]] GetBootMode.&lt;br /&gt;
&lt;br /&gt;
=== GetCurrentFocusState ===&lt;br /&gt;
No input. Returns an output u8 [[#FocusState]].&lt;br /&gt;
&lt;br /&gt;
=== RequestToAcquireSleepLock ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseSleepLock ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseSleepLockTransiently ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== GetAcquiredSleepLockEvent ===&lt;br /&gt;
No input, returns an output Event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
=== GetWakeupCount ===&lt;br /&gt;
No input, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
=== PushToGeneralChannel ===&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
This is not usable under an Application, however it is usable under a LibraryApplet.&lt;br /&gt;
&lt;br /&gt;
Used for sending requests to [[qlaunch]]. sdk-nso creates a 0x10-byte storage which is sent to this. The following are the functions which use this, with the data written to the storage:&lt;br /&gt;
* &amp;lt;code&amp;gt;RequestHomeMenu&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;5341 4d53 0100 0000 0200 0000 0100 0000&amp;lt;/code&amp;gt; Returns to the main Home Menu, equivalent to pressing the HOME button.&lt;br /&gt;
* &amp;lt;code&amp;gt;RequestJumpToSystemUpdate&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;5341 4d53 0100 0000 0b00 0000 0100 0000&amp;lt;/code&amp;gt; Equivalent to entering &amp;quot;System Update&amp;quot; under System Settings. When leaving this, it returns to the main Home Menu.&lt;br /&gt;
&lt;br /&gt;
=== GetHomeButtonReaderLockAccessor ===&lt;br /&gt;
No input, returns an output [[#ILockAccessor]].&lt;br /&gt;
&lt;br /&gt;
Similar to using [[#GetReaderLockAccessorEx]] with inval=0.&lt;br /&gt;
&lt;br /&gt;
=== GetReaderLockAccessorEx ===&lt;br /&gt;
Takes an input u32, returns an output [[#ILockAccessor]].&lt;br /&gt;
&lt;br /&gt;
The input value must be 0-3. 0 = HomeButton.&lt;br /&gt;
&lt;br /&gt;
=== GetWriterLockAccessorEx ===&lt;br /&gt;
Takes an input u32, returns an output [[#ILockAccessor]].&lt;br /&gt;
&lt;br /&gt;
The input value must be 0-3. 0 = HomeButton.&lt;br /&gt;
&lt;br /&gt;
=== GetCradleFwVersion ===&lt;br /&gt;
No input, returns 4 output u32s.&lt;br /&gt;
&lt;br /&gt;
This uses [[#omm]] GetCradleFwVersion.&lt;br /&gt;
&lt;br /&gt;
=== IsVrModeEnabled ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== SetVrModeEnabled ===&lt;br /&gt;
Takes an input u8 bool flag. No output.&lt;br /&gt;
&lt;br /&gt;
Updates internal AM state fields. If the new state doesn&#039;t match the previous state, this uses the [[Backlight_services]] {Disable/Enable}VrMode command depending on whether flag={disable/enable}.&lt;br /&gt;
&lt;br /&gt;
When the VrMode is set to true, the console shows a screen rendered like vr asking the user to move his face away and hit the &#039;close&#039; button. When this button is pressed, the console resets the vrMode to false.&lt;br /&gt;
&lt;br /&gt;
=== SetLcdBacklighOffEnabled ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Sets whether the LCD screen blacklight is turned off.&lt;br /&gt;
&lt;br /&gt;
=== BeginVrModeEx ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=1.&lt;br /&gt;
&lt;br /&gt;
=== EndVrModeEx ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Identical to [[#SetVrModeEnabled]] except with hard-coded flag=0.&lt;br /&gt;
&lt;br /&gt;
=== IsInControllerFirmwareUpdateSection ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== SetVrPositionForDebug ===&lt;br /&gt;
Takes 4 input s32s, no output.&lt;br /&gt;
&lt;br /&gt;
The s32s are: x, y, width, height.&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
width must be 1-1280, height must be 1-720.&lt;br /&gt;
&lt;br /&gt;
x and y must not be negative. x+width must be &amp;lt;=1280. y+height must be &amp;lt;=720.&lt;br /&gt;
&lt;br /&gt;
=== GetDefaultDisplayResolution ===&lt;br /&gt;
No input, returns two output s32s &#039;&#039;&#039;width&#039;&#039;&#039; and &#039;&#039;&#039;height&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== GetDefaultDisplayResolutionChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle with autoclear=true.&lt;br /&gt;
&lt;br /&gt;
=== GetHdcpAuthenticationState ===&lt;br /&gt;
No input, returns an output s32.&lt;br /&gt;
&lt;br /&gt;
=== GetHdcpAuthenticationStateChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle with autoclear=true.&lt;br /&gt;
&lt;br /&gt;
=== SetTvPowerStateMatchingMode ===&lt;br /&gt;
Takes an input s32 [[#TvPowerStateMatchingMode]], no output.&lt;br /&gt;
&lt;br /&gt;
=== GetApplicationIdByContentActionName ===&lt;br /&gt;
Takes a type-0x5 input buffer containing a string, returns an output [[NCM_services#ApplicationId|ApplicationId]].&lt;br /&gt;
&lt;br /&gt;
Gets the ApplicationId for the specified ContentActionName string. Returns an error when the current [[#AppletId]] isn&#039;t 0x04 (when the current applet isn&#039;t a SystemApplication).&lt;br /&gt;
&lt;br /&gt;
=== SetCpuBoostMode ===&lt;br /&gt;
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].&lt;br /&gt;
&lt;br /&gt;
=== CancelCpuBoostMode ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== GetBuiltInDisplayType ===&lt;br /&gt;
No input, returns an output s32.&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
This loads a s32 index from global state (originates from [[SPL_services#GetConfig|GetConfig]] [[SMC#HardwareType|HardwareType]]), Aborts if it&#039;s out-of-bounds, then the following is returned for the output s32: global_array[loaded_index].&lt;br /&gt;
&lt;br /&gt;
=== PerformSystemButtonPressingIfInFocus ===&lt;br /&gt;
Takes an input [[#SystemButtonType]], no output.&lt;br /&gt;
&lt;br /&gt;
Just returns 0 when a state field is not value 1. Verifies that the input button is allowed, then calls the same func as [[#PerformSystemButtonPressing]] internally.&lt;br /&gt;
&lt;br /&gt;
=== SetPerformanceConfigurationChangedNotification ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== GetCurrentPerformanceConfiguration ===&lt;br /&gt;
No input, returns the result of calling [[PPC_services#apm:sys|GetCurrentPerformanceConfiguration]].&lt;br /&gt;
&lt;br /&gt;
=== OpenMyGpuErrorHandler ===&lt;br /&gt;
No input, returns an [[#IGpuErrorHandler]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
=== GetOperationModeSystemInfo ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
This returns the output from [[#GetOperationModeSystemInfo_2|omm GetOperationModeSystemInfo]].&lt;br /&gt;
&lt;br /&gt;
=== GetSettingsPlatformRegion ===&lt;br /&gt;
No input, returns an output u8.&lt;br /&gt;
&lt;br /&gt;
This just returns the output from [[Settings_services#GetPlatformRegion|setsys GetPlatformRegion]].&lt;br /&gt;
&lt;br /&gt;
=== ActivateMigrationService ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Besides various other functionality, if required this eventually uses [[NS_Services|ns]] LaunchLibraryApplet to launch [[Migration_services|migration]].&lt;br /&gt;
&lt;br /&gt;
=== DeactivateMigrationService ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== DisableSleepTillShutdown ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== SuppressDisablingSleepTemporarily ===&lt;br /&gt;
Takes an input u64 &amp;quot;nn::TimeSpanType&amp;quot;, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== IGpuErrorHandler ===&lt;br /&gt;
This is &amp;quot;nn::am::service::IGpuErrorHandler&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [11.0.0+].&lt;br /&gt;
&lt;br /&gt;
This uses various [[NV_services#nvgem:cd|nvgem:cd]] commands.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#GetManualGpuErrorInfoSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#GetManualGpuErrorInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#GetManualGpuErrorDetectionSystemEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#FinishManualGpuErrorHandling]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GetManualGpuErrorInfoSize ====&lt;br /&gt;
No input, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
==== GetManualGpuErrorInfo ====&lt;br /&gt;
Takes a type-0x6 output buffer, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
The OutBuffer_size must be &amp;gt;= the output size from [[#GetManualGpuErrorInfoSize]].&lt;br /&gt;
&lt;br /&gt;
sdknso exposes the buffer as &amp;lt;code&amp;gt;void*&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== GetManualGpuErrorDetectionSystemEvent ====&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
==== FinishManualGpuErrorHandling ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
== ISelfController ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ISelfController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Exit]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#LockExit]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#UnlockExit]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] [[#EnterFatalSection]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [2.0.0+] [[#LeaveFatalSection]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#GetLibraryAppletLaunchableEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#SetScreenShotPermission]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#SetOperationModeChangedNotification]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#SetPerformanceModeChangedNotification]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#SetFocusHandlingMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#SetRestartMessageEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [2.0.0+] [[#SetScreenShotAppletIdentityInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [2.0.0+] [[#SetOutOfFocusSuspendingEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [3.0.0+] [[#SetControllerFirmwareUpdateSection]]&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [3.0.0+] [[#SetRequiresCaptureButtonShortPressedMessage]]&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [3.0.0+] [[#SetAlbumImageOrientation]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [4.0.0+] [[#SetDesirableKeyboardLayout]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [13.0.0+] GetScreenShotProgramId&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [[#CreateManagedDisplayLayer]]&lt;br /&gt;
|-&lt;br /&gt;
| 41 || [4.0.0+] [[#IsSystemBufferSharingEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 42 || [4.0.0+] [[#GetSystemSharedLayerHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 43 || [5.0.0+] [[#GetSystemSharedBufferHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 44 || [10.0.0+] [[#CreateManagedDisplaySeparableLayer]]&lt;br /&gt;
|-&lt;br /&gt;
| 45 || [10.0.0+] [[#SetManagedDisplayLayerSeparationMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 46 || [13.0.0+] [[#SetRecordingLayerCompositionEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [[#SetHandlesRequestToDisplay]]&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [[#ApproveToDisplay]]&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#OverrideAutoSleepTimeAndDimmingTime]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || [[#SetMediaPlaybackState]]&lt;br /&gt;
|-&lt;br /&gt;
| 62 || [[#SetIdleTimeDetectionExtension]]&lt;br /&gt;
|-&lt;br /&gt;
| 63 || [[#GetIdleTimeDetectionExtension]]&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [[#SetInputDetectionSourceSet]]&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [2.0.0+] [[#ReportUserIsActive]]&lt;br /&gt;
|-&lt;br /&gt;
| 66 || [3.0.0+] [[#GetCurrentIlluminance]]&lt;br /&gt;
|-&lt;br /&gt;
| 67 || [3.0.0+] [[#IsIlluminanceAvailable]]&lt;br /&gt;
|-&lt;br /&gt;
| 68 || [5.0.0+] [[#SetAutoSleepDisabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 69 || [5.0.0+] [[#IsAutoSleepDisabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 70 || [4.0.0+] [[#ReportMultimediaError]]&lt;br /&gt;
|-&lt;br /&gt;
| 71 || [5.0.0+] [[#GetCurrentIlluminanceEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 72 || [9.0.0+] [[#SetInputDetectionPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [4.0.0+] [[#SetWirelessPriorityMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [6.0.0+] [[#GetAccumulatedSuspendedTickValue]]&lt;br /&gt;
|-&lt;br /&gt;
| 91 || [6.0.0+] [[#GetAccumulatedSuspendedTickChangedEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [7.0.0+] [[#SetAlbumImageTakenNotificationEnabled]]&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [8.0.0+] [[#SetApplicationAlbumUserData]]&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [11.0.0+] [[#SaveCurrentScreenshot]]&lt;br /&gt;
|-&lt;br /&gt;
| 130 || [13.0.0+] [[#SetRecordVolumeMuted]]&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Exit ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Exits the current applet. On success, official sw will enter an infinite loop with sleep-thread value 86400000000000.&lt;br /&gt;
&lt;br /&gt;
=== LockExit ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Locks exit process of pressing X to close in HOME Menu for an application or HOME button for an applet. When locked, it will show the &amp;quot;waiting for software to be closed dialog&amp;quot; until UnlockExit is called or a 15 seconds timeout (when the latter occurs, the process is force-terminated).&lt;br /&gt;
&lt;br /&gt;
=== UnlockExit ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Unlocks exit process, if LockExit was previously used.&lt;br /&gt;
&lt;br /&gt;
=== EnterFatalSection ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== LeaveFatalSection ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#EnterFatalSection]] must be executed at least once before executing this command, otherwise error code 0x40080 will be returned. EnterFatalSection and LeaveFatalSection work in pairs, that is, N calls to EnterFatalSection must be performed first in order to perform N executions of LeaveFatalSection. Essentially, these two functions operate like how one would lock and unlock a recursive mutex.&lt;br /&gt;
&lt;br /&gt;
=== GetLibraryAppletLaunchableEvent ===&lt;br /&gt;
No input, returns an output event handle with autoclear=false.&lt;br /&gt;
&lt;br /&gt;
=== SetScreenShotPermission ===&lt;br /&gt;
Takes an input s32. No output.&lt;br /&gt;
&lt;br /&gt;
Controls whether screenshot-capture is allowed.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Inherit from parent applet&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Enable&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Disable&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SetOperationModeChangedNotification ===&lt;br /&gt;
Takes an input u8 bool flag. No output.&lt;br /&gt;
&lt;br /&gt;
=== SetPerformanceModeChangedNotification ===&lt;br /&gt;
Takes an input u8 bool flag. No output.&lt;br /&gt;
&lt;br /&gt;
=== SetFocusHandlingMode ===&lt;br /&gt;
Takes 3 input u8s with each field located immediately after the previous u8, these are bool flags. No output.&lt;br /&gt;
&lt;br /&gt;
=== SetRestartMessageEnabled ===&lt;br /&gt;
Takes an input u8 bool flag, no output.&lt;br /&gt;
&lt;br /&gt;
See [[#AppletMessage]].&lt;br /&gt;
&lt;br /&gt;
=== SetScreenShotAppletIdentityInfo ===&lt;br /&gt;
Takes an input [[#AppletIdentityInfo]], no output.&lt;br /&gt;
&lt;br /&gt;
=== SetOutOfFocusSuspendingEnabled ===&lt;br /&gt;
Takes an input u8 bool flag. No output.&lt;br /&gt;
&lt;br /&gt;
=== SetControllerFirmwareUpdateSection ===&lt;br /&gt;
Takes an input u8 bool flag, no output.&lt;br /&gt;
&lt;br /&gt;
This throws error 0x40280 when the internal state flag already matches the input value.&lt;br /&gt;
&lt;br /&gt;
=== SetRequiresCaptureButtonShortPressedMessage ===&lt;br /&gt;
Takes an input u8 bool flag, no output.&lt;br /&gt;
&lt;br /&gt;
See [[#AppletMessage]].&lt;br /&gt;
&lt;br /&gt;
When enabled with a non-Overlay applet, Overlay applet will not be notified of capture button short-presses for screenshots.&lt;br /&gt;
&lt;br /&gt;
=== SetAlbumImageOrientation ===&lt;br /&gt;
Takes an input u32 &amp;quot;nn::album::ImageOrientation&amp;quot;. No output.&lt;br /&gt;
&lt;br /&gt;
The input value must not be &amp;gt;3.&lt;br /&gt;
&lt;br /&gt;
=== SetDesirableKeyboardLayout ===&lt;br /&gt;
Takes an input u32, no output.&lt;br /&gt;
&lt;br /&gt;
The input u32 is &amp;quot;nn::settings::KeyboardLayout&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== CreateManagedDisplayLayer ===&lt;br /&gt;
Returns an output u64 LayerId which is then used by the user-process with [[Display_services#OpenLayer]].&lt;br /&gt;
&lt;br /&gt;
=== IsSystemBufferSharingEnabled ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Not available when the current applet is an Application ([[#AppletId]] == 0x01).&lt;br /&gt;
&lt;br /&gt;
Checks whether SystemBufferSharing is enabled, throwing an error otherwise.&lt;br /&gt;
&lt;br /&gt;
=== GetSystemSharedLayerHandle ===&lt;br /&gt;
No input, returns two output u64s &amp;quot;nn::vi::fbshare::SharedBufferHandle&amp;quot; and &amp;quot;nn::vi::fbshare::SharedLayerHandle&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.&lt;br /&gt;
&lt;br /&gt;
=== GetSystemSharedBufferHandle ===&lt;br /&gt;
No input, returns an output u64 &amp;quot;nn::vi::fbshare::SharedBufferHandle&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Runs code similar to [[#IsSystemBufferSharingEnabled]] first.&lt;br /&gt;
&lt;br /&gt;
Same as [[#GetSystemSharedLayerHandle]] except this just gets the SharedBufferHandle.&lt;br /&gt;
&lt;br /&gt;
=== CreateManagedDisplaySeparableLayer ===&lt;br /&gt;
No input, returns two output u64 LayerIds.&lt;br /&gt;
&lt;br /&gt;
sdknso now uses this instead of [[#CreateManagedDisplayLayer]]. sdknso caches the output from the cmd so that it&#039;s only used once. The first u64 is used the same as the original LayerId from [[#CreateManagedDisplayLayer]]. &amp;lt;code&amp;gt;nn::vi::CreateRecordingLayer&amp;lt;/code&amp;gt; uses the second LayerId, the layer creation is identical besides which LayerId is used.&lt;br /&gt;
&lt;br /&gt;
=== SetManagedDisplayLayerSeparationMode ===&lt;br /&gt;
Takes an input u32, no output.&lt;br /&gt;
&lt;br /&gt;
sdknso exposes this as &amp;lt;code&amp;gt;nn::vi::SetRecordingLayerEnabled(bool)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The input u32 must be 0-1.&lt;br /&gt;
&lt;br /&gt;
=== SetRecordingLayerCompositionEnabled ===&lt;br /&gt;
Takes an input bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetHandlesRequestToDisplay ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
Sets an internal state flag. When the input flag is 0, this will in additional run the same code as [[#ApproveToDisplay]].&lt;br /&gt;
&lt;br /&gt;
See [[#AppletMessage]].&lt;br /&gt;
&lt;br /&gt;
=== ApproveToDisplay ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Used to handle the notification enabled by [[#SetHandlesRequestToDisplay]].&lt;br /&gt;
&lt;br /&gt;
=== OverrideAutoSleepTimeAndDimmingTime ===&lt;br /&gt;
Takes 4 input s32s, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetMediaPlaybackState ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetIdleTimeDetectionExtension ===&lt;br /&gt;
Takes an input u32, no output.&lt;br /&gt;
&lt;br /&gt;
The input value must be 0-2: 0 = disabled, 1 = Extended, and 2 = ExtendedUnsafe.&lt;br /&gt;
&lt;br /&gt;
=== GetIdleTimeDetectionExtension ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
Returns the value set by [[#SetIdleTimeDetectionExtension]].&lt;br /&gt;
&lt;br /&gt;
=== SetInputDetectionSourceSet ===&lt;br /&gt;
Takes an input u32, no output.&lt;br /&gt;
&lt;br /&gt;
=== ReportUserIsActive ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Uses idle:sys ReportUserIsActive.&lt;br /&gt;
&lt;br /&gt;
Reports that the user is active, for idle detection (screen dimming / auto-sleep). This is equivalent to when the user uses HID input.&lt;br /&gt;
&lt;br /&gt;
=== GetCurrentIlluminance ===&lt;br /&gt;
No input, returns an output float.&lt;br /&gt;
&lt;br /&gt;
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue, where only the output float is used.&lt;br /&gt;
&lt;br /&gt;
=== IsIlluminanceAvailable ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Uses [[Backlight_services|lbl]] command IsAmbientLightSensorAvailable.&lt;br /&gt;
&lt;br /&gt;
User-processes can use this to determine whether to continue with using GetCurrentIlluminance(Ex).&lt;br /&gt;
&lt;br /&gt;
=== SetAutoSleepDisabled ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== IsAutoSleepDisabled ===&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
=== ReportMultimediaError ===&lt;br /&gt;
Takes an input Result and a type-0x5 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer contains a 0x138-byte &amp;quot;movie::MultimediaTelemetryReport&amp;quot; struct.&lt;br /&gt;
&lt;br /&gt;
=== GetCurrentIlluminanceEx ===&lt;br /&gt;
No input, returns an output u8 bool and float.&lt;br /&gt;
&lt;br /&gt;
Uses [[Backlight_services|lbl]] command GetAmbientLightSensorValue.&lt;br /&gt;
&lt;br /&gt;
=== SetInputDetectionPolicy ===&lt;br /&gt;
Takes an input [[#InputDetectionPolicy]], no output.&lt;br /&gt;
&lt;br /&gt;
=== SetWirelessPriorityMode ===&lt;br /&gt;
Takes an input s32 [[#WirelessPriorityMode]], no output.&lt;br /&gt;
&lt;br /&gt;
=== GetAccumulatedSuspendedTickValue ===&lt;br /&gt;
No input, returns an output u64 tick value.&lt;br /&gt;
&lt;br /&gt;
Gets the total time in ticks that the process was suspended, relative to when the applet-service was last initialized.&lt;br /&gt;
&lt;br /&gt;
=== GetAccumulatedSuspendedTickChangedEvent ===&lt;br /&gt;
No input, returns an output Event handle with autoclear=true.&lt;br /&gt;
&lt;br /&gt;
This is signaled when the output from [[#GetAccumulatedSuspendedTickValue]] is updated.&lt;br /&gt;
&lt;br /&gt;
=== SetAlbumImageTakenNotificationEnabled ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
See [[#AppletMessage]].&lt;br /&gt;
&lt;br /&gt;
=== SetApplicationAlbumUserData ===&lt;br /&gt;
Takes a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer contains arbitrary UserData.&lt;br /&gt;
&lt;br /&gt;
The size must be &amp;lt;=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.&lt;br /&gt;
&lt;br /&gt;
=== SaveCurrentScreenshot ===&lt;br /&gt;
Takes an input s32 [[Capture_services#AlbumReportOption|AlbumReportOption]], no output.&lt;br /&gt;
&lt;br /&gt;
sdknso exposes this under &amp;quot;nn::album::&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== SetRecordVolumeMuted ===&lt;br /&gt;
Takes an input bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== GetDebugStorageChannel ===&lt;br /&gt;
No input, returns an output [[#IStorageChannel]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[System_Settings|system-setting]] &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; must be set to 0x1 with size 0x1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
== IStorageChannel ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IStorageChannel&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [7.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Push || No input, returns an output [[#IStorage]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Unpop || No input, returns an output [[#IStorage]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Pop || No input, returns an output [[#IStorage]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetPopEventHandle || No input, returns an output handle.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Clear || No input/output.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== IWindowController ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IWindowController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateWindow]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetAppletResourceUserId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [6.0.0+] [[#GetAppletResourceUserIdOfCallerApplet]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#AcquireForegroundRights]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#ReleaseForegroundRights]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#RejectToChangeIntoBackground]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [7.0.0+] [[#SetAppletWindowVisibility]] || &lt;br /&gt;
|-&lt;br /&gt;
| 21 || [7.0.0+] [[#SetAppletGpuTimeSlice]] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== CreateWindow ===&lt;br /&gt;
Takes an input u32, returns an output [[#IWindow]].&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== GetAppletResourceUserId ===&lt;br /&gt;
No input, returns an output u64 [[#AppletResourceUserId]].&lt;br /&gt;
&lt;br /&gt;
=== GetAppletResourceUserIdOfCallerApplet ===&lt;br /&gt;
No input, returns an output u64 [[#AppletResourceUserId]].&lt;br /&gt;
&lt;br /&gt;
=== AcquireForegroundRights ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseForegroundRights ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== RejectToChangeIntoBackground ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== SetAppletWindowVisibility ===&lt;br /&gt;
Takes an input u8 bool, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetAppletGpuTimeSlice ===&lt;br /&gt;
Takes an input s64, no output.&lt;br /&gt;
&lt;br /&gt;
The input s64 must not be negative.&lt;br /&gt;
&lt;br /&gt;
== IAudioController ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IAudioController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#SetExpectedMasterVolume]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetMainAppletExpectedMasterVolume]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetLibraryAppletExpectedMasterVolume]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#ChangeMainAppletMasterVolume]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#SetTransparentVolumeRate]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
GetMainAppletExpectedMasterVolume/SetExpectedMasterVolume are used for saving/restoring state for LibraryApplet launching, with SetExpectedMasterVolume being used with new state prior to launching a LibraryApplet. With official sw these applet funcs are used directly in the main-codebin.&lt;br /&gt;
&lt;br /&gt;
=== SetExpectedMasterVolume ===&lt;br /&gt;
Takes two input floats, no output.&lt;br /&gt;
&lt;br /&gt;
Writes the input floats to state: first one is used by [[#GetMainAppletExpectedMasterVolume]], second one is used by [[#GetLibraryAppletExpectedMasterVolume]].&lt;br /&gt;
&lt;br /&gt;
=== GetMainAppletExpectedMasterVolume ===&lt;br /&gt;
No input, returns an output float.&lt;br /&gt;
&lt;br /&gt;
=== GetLibraryAppletExpectedMasterVolume ===&lt;br /&gt;
No input, returns an output float.&lt;br /&gt;
&lt;br /&gt;
=== ChangeMainAppletMasterVolume ===&lt;br /&gt;
Takes an input float and an input u64, no output.&lt;br /&gt;
&lt;br /&gt;
=== SetTransparentVolumeRate ===&lt;br /&gt;
Takes an input float, no output.&lt;br /&gt;
&lt;br /&gt;
== IDisplayController ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IDisplayController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetLastForegroundCaptureImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#UpdateLastForegroundCaptureImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetLastApplicationCaptureImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetCallerAppletCaptureImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#UpdateCallerAppletCaptureImage]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetLastForegroundCaptureImageEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#GetLastApplicationCaptureImageEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#GetCallerAppletCaptureImageEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [2.0.0+] [[#TakeScreenShotOfOwnLayer]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [5.0.0+] [[#CopyBetweenCaptureBuffers]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#AcquireLastApplicationCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#ReleaseLastApplicationCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#AcquireLastForegroundCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#ReleaseLastForegroundCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#AcquireCallerAppletCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [[#ReleaseCallerAppletCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#AcquireLastApplicationCaptureBufferEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [[#AcquireLastForegroundCaptureBufferEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [[#AcquireCallerAppletCaptureBufferEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [3.0.0+] [[#ClearCaptureBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [3.0.0+] [[#ClearAppletTransitionBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [4.0.0+] [[#AcquireLastApplicationCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [4.0.0+] [[#ReleaseLastApplicationCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [4.0.0+] [[#AcquireLastForegroundCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] [[#ReleaseLastForegroundCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 26 || [4.0.0+] [[#AcquireCallerAppletCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 27 || [4.0.0+] [[#ReleaseCallerAppletCaptureSharedBuffer]]&lt;br /&gt;
|-&lt;br /&gt;
| 28 || [6.0.0+] [[#TakeScreenShotOfOwnLayerEx]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetLastForegroundCaptureImage ===&lt;br /&gt;
Takes a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== UpdateLastForegroundCaptureImage ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== GetLastApplicationCaptureImage ===&lt;br /&gt;
Takes a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== GetCallerAppletCaptureImage ===&lt;br /&gt;
Takes a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== UpdateCallerAppletCaptureImage ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#UpdateLastForegroundCaptureImage]], except this passes param value 2 instead of 1.&lt;br /&gt;
&lt;br /&gt;
=== GetLastForegroundCaptureImageEx ===&lt;br /&gt;
Takes a type-0x6 output buffer, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
The buffer size must match 0x384000.&lt;br /&gt;
&lt;br /&gt;
=== GetLastApplicationCaptureImageEx ===&lt;br /&gt;
Takes a type-0x6 output buffer, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
The buffer size must match 0x384000.&lt;br /&gt;
&lt;br /&gt;
Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 0 instead of 1.&lt;br /&gt;
&lt;br /&gt;
=== GetCallerAppletCaptureImageEx ===&lt;br /&gt;
Takes a type-0x6 output buffer, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
The buffer size must match 0x384000.&lt;br /&gt;
&lt;br /&gt;
Calls the same internal func as [[#GetLastForegroundCaptureImageEx]], except that the last param is set to value 2 instead of 1.&lt;br /&gt;
&lt;br /&gt;
=== TakeScreenShotOfOwnLayer ===&lt;br /&gt;
Takes an input u8 bool and a s32, no output.&lt;br /&gt;
&lt;br /&gt;
=== CopyBetweenCaptureBuffers ===&lt;br /&gt;
Takes two input s32s, no output.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastApplicationCaptureBuffer ===&lt;br /&gt;
No input, returns an output handle.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseLastApplicationCaptureBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Clears a state field if it&#039;s not already 0, returning an error otherwise. On newer sysvers: then a func is called which just returns 0, then this cmd returns 0.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastForegroundCaptureBuffer ===&lt;br /&gt;
No input, returns an output handle.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseLastForegroundCaptureBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.&lt;br /&gt;
&lt;br /&gt;
=== AcquireCallerAppletCaptureBuffer ===&lt;br /&gt;
No input, returns an output handle.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseCallerAppletCaptureBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#ReleaseLastApplicationCaptureBuffer]] except with a different state field + different input param for the called func.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastApplicationCaptureBufferEx ===&lt;br /&gt;
No input, returns an output TransferMemory handle and an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
The state field used by [[#ReleaseLastApplicationCaptureBuffer]] must be 0. Calls a func which just returns an error (this is only the case on newer sysvers), hence this cmd will just return that error. If that func would have returned successfully, the state field would be set to 1 and the cmd would return 0.&lt;br /&gt;
&lt;br /&gt;
On old sysvers, the output TransferMemory is size 0x384000 with permissions=RW.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastForegroundCaptureBufferEx ===&lt;br /&gt;
No input, returns an output TransferMemory handle and an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseLastForegroundCaptureBuffer]] state field, and uses a different input param value for the called func.&lt;br /&gt;
&lt;br /&gt;
=== AcquireCallerAppletCaptureBufferEx ===&lt;br /&gt;
No input, returns an output TransferMemory handle and an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
Same as [[#AcquireLastApplicationCaptureBufferEx]] except this uses the [[#ReleaseCallerAppletCaptureBuffer]] state field, and uses a different input param value for the called func.&lt;br /&gt;
&lt;br /&gt;
=== ClearCaptureBuffer ===&lt;br /&gt;
Takes an input u8 bool, a s32 CaptureSharedBuffer, and an u32 color, returns no output.&lt;br /&gt;
&lt;br /&gt;
Clear the input CaptureSharedBuffer with the specified RGBA8 color.&lt;br /&gt;
&lt;br /&gt;
=== ClearAppletTransitionBuffer ===&lt;br /&gt;
Takes an input u32, no output.&lt;br /&gt;
&lt;br /&gt;
Clear the AppletTransitionBuffer with the specified RGBA8 color.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastApplicationCaptureSharedBuffer ===&lt;br /&gt;
No input, returns an output u8 bool and an s32.&lt;br /&gt;
&lt;br /&gt;
This loads data from state.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseLastApplicationCaptureSharedBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Depending on whether a state field is 0, this just returns an error or returns 0.&lt;br /&gt;
&lt;br /&gt;
=== AcquireLastForegroundCaptureSharedBuffer ===&lt;br /&gt;
No input, returns an output u8 bool and an s32.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseLastForegroundCaptureSharedBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 1 for the last param instead of 0.&lt;br /&gt;
&lt;br /&gt;
=== AcquireCallerAppletCaptureSharedBuffer ===&lt;br /&gt;
No input, returns an output u8 bool and an s32.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#AcquireLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.&lt;br /&gt;
&lt;br /&gt;
=== ReleaseCallerAppletCaptureSharedBuffer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#ReleaseLastApplicationCaptureSharedBuffer]], except this passes value 2 for the last param instead of 0.&lt;br /&gt;
&lt;br /&gt;
=== TakeScreenShotOfOwnLayerEx ===&lt;br /&gt;
Takes two input u8 bools and a s32, no output.&lt;br /&gt;
&lt;br /&gt;
Calls the same func internally as [[#TakeScreenShotOfOwnLayer]], except the last bool param is the last cmd param bool instead of hard-coded 0. This flag indicates whether the screenshot should be taken Immediately.&lt;br /&gt;
&lt;br /&gt;
== ISystemAppletControllerForDebug ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ISystemAppletControllerForDebug&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RequestLaunchApplicationForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [7.0.0+] [[#GetDebugStorageChannel]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [7.0.0+] [[#CreateStorageForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [12.0.0+] [[#CreateCradleFirmwareUpdaterForDebug]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetDebugStorageChannel ===&lt;br /&gt;
No input. Returns an output [[#IStorageChannel]].&lt;br /&gt;
&lt;br /&gt;
=== CreateStorageForDebug ===&lt;br /&gt;
Takes a total of 8-bytes of input. Returns an [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
=== CreateCradleFirmwareUpdaterForDebug ===&lt;br /&gt;
No input. Returns an [[#ICradleFirmwareUpdater]].&lt;br /&gt;
&lt;br /&gt;
== IProcessWindingController ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IProcessWindingController&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetLaunchReason]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#OpenCallingLibraryApplet]] || &lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#PushContext]] || &lt;br /&gt;
|-&lt;br /&gt;
| 22 || [[#PopContext]] || &lt;br /&gt;
|-&lt;br /&gt;
| 23 || [[#CancelWindingReservation]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#WindAndDoReserved]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [[#ReserveToStartAndWaitAndUnwindThis]] || &lt;br /&gt;
|-&lt;br /&gt;
| 41 || [4.0.0+] [[#ReserveToStartAndWait]] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetLaunchReason ===&lt;br /&gt;
No input, returns an output [[#AppletProcessLaunchReason]].&lt;br /&gt;
&lt;br /&gt;
Used by LibraryApplets.&lt;br /&gt;
&lt;br /&gt;
=== OpenCallingLibraryApplet ===&lt;br /&gt;
No input, returns an output [[#ILibraryAppletAccessor]].&lt;br /&gt;
&lt;br /&gt;
The objptr from state is cleared during this, an error is thrown if it&#039;s already 0.&lt;br /&gt;
&lt;br /&gt;
=== PushContext ===&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
=== PopContext ===&lt;br /&gt;
No input, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
=== CancelWindingReservation ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== WindAndDoReserved ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== ReserveToStartAndWaitAndUnwindThis ===&lt;br /&gt;
Takes an input [[#ILibraryAppletAccessor]], no output.&lt;br /&gt;
&lt;br /&gt;
=== ReserveToStartAndWait ===&lt;br /&gt;
Takes an input [[#ILibraryAppletAccessor]], no output.&lt;br /&gt;
&lt;br /&gt;
== IDebugFunctions ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IDebugFunctions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#NotifyMessageToHomeMenuForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [1.0.0-9.2.0] [[#OpenMainApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#PerformSystemButtonPressing]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#InvalidateTransitionLayer]]&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [6.0.0+] [[#RequestLaunchApplicationWithUserAndArgumentForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [12.0.0+] RequestLaunchApplicationByApplicationLaunchInfoForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 40 || [6.0.0+] [[#GetAppletResourceUsageInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 50 || [15.0.0+] AddSystemProgramIdAndAppletIdForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [16.0.0+] AddOperationConfirmedLibraryAppletIdForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [7.0.0+] [[#SetCpuBoostModeForApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [10.0.0+] [[#CancelCpuBoostModeForApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [9.0.0+] [[#PushToAppletBoundChannelForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 111 || [9.0.0+] [[#TryPopFromAppletBoundChannelForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [9.0.0+] [[#AlarmSettingNotificationEnableAppEventReserve]]&lt;br /&gt;
|-&lt;br /&gt;
| 121 || [9.0.0+] [[#AlarmSettingNotificationDisableAppEventReserve]]&lt;br /&gt;
|-&lt;br /&gt;
| 122 || [9.0.0+] [[#AlarmSettingNotificationPushAppEventNotify]]&lt;br /&gt;
|-&lt;br /&gt;
| 130 || [9.0.0+] [[#FriendInvitationSetApplicationParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 131 || [9.0.0+] [[#FriendInvitationClearApplicationParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 132 || [9.0.0+] [[#FriendInvitationPushApplicationParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 140 || [14.0.0+] RestrictPowerOperationForSecureLaunchModeForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [15.0.0+] CreateFloatingLibraryAppletAccepterForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [16.0.0+] TerminateAllRunningApplicationsForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 900 || [12.0.0+] GetGrcProcessLaunchedSystemEvent&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== NotifyMessageToHomeMenuForDebug ===&lt;br /&gt;
Takes an input [[#AppletMessage]], no output.&lt;br /&gt;
&lt;br /&gt;
Stubbed, just returns an error.&lt;br /&gt;
&lt;br /&gt;
=== OpenMainApplication ===&lt;br /&gt;
No input, returns an output [[#IApplicationAccessor]].&lt;br /&gt;
&lt;br /&gt;
Should not be used when no Application is running (svcBreak).&lt;br /&gt;
&lt;br /&gt;
=== PerformSystemButtonPressing ===&lt;br /&gt;
Takes an input [[#SystemButtonType]], no output.&lt;br /&gt;
&lt;br /&gt;
=== InvalidateTransitionLayer ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== RequestLaunchApplicationWithUserAndArgumentForDebug ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]]).&lt;br /&gt;
&lt;br /&gt;
=== GetAppletResourceUsageInfo ===&lt;br /&gt;
No input, returns an output [[#AppletResourceUsageInfo]].&lt;br /&gt;
&lt;br /&gt;
=== SetCpuBoostModeForApplet ===&lt;br /&gt;
Takes an input u32 [[#CpuBoostMode]] and passes it to [[PPC_services#apm:sys|SetCpuBoostMode]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
=== CancelCpuBoostModeForApplet ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== PushToAppletBoundChannelForDebug ===&lt;br /&gt;
Takes an input [[#IStorage]] and a s32, no output.&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== TryPopFromAppletBoundChannelForDebug ===&lt;br /&gt;
Takes an input s32, returns an output [[#IStorage]].&lt;br /&gt;
&lt;br /&gt;
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
The s32 must not be 0 and must match the value previously saved by [[#PushToAppletBoundChannelForDebug]], otherwise errors are returned. Then the output storage is popped from the StorageChannel.&lt;br /&gt;
&lt;br /&gt;
=== AlarmSettingNotificationEnableAppEventReserve ===&lt;br /&gt;
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.&lt;br /&gt;
&lt;br /&gt;
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.&lt;br /&gt;
&lt;br /&gt;
=== AlarmSettingNotificationDisableAppEventReserve ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Clears the StorageChannel/saved-ApplicationId used by [[#AlarmSettingNotificationEnableAppEventReserve]].&lt;br /&gt;
&lt;br /&gt;
=== AlarmSettingNotificationPushAppEventNotify ===&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#PushToNotificationStorageChannel]] except this uses the MainApplication.&lt;br /&gt;
&lt;br /&gt;
=== FriendInvitationSetApplicationParameter ===&lt;br /&gt;
Takes an input [[#IStorage]] and an [[NCM_services#ApplicationId|ApplicationId]], no output.&lt;br /&gt;
&lt;br /&gt;
Clears a StorageChannel, pushes the input storage there, and writes the ApplicationId into state.&lt;br /&gt;
&lt;br /&gt;
=== FriendInvitationClearApplicationParameter ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Clears the StorageChannel/saved-ApplicationId used by [[#FriendInvitationSetApplicationParameter]].&lt;br /&gt;
&lt;br /&gt;
=== FriendInvitationPushApplicationParameter ===&lt;br /&gt;
Takes an input [[#IStorage]], no output.&lt;br /&gt;
&lt;br /&gt;
Same as [[#PushToFriendInvitationStorageChannel]] except this uses the MainApplication.&lt;br /&gt;
&lt;br /&gt;
== IStorage ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IStorage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Open || No input. Returns an [[#IStorageAccessor]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [2.0.0+] OpenTransferStorage || No input. Returns an [[#ITransferStorageAccessor]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Open can only be used when the IStorage was created by [[#CreateStorage]] or [[#CreateTransferMemoryStorage]]. OpenTransferStorage can only be used when the IStorage was created by [[#CreateHandleStorage]].&lt;br /&gt;
&lt;br /&gt;
Only 1 *Accessor session can be open for each IStorage at a time.&lt;br /&gt;
&lt;br /&gt;
== IStorageAccessor ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IStorageAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetSize || No input. Returns an s64.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Write || Takes an input s64 and a type-0x21 input buffer.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Read || Takes an input s64 and a type-0x22 output buffer.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ITransferStorageAccessor ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ITransferStorageAccessor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetSize || No input. Returns an output s64.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetHandle || No input. Returns an output s64 and handle.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These commands return the data originally from [[#CreateHandleStorage]] input, both return the same s64.&lt;br /&gt;
&lt;br /&gt;
= appletOE =&lt;br /&gt;
This is &amp;quot;nn::am::service::IApplicationProxyService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#OpenApplicationProxy]] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is used by all regular-applications, including [[flog]] and &amp;quot;Retail Interactive Display Menu&amp;quot;. Only one session can be open for this service at a time.&lt;br /&gt;
&lt;br /&gt;
== OpenApplicationProxy ==&lt;br /&gt;
Returns an [[#IApplicationProxy]]. See [[#appletAE]].&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first.&lt;br /&gt;
&lt;br /&gt;
= idle:sys =&lt;br /&gt;
This is &amp;quot;nn::idle::detail::IPolicyManagerSystem&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This was moved to [[OMM_services|omm]] with [14.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetAutoPowerDownEvent&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [7.0.0+] IsAutoPowerDownRequested ([1.0.0-3.0.2] )&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [1.0.0-3.0.2]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#SetHandlingContext]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || LoadAndApplySettings&lt;br /&gt;
|-&lt;br /&gt;
| 5 || ReportUserIsActive&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SetHandlingContext ==&lt;br /&gt;
[3.0.0+] Now takes an additional 0x10-bytes of input.&lt;br /&gt;
&lt;br /&gt;
[13.0.0+] Total input size is now 0x30 instead of 0x38.&lt;br /&gt;
&lt;br /&gt;
= omm =&lt;br /&gt;
This is &amp;quot;nn::omm::detail::IOperationModeManager&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Operation Mode Manager (OMM) is a service responsible for arbitrating the operation changes between docked and handheld modes.&lt;br /&gt;
Besides [[PTM_services|PTM]], this is the only service that interacts with the [[Dock]] through [[USB_services|usb:pd*]].&lt;br /&gt;
&lt;br /&gt;
This was moved to [[OMM_services|omm]] with [14.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetOperationMode&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetOperationModeChangeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 2 || EnableAudioVisual&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DisableAudioVisual&lt;br /&gt;
|-&lt;br /&gt;
| 4 || EnterSleepAndWait&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetCradleStatus&lt;br /&gt;
|-&lt;br /&gt;
| 6 || FadeInDisplay&lt;br /&gt;
|-&lt;br /&gt;
| 7 || FadeOutDisplay&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [2.0.0+] GetCradleFwVersion&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [2.0.0+] NotifyCecSettingsChanged&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [3.0.0+] SetOperationModePolicy&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [3.0.0+] GetDefaultDisplayResolution&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [3.0.0+] GetDefaultDisplayResolutionChangeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [3.0.0+] UpdateDefaultDisplayResolution&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [3.0.0+] ShouldSleepOnBoot&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [4.0.0+] NotifyHdcpApplicationExecutionStarted&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [4.0.0+] NotifyHdcpApplicationExecutionFinished&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [4.0.0+] NotifyHdcpApplicationDrawingStarted&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [4.0.0+] NotifyHdcpApplicationDrawingFinished&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [4.0.0+] GetHdcpAuthenticationFailedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [4.0.0+] GetHdcpAuthenticationFailedEmulationEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [4.0.0+] SetHdcpAuthenticationFailedEmulation&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [4.0.0+] GetHdcpStateChangeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [4.0.0+] GetHdcpState&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [5.0.0+] ShowCardUpdateProcessing&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [5.0.0+] SetApplicationCecSettingsAndNotifyChanged&lt;br /&gt;
|-&lt;br /&gt;
| 26 || [7.0.0+] [[#GetOperationModeSystemInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 27 || [9.0.0+] GetAppletFullAwakingSystemEvent&lt;br /&gt;
|-&lt;br /&gt;
| 28 || [12.0.0+] [[#CreateCradleFirmwareUpdater]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GetOperationModeSystemInfo ==&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
This is used by [[#GetOperationModeSystemInfo|ICommonStateGetter GetOperationModeSystemInfo]].&lt;br /&gt;
&lt;br /&gt;
== CreateCradleFirmwareUpdater ==&lt;br /&gt;
No input. Returns an [[#ICradleFirmwareUpdater]].&lt;br /&gt;
&lt;br /&gt;
== ICradleFirmwareUpdater ==&lt;br /&gt;
This is &amp;quot;nn::am::service::ICradleFirmwareUpdater&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [12.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Start&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Finish&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetUpdateDeviceStatus&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetUpdateProgress&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetUpdateDeviceStatusChangeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetUpdateProgress2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= spsm =&lt;br /&gt;
This is &amp;quot;nn::spsm::detail::IPowerStateInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was moved to [[OMM_services|omm]] with [14.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetCurrentState&lt;br /&gt;
|-&lt;br /&gt;
| 1 || EnterSleep&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetLastWakeReason&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Shutdown&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetNotificationMessageEventHandle&lt;br /&gt;
|-&lt;br /&gt;
| 5 || ReceiveNotificationMessage&lt;br /&gt;
|-&lt;br /&gt;
| 6 || AnalyzeLogForLastSleepWakeSequence&lt;br /&gt;
|-&lt;br /&gt;
| 7 || ResetEventLog&lt;br /&gt;
|-&lt;br /&gt;
| 8 || AnalyzePerformanceLogForLastSleepWakeSequence&lt;br /&gt;
|-&lt;br /&gt;
| 9 || ChangeHomeButtonLongPressingTime&lt;br /&gt;
|-&lt;br /&gt;
| 10 || PutErrorState&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [1.0.0-3.0.2] InvalidateCurrentHomeButtonPressing&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] Cmd11 now takes a total of 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
= tcap =&lt;br /&gt;
This is &amp;quot;nn::tcap::server::IManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was removed with [11.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetContinuousHighSkinTemperatureEvent&lt;br /&gt;
|-&lt;br /&gt;
| 1 || SetOperationMode&lt;br /&gt;
|-&lt;br /&gt;
| 2 || LoadAndApplySettings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= caps:su =&lt;br /&gt;
This is &amp;quot;nn::capsrv::sf::IScreenShotApplicationService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [6.0.0+].&lt;br /&gt;
&lt;br /&gt;
This can be used by applications to save screenshots.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 32 || [7.0.0+] SetShimLibraryVersion || Takes a total of 0x10-bytes of input and a PID, no output.&lt;br /&gt;
|-&lt;br /&gt;
| 201 || SaveScreenShot || &lt;br /&gt;
|-&lt;br /&gt;
| 203 || SaveScreenShotEx0 || &lt;br /&gt;
|-&lt;br /&gt;
| 205 || [8.0.0+] SaveScreenShotEx1 || &lt;br /&gt;
|-&lt;br /&gt;
| 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.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SetShimLibraryVersion&#039;&#039;&#039; is a wrapper for [[Capture_services|caps:c]] cmd33. Commands &#039;&#039;&#039;SaveScreenShot&#039;&#039;&#039;, &#039;&#039;&#039;SaveScreenShotEx0&#039;&#039;&#039;, &#039;&#039;&#039;SaveScreenShotEx1&#039;&#039;&#039; and &#039;&#039;&#039;SaveScreenShotEx2&#039;&#039;&#039; are wrappers for [[Display_services|caps:sc]] cmd210.&lt;br /&gt;
&lt;br /&gt;
== SaveScreenShot ==&lt;br /&gt;
Takes two input u32s, an u64 AppletResourceUserId, a PID, and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].&lt;br /&gt;
&lt;br /&gt;
Official user-processes doesn&#039;t use this, instead [[#SaveScreenShotEx0]] is used: ScreenShotAttributeEx0 is all-zero, except +4 is set to an input u32 and u32 +0xC = 0x1.&lt;br /&gt;
&lt;br /&gt;
This cmd internally uses an all-zero ScreenShotAttributeEx0, with u32 +0 = input u32 and u32 +0x8 = 0x3.&lt;br /&gt;
&lt;br /&gt;
== SaveScreenShotEx0 ==&lt;br /&gt;
Takes an input 0x40-byte struct &#039;&#039;&#039;ScreenShotAttributeEx0&#039;&#039;&#039;, an input u32, an input u64 AppletResourceUserId, a PID, and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].&lt;br /&gt;
&lt;br /&gt;
== SaveScreenShotEx1 ==&lt;br /&gt;
Takes an input 0x40-byte struct &#039;&#039;&#039;ScreenShotAttributeEx0&#039;&#039;&#039;, an input u32, an input u64 AppletResourceUserId, a PID, a type-0x15 input buffer containing an [[Capture_services|ApplicationData]], and a type-0x45 input buffer containing image data. Returns an [[Capture_services|ApplicationAlbumEntry]].&lt;br /&gt;
&lt;br /&gt;
== SaveScreenShotEx2 ==&lt;br /&gt;
Takes an input 0x40-byte struct &#039;&#039;&#039;ScreenShotAttributeEx0&#039;&#039;&#039;, 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]].&lt;br /&gt;
&lt;br /&gt;
= apm =&lt;br /&gt;
This is &amp;quot;nn::am::service::IApmManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [8.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#OpenSession]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetPerformanceMode&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [7.0.0+] [[#IsCpuOverclockEnabled]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== OpenSession ==&lt;br /&gt;
Returns an [[#ISession]].&lt;br /&gt;
&lt;br /&gt;
== IsCpuOverclockEnabled ==&lt;br /&gt;
No input, returns an output u8 bool.&lt;br /&gt;
&lt;br /&gt;
== ISession ==&lt;br /&gt;
This is &amp;quot;nn::am::service::IApmSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || SetPerformanceConfiguration&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetPerformanceConfiguration&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [8.0.0+] SetCpuOverclockEnabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Library Applets =&lt;br /&gt;
This section documents library applet launching.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Once the applet finishes running successfully, [[#ILibraryAppletAccessor]] PopOutData can be used to get the applet-specific [[#IStorage]] containing the applet output data.&lt;br /&gt;
&lt;br /&gt;
== CommonArguments ==&lt;br /&gt;
The first [[#CreateStorage|IStorage]] passed to applets should contain the common library applet arguments. This is populated by &amp;lt;code&amp;gt;nn::la::CommonArgumentsWriter&amp;lt;/code&amp;gt; and has the following format.&lt;br /&gt;
&lt;br /&gt;
This struct is 0x20-bytes.&lt;br /&gt;
&lt;br /&gt;
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&#039;s 8-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Typical Value || Notes &lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 4 || 1 || Common Arguments version&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 4 || 0x20 || Common Arguments size&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 4 || || Library applet version (API version)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 4 || 0 || Theme color&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 1 || 0 || Play startup sound&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AppletId =&lt;br /&gt;
This is &amp;quot;nn::applet::AppletId&amp;quot;. See also [[:Category:Library Applets]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! ProgramId&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| &lt;br /&gt;
| Application (not valid for use with LibraryApplets)&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 010000000000100C&lt;br /&gt;
| OverlayApplet (overlayDisp)&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| 0100000000001000&lt;br /&gt;
| SystemAppletMenu (qlaunch)&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 0100000000001012&lt;br /&gt;
| SystemApplication (starter)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A&lt;br /&gt;
| 0100000000001001&lt;br /&gt;
| [[Auth_Applet|LibraryAppletAuth (auth)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0B&lt;br /&gt;
| 0100000000001002&lt;br /&gt;
| [[Cabinet_Applet|LibraryAppletCabinet (cabinet)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C&lt;br /&gt;
| 0100000000001003&lt;br /&gt;
| [[Controller_Applet|LibraryAppletController (controller)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0D&lt;br /&gt;
| 0100000000001004&lt;br /&gt;
| LibraryAppletDataErase (dataErase)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E&lt;br /&gt;
| 0100000000001005&lt;br /&gt;
| [[Error_Applet|LibraryAppletError (error)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0F&lt;br /&gt;
| 0100000000001006&lt;br /&gt;
| LibraryAppletNetConnect (netConnect)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0100000000001007&lt;br /&gt;
| [[Profile_Selector|LibraryAppletPlayerSelect (playerSelect)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| 0100000000001008&lt;br /&gt;
| [[Software_Keyboard|LibraryAppletSwkbd (swkbd)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0100000000001009&lt;br /&gt;
| [[MiiEdit_Applet|LibraryAppletMiiEdit (miiEdit)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x13&lt;br /&gt;
| 010000000000100A&lt;br /&gt;
| [[Internet_Browser#010000000000100A|LibraryAppletWeb (web)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 010000000000100B&lt;br /&gt;
| [[Internet_Browser#ShopN|LibraryAppletShop (shop)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x15&lt;br /&gt;
| 010000000000100D&lt;br /&gt;
| [[Album_Applet|LibraryAppletPhotoViewer (photoViewer)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x16&lt;br /&gt;
| 010000000000100E&lt;br /&gt;
| LibraryAppletSet (set)&lt;br /&gt;
|-&lt;br /&gt;
| 0x17&lt;br /&gt;
| 010000000000100F&lt;br /&gt;
| [[Internet_Browser#Offline_Applet|LibraryAppletOfflineWeb (offlineWeb)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0100000000001010&lt;br /&gt;
| [[Internet_Browser#Whitelisted_Applets|LibraryAppletLoginShare (loginShare)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x19&lt;br /&gt;
| 0100000000001011&lt;br /&gt;
| [[Internet_Browser#WifiWebAuthApplet|LibraryAppletWifiWebAuth (wifiWebAuth)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A&lt;br /&gt;
| 0100000000001013&lt;br /&gt;
| [[MyPage_Applet|LibraryAppletMyPage (myPage)]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B&lt;br /&gt;
| 010000000000101A&lt;br /&gt;
| LibraryAppletGift (gift)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 010000000000101C&lt;br /&gt;
| LibraryAppletUserMigration (userMigration)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D&lt;br /&gt;
| 010000000000101D&lt;br /&gt;
| [9.0.0+] LibraryAppletPreomiaSys (EncounterSys)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E&lt;br /&gt;
| 0100000000001020&lt;br /&gt;
| [9.0.0+] LibraryAppletStory (story)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F&lt;br /&gt;
| 010070000E3C0000&lt;br /&gt;
| [9.0.0+] LibraryAppletPreomiaUsr (EncounterUsr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 010086000E49C000&lt;br /&gt;
| [9.0.0+] LibraryAppletPreomiaUsrDummy (EncounterUsrDummy)&lt;br /&gt;
|-&lt;br /&gt;
| 0x21&lt;br /&gt;
| 0100000000001038&lt;br /&gt;
| [10.0.0+] LibraryAppletSample (sample)&lt;br /&gt;
|-&lt;br /&gt;
| 0x22&lt;br /&gt;
| 0100000000001007&lt;br /&gt;
| [13.0.0+] LibraryAppletPromoteQualification (playerSelect)&lt;br /&gt;
|-&lt;br /&gt;
| 0x35&lt;br /&gt;
| 0100000000001042&lt;br /&gt;
| [16.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 0x36&lt;br /&gt;
| 0100000000001042&lt;br /&gt;
| [16.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 0x37&lt;br /&gt;
| 0100000000001042&lt;br /&gt;
| [16.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0100000000001043&lt;br /&gt;
| [16.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E8&lt;br /&gt;
| &lt;br /&gt;
| [10.0.0+] DevlopmentTool&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F1&lt;br /&gt;
| 010000000000D619&lt;br /&gt;
| [10.0.0+] CombinationLA&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F2&lt;br /&gt;
| 010000000000D610&lt;br /&gt;
| [10.0.0+] AeSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F3&lt;br /&gt;
| 010000000000D611&lt;br /&gt;
| [10.0.0+] AeOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F4&lt;br /&gt;
| 010000000000D612&lt;br /&gt;
| [10.0.0+] AeStarter&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F5&lt;br /&gt;
| 010000000000D613&lt;br /&gt;
| [10.0.0+] AeLibraryAppletAlone&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F6&lt;br /&gt;
| 010000000000D614&lt;br /&gt;
| [10.0.0+] AeLibraryApplet1&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F7&lt;br /&gt;
| 010000000000D615&lt;br /&gt;
| [10.0.0+] AeLibraryApplet2&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F8&lt;br /&gt;
| 010000000000D616&lt;br /&gt;
| [10.0.0+] AeLibraryApplet3&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F9&lt;br /&gt;
| 010000000000D617&lt;br /&gt;
| [10.0.0+] AeLibraryApplet4&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FA&lt;br /&gt;
| 010000000000D60A&lt;br /&gt;
| [10.0.0+] AppletISA&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FB&lt;br /&gt;
| 010000000000D60B&lt;br /&gt;
| [10.0.0+] AppletIOA&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FC&lt;br /&gt;
| 010000000000D60C&lt;br /&gt;
| [10.0.0+] AppletISTA&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FD&lt;br /&gt;
| 010000000000D60D&lt;br /&gt;
| [10.0.0+] AppletILA1&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FE&lt;br /&gt;
| 010000000000D60E&lt;br /&gt;
| [10.0.0+] AppletILA2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= LibraryAppletMode =&lt;br /&gt;
This is &amp;quot;nn::applet::LibraryAppletMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| AllForeground&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| PartialForeground&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| NoUi&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| PartialForegroundWithIndirectDisplay (see also [[#GetIndirectLayerConsumerHandle]], only used by swkbd [[Software_Keyboard|InlineKeyboard]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| AllForegroundInitiallyHidden (can be used by [7.0.0+] [[Internet_Browser|WebSession]])&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AppletMessage =&lt;br /&gt;
This is &amp;quot;nn::am::AppletMessage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ChangeIntoForeground&lt;br /&gt;
|-&lt;br /&gt;
| 2 || ChangeIntoBackground&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Exit&lt;br /&gt;
|-&lt;br /&gt;
| 6 || ApplicationExited&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [[#FocusState|FocusStateChanged]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#SetRestartMessageEnabled|Resume]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || DetectShortPressingHomeButton&lt;br /&gt;
|-&lt;br /&gt;
| 21 || DetectLongPressingHomeButton&lt;br /&gt;
|-&lt;br /&gt;
| 22 || DetectShortPressingPowerButton&lt;br /&gt;
|-&lt;br /&gt;
| 23 || DetectMiddlePressingPowerButton&lt;br /&gt;
|-&lt;br /&gt;
| 24 || DetectLongPressingPowerButton&lt;br /&gt;
|-&lt;br /&gt;
| 25 || RequestToPrepareSleep&lt;br /&gt;
|-&lt;br /&gt;
| 26 || FinishedSleepSequence&lt;br /&gt;
|-&lt;br /&gt;
| 27 || SleepRequiredByHighTemperature&lt;br /&gt;
|-&lt;br /&gt;
| 28 || SleepRequiredByLowBattery&lt;br /&gt;
|-&lt;br /&gt;
| 29 || AutoPowerDown&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#OperationMode|OperationModeChanged]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [[#PerformanceMode|PerformanceModeChanged]]&lt;br /&gt;
|-&lt;br /&gt;
| 32 || DetectReceivingCecSystemStandby&lt;br /&gt;
|-&lt;br /&gt;
| 33 || SdCardRemoved&lt;br /&gt;
|-&lt;br /&gt;
| 50 || LaunchApplicationRequested&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [[#SetHandlesRequestToDisplay|RequestToDisplay]]&lt;br /&gt;
|-&lt;br /&gt;
| 55 || ShowApplicationLogo&lt;br /&gt;
|-&lt;br /&gt;
| 56 || HideApplicationLogo&lt;br /&gt;
|-&lt;br /&gt;
| 57 || ForceHideApplicationLogo&lt;br /&gt;
|-&lt;br /&gt;
| 60 || FloatingApplicationDetected&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [[#SetRequiresCaptureButtonShortPressedMessage|DetectShortPressingCaptureButton]]&lt;br /&gt;
|-&lt;br /&gt;
| 92 || [[#SetAlbumImageTakenNotificationEnabled|AlbumScreenShotTaken]]&lt;br /&gt;
|-&lt;br /&gt;
| 93 || AlbumRecordingSaved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= OperationMode =&lt;br /&gt;
This is &amp;quot;nn::oe::OperationMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Handheld&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Console&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= PerformanceMode =&lt;br /&gt;
This is &amp;quot;nn::oe::PerformanceMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| -1 || Invalid&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Normal&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Boost&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= FocusState =&lt;br /&gt;
This is &amp;quot;nn::oe::FocusState&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 || InFocus&lt;br /&gt;
|-&lt;br /&gt;
| 2 || OutOfFocus&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Background&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= CpuBoostMode =&lt;br /&gt;
This is &amp;quot;nn::oe::CpuBoostMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Normal&lt;br /&gt;
|-&lt;br /&gt;
| 1 || FastLoad&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= WindowOriginMode =&lt;br /&gt;
This is &amp;quot;nn::oe::WindowOriginMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || LowerLeft&lt;br /&gt;
|-&lt;br /&gt;
| 1 || UpperLeft&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= WirelessPriorityMode =&lt;br /&gt;
This is &amp;quot;nn::oe::WirelessPriorityMode&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Default&lt;br /&gt;
|-&lt;br /&gt;
| 1 || OptimizedForWlan&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= TvPowerStateMatchingMode =&lt;br /&gt;
This is &amp;quot;nn::oe::TvPowerStateMatchingMode&amp;quot;. This is used with [[#SetTvPowerStateMatchingMode]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Unknown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= SystemButtonType =&lt;br /&gt;
This is &amp;quot;nn::am::service::SystemButtonType&amp;quot;. This is used with [[#PerformSystemButtonPressingIfInFocus]]/[[#PerformSystemButtonPressing]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 || PerformHomeButtonShortPressing&lt;br /&gt;
|-&lt;br /&gt;
| 2 || PerformHomeButtonLongPressing&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Short-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Long-pressing with the Power-button. Only available with [[#PerformSystemButtonPressing]].&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Shutdown the system. Only available with [[#PerformSystemButtonPressing]].&lt;br /&gt;
|-&lt;br /&gt;
| 6 || PerformCaptureButtonShortPressing&lt;br /&gt;
|-&lt;br /&gt;
| 7 || PerformCaptureButtonLongPressing&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= LaunchParameterKind =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 || UserChannel. Application-specific LaunchParameter.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || account PreselectedUser&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Unknown if used by anything?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= LibraryAppletExitReason =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Normal&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Canceled&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Abnormal&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Unexpected&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ProgramSpecifyKind =&lt;br /&gt;
This is &amp;quot;nn::am::service::ProgramSpecifyKind&amp;quot;. This controls the type of the u64 passed to [[#ExecuteProgram]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || u8 ProgramIndex. &amp;quot;ExecuteProgram&amp;quot;. [[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.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[NCM_services#ApplicationId|ApplicationId]]. &amp;quot;JumpToSubApplicationProgramForDevelopment&amp;quot;. Only available when [[Settings_services#GetDebugModeFlag|DebugMode]] is 1.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || u64 = value 0. &amp;quot;RestartProgram&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
ProgramIndex values where the title is not installed should not be used: [[qlaunch]] will display an error message and the current title will become &amp;quot;corrupted&amp;quot;, however Home Menu will have an option to repair it.&lt;br /&gt;
&lt;br /&gt;
= InputDetectionPolicy =&lt;br /&gt;
This is u32 enum &amp;quot;nn::applet::InputDetectionPolicy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Unknown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AppletResourceUserId =&lt;br /&gt;
This is &amp;quot;nn::applet::AppletResourceUserId&amp;quot;. Used by a number of non-AM services.&lt;br /&gt;
&lt;br /&gt;
= AppletAttribute =&lt;br /&gt;
This is &amp;quot;nn::am::AppletAttribute&amp;quot;. This struct is 0x80 bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Flag. When non-zero, two state fields are set to 1.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x7F || Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is used by [[#OpenLibraryAppletProxy]].&lt;br /&gt;
&lt;br /&gt;
= AppletProcessLaunchReason =&lt;br /&gt;
This is &amp;quot;nn::am::service::AppletProcessLaunchReason&amp;quot;. This struct is 0x4-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Flag. When non-zero, LibraryApplets then use [[#OpenCallingLibraryApplet]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x2 || Always 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || Always 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= LibraryAppletInfo =&lt;br /&gt;
This is &amp;quot;nn::am::service::LibraryAppletInfo&amp;quot;. This struct is 0x8-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#AppletId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || [[#LibraryAppletMode]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AppletKind =&lt;br /&gt;
This is &amp;quot;nn::am::service::AppletKind&amp;quot;. This is 8-bytes.&lt;br /&gt;
&lt;br /&gt;
= AppletIdentityInfo =&lt;br /&gt;
This struct is &amp;quot;nn::am::service::AppletIdentityInfo&amp;quot;. This struct is 0x10-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#AppletId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ApplicationAttributeForQuest =&lt;br /&gt;
This struct is &amp;quot;nn::applet::ApplicationAttributeForQuest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || See [[#ApplicationAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || See [[#ApplicationAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x4 || [7.0.0+] See [[#ApplicationAttribute]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
= ApplicationAttribute =&lt;br /&gt;
This struct is &amp;quot;nn::am::ApplicationAttribute&amp;quot;. This struct is 0x20-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || Default is 0 for non-Quest. Only used when non-zero: unknown value in seconds.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x4 || float audio volume. Must be in the range of 0.0f-1.0f. The default is 1.0f.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x14 || Unused. Default is 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Internally AM only uses the first 0xC-bytes from ApplicationAttribute, regardless of the cmd.&lt;br /&gt;
&lt;br /&gt;
= ApplicationLaunchProperty =&lt;br /&gt;
This struct is 0x10-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x4 || Application title-version.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application base title.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD || 0x1 || [[Filesystem_services#StorageId|StorageId]] for the Application update title.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE || 0x1 || Unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF || 0x1 || Padding.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ApplicationLaunchRequestInfo =&lt;br /&gt;
This is &amp;quot;nn::applet::ApplicationLaunchRequestInfo&amp;quot;. This struct is 0x10-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || Unknown. The default is 0x0 with [[#CreateSystemApplication]], 0x3 with [[#CreateApplication]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8 || Unknown. The default is 0x0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AppletResourceUsageInfo =&lt;br /&gt;
This is &amp;quot;nn::am::service::AppletResourceUsageInfo&amp;quot;. This struct is 0x20-bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || Unknown counter.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || Unknown counter.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x4 || Output from [[NS_Services|NS GetRightsEnvironmentCountForDebug]].&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x14 || Always zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ApplicationLicenseType =&lt;br /&gt;
This is &amp;quot;nn::oe::ApplicationLicenseType&amp;quot;. This is 1-byte.&lt;br /&gt;
&lt;br /&gt;
= LaunchRequiredVersion =&lt;br /&gt;
This is &amp;quot;nn::oe::LaunchRequiredVersion&amp;quot;. This is a 0x40-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
= ServerEnvironmentType =&lt;br /&gt;
This is &amp;quot;nn::oe::ServerEnvironmentType&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || dd&lt;br /&gt;
|-&lt;br /&gt;
| 1 || lp&lt;br /&gt;
|-&lt;br /&gt;
| 2 || sd&lt;br /&gt;
|-&lt;br /&gt;
| 3 || sp&lt;br /&gt;
|-&lt;br /&gt;
| 4 || dp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Liamwhite</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Thread_Local_Region&amp;diff=12469</id>
		<title>Thread Local Region</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Thread_Local_Region&amp;diff=12469"/>
		<updated>2023-09-11T15:49:51Z</updated>

		<summary type="html">&lt;p&gt;Liamwhite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the 0x200-byte thread local region. Its base address is loaded via ARM threadid register tpidrro_el0. TLR for multiple threads are stored in the same page, with the first TLR normally located at page+0x200, because the first TLR spot is reserved for usermode exception handling. In threads created by sdk, tpidr_el0 is assigned to the ThreadPointer object from the thread local region.&lt;br /&gt;
&lt;br /&gt;
= Structure =&lt;br /&gt;
This is &amp;quot;nn::svc::ThreadLocalRegion&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x100&lt;br /&gt;
| MessageBuffer&lt;br /&gt;
| [[IPC_Marshalling|IPC]] command buffer.&lt;br /&gt;
|-&lt;br /&gt;
| [8.0.0+] 0x100&lt;br /&gt;
| 0x2&lt;br /&gt;
| DisableCounter&lt;br /&gt;
| If userland sets this to non-zero, kernel will pin the thread and disallow calls to almost all SVCs.&lt;br /&gt;
|-&lt;br /&gt;
| [8.0.0+] 0x102&lt;br /&gt;
| 0x2&lt;br /&gt;
| InterruptFlag&lt;br /&gt;
| If a context switch would have occurred when user disable count was non-zero, kernel will set this to 1. This signifies that the user must call [[SVC#SynchronizePreemptionState|SynchronizePreemptionState]] to unpin itself and regain access other SVCs.&lt;br /&gt;
|-&lt;br /&gt;
| 0x104&lt;br /&gt;
| 0x4&lt;br /&gt;
| Reserved&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x108&lt;br /&gt;
| 0x78&lt;br /&gt;
| Reserved&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x180&lt;br /&gt;
| 0x50&lt;br /&gt;
| Tls&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D0&lt;br /&gt;
| 0x8&lt;br /&gt;
| LocalePtr&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D8&lt;br /&gt;
| 0x8&lt;br /&gt;
| ErrnoVal&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E0&lt;br /&gt;
| 0x8&lt;br /&gt;
| ThreadData&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E8&lt;br /&gt;
| 0x8&lt;br /&gt;
| EhGlobals&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F0&lt;br /&gt;
| 0x8&lt;br /&gt;
| ThreadPointer&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F8&lt;br /&gt;
| 0x8&lt;br /&gt;
| ThreadType&lt;br /&gt;
| Pointer to [[Thread_Local_Region#ThreadType|thread type]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Userland context =&lt;br /&gt;
== OsBootParamter ==&lt;br /&gt;
This is &amp;quot;nn::os::detail::g_OsBootParamter&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x04&lt;br /&gt;
|&lt;br /&gt;
| Main thread handle.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 0x04&lt;br /&gt;
|&lt;br /&gt;
| Always 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| 0x30&lt;br /&gt;
|&lt;br /&gt;
| Empty.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== OsResourceManagerStorage ==&lt;br /&gt;
This is &amp;quot;nn::os::detail::g_OsResourceManagerStorage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x04&lt;br /&gt;
|&lt;br /&gt;
| Always 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 0x10&lt;br /&gt;
|&lt;br /&gt;
| Process PRNG.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x04&lt;br /&gt;
|&lt;br /&gt;
| Padding.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| Always set to 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| [[SVC#GetInfo|AddressSpaceStart]] right shifted by 0x0C.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| AddressSpaceEnd ([[SVC#GetInfo|AddressSpaceStart]] + [[SVC#GetInfo|AddressSpaceSize]]) right shifted by 0x0C and aligned to AddressSpaceAlign.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| AddressSpaceAlign right shifted by 0x0C.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| Always 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| Always set to 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| [[SVC#GetInfo|MapRegionBased]] right shifted by 0x0C.&lt;br /&gt;
|-&lt;br /&gt;
| 0x50&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| MapRegionEnd ([[SVC#GetInfo|MapRegionBased]] + [[SVC#GetInfo|MapRegionSize]]) right shifted by 0x0C and aligned to MapRegionAlign.&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| MapRegionAlign right shifted by 0x0C.&lt;br /&gt;
|-&lt;br /&gt;
| 0x60&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| Always 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| Always 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| 0x1D0&lt;br /&gt;
|&lt;br /&gt;
| Main [[Thread_Local_Region#ThreadType|thread type]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x240&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| Pointer to main [[Thread_Local_Region#ThreadType|thread type]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x248&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| Unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x250&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| Unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x258&lt;br /&gt;
| 0x130&lt;br /&gt;
|&lt;br /&gt;
| Always empty?&lt;br /&gt;
|-&lt;br /&gt;
| 0x388&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| Pointer to [[Thread_Local_Region#OsResourceManagerStorage|resource manager storage]] + 0x388.&lt;br /&gt;
|-&lt;br /&gt;
| 0x390&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| Pointer to [[Thread_Local_Region#OsResourceManagerStorage|resource manager storage]] + 0x388.&lt;br /&gt;
|-&lt;br /&gt;
| 0x398&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| Always 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A0&lt;br /&gt;
| 0x08&lt;br /&gt;
|&lt;br /&gt;
| Always 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ThreadType ==&lt;br /&gt;
This is &amp;quot;nn::os::ThreadType&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x10&lt;br /&gt;
| AllThreadsListNode&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x10&lt;br /&gt;
| MultiWaitObjectList&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x20&lt;br /&gt;
| Reserved&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x40&lt;br /&gt;
| 0x01&lt;br /&gt;
| State&lt;br /&gt;
| Thread status.&lt;br /&gt;
|-&lt;br /&gt;
| 0x41&lt;br /&gt;
| 0x01&lt;br /&gt;
| StackIsAliased&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x42&lt;br /&gt;
| 0x01&lt;br /&gt;
| AutoRegistered&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x43&lt;br /&gt;
| 0x01&lt;br /&gt;
| SuspendCount&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x44&lt;br /&gt;
| 0x02&lt;br /&gt;
| BasePriority&lt;br /&gt;
| Thread priority minus 0x1C.&lt;br /&gt;
|-&lt;br /&gt;
| 0x46&lt;br /&gt;
| 0x02&lt;br /&gt;
| Version&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x48&lt;br /&gt;
| 0x08&lt;br /&gt;
| OriginalStack&lt;br /&gt;
| Thread stack base address.&lt;br /&gt;
|-&lt;br /&gt;
| 0x50&lt;br /&gt;
| 0x08&lt;br /&gt;
| Stack&lt;br /&gt;
| Thread stack base address mirror.&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| 0x08&lt;br /&gt;
| StackSize&lt;br /&gt;
| Thread stack size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x60&lt;br /&gt;
| 0x08&lt;br /&gt;
| Argument&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x68&lt;br /&gt;
| 0x08&lt;br /&gt;
| ThreadFunction&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| 0x08&lt;br /&gt;
| CurrentFiber&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| 0x08&lt;br /&gt;
| InitialFiber&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| 0x100&lt;br /&gt;
| TlsValueArray&lt;br /&gt;
| TLS slots.&lt;br /&gt;
|-&lt;br /&gt;
| 0x180&lt;br /&gt;
| 0x20&lt;br /&gt;
| ThreadNameBuffer&lt;br /&gt;
| Thread name.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A0&lt;br /&gt;
| 0x08&lt;br /&gt;
| NamePointer&lt;br /&gt;
| Thread name address.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A8&lt;br /&gt;
| 0x04&lt;br /&gt;
| CsThread&lt;br /&gt;
| Critical Section Storage.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1AC&lt;br /&gt;
| 0x04&lt;br /&gt;
| CvThread&lt;br /&gt;
| Conditional Variable Storage.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B0&lt;br /&gt;
| 0x04&lt;br /&gt;
| Handle&lt;br /&gt;
| Thread handle.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B4&lt;br /&gt;
| 0x04&lt;br /&gt;
| LockHistory&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x1B8&lt;br /&gt;
| 0x08&lt;br /&gt;
| ThreadId&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Liamwhite</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=SVC&amp;diff=12139</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=SVC&amp;diff=12139"/>
		<updated>2023-02-18T18:32:19Z</updated>

		<summary type="html">&lt;p&gt;Liamwhite: ResetSignal returns ResultInvalidState if the event is not signaled&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
= System calls =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ID || Return Type || Name || Arguments&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Result || [[#SetHeapSize|SetHeapSize]] || uintptr_t *out_address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Result || [[#SetMemoryPermission|SetMemoryPermission]] || uintptr_t address, size_t size, MemoryPermission perm&lt;br /&gt;
|-&lt;br /&gt;
| 0x03 || Result || [[#SetMemoryAttribute|SetMemoryAttribute]] || uintptr_t address, size_t size, uint32_t mask, uint32_t attr&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Result || [[#MapMemory|MapMemory]] || uintptr_t dst_address, uintptr_t src_address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Result || [[#UnmapMemory|UnmapMemory]] || uintptr_t dst_address, uintptr_t src_address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || Result || [[#QueryMemory|QueryMemory]] || arch::MemoryInfo *out_memory_info, PageInfo *out_page_info, uintptr_t address&lt;br /&gt;
|-&lt;br /&gt;
| 0x07 || void || [[#ExitProcess|ExitProcess]] || &lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Result || [[#CreateThread|CreateThread]] || Handle *out_handle, ThreadFunc func, uintptr_t arg, uintptr_t stack_bottom, int32_t priority, int32_t core_id&lt;br /&gt;
|-&lt;br /&gt;
| 0x09 || Result || [[#StartThread|StartThread]] || Handle thread_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || void || [[#ExitThread|ExitThread]] || &lt;br /&gt;
|-&lt;br /&gt;
| 0x0B || void || [[#SleepThread|SleepThread]] || int64_t ns&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Result || [[#GetThreadPriority|GetThreadPriority]] || int32_t *out_priority, Handle thread_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x0D || Result || [[#SetThreadPriority|SetThreadPriority]] || Handle thread_handle, int32_t priority&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E || Result || [[#GetThreadCoreMask|GetThreadCoreMask]] || int32_t *out_core_id, uint64_t *out_affinity_mask, Handle thread_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x0F || Result || [[#SetThreadCoreMask|SetThreadCoreMask]] || Handle thread_handle, int32_t core_id, uint64_t affinity_mask&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || int32_t || [[#GetCurrentProcessorNumber|GetCurrentProcessorNumber]] || &lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || Result || [[#SignalEvent|SignalEvent]] || Handle event_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || Result || [[#ClearEvent|ClearEvent]] || Handle event_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || Result || [[#MapSharedMemory|MapSharedMemory]] || Handle shmem_handle, uintptr_t address, size_t size, MemoryPermission map_perm&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Result || [[#UnmapSharedMemory|UnmapSharedMemory]] || Handle shmem_handle, uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 || Result || [[#CreateTransferMemory|CreateTransferMemory]] || Handle *out_handle, uintptr_t address, size_t size, MemoryPermission map_perm&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || Result || [[#CloseHandle|CloseHandle]] || Handle handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 || Result || [[#ResetSignal|ResetSignal]] || Handle handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Result || [[#WaitSynchronization|WaitSynchronization]] || int32_t *out_index, const Handle *handles, int32_t numHandles, int64_t timeout_ns&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 || Result || [[#CancelSynchronization|CancelSynchronization]] || Handle handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A || Result || [[#ArbitrateLock|ArbitrateLock]] || Handle thread_handle, uintptr_t address, uint32_t tag&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B || Result || [[#ArbitrateUnlock|ArbitrateUnlock]] || uintptr_t address&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Result || [[#WaitProcessWideKeyAtomic|WaitProcessWideKeyAtomic]] || uintptr_t address, uintptr_t cv_key, uint32_t tag, int64_t timeout_ns&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D || void || [[#SignalProcessWideKey|SignalProcessWideKey]] || uintptr_t cv_key, int32_t count&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E || int64_t || [[#GetSystemTick|GetSystemTick]] || &lt;br /&gt;
|-&lt;br /&gt;
| 0x1F || Result || [[#ConnectToNamedPort|ConnectToNamedPort]] || Handle *out_handle, const char *name&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Result || [[#SendSyncRequestLight|SendSyncRequestLight]] || Handle session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || Result || [[#SendSyncRequest|SendSyncRequest]] || Handle session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || Result || [[#SendSyncRequestWithUserBuffer|SendSyncRequestWithUserBuffer]] || uintptr_t message_buffer, size_t message_buffer_size, Handle session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 || Result || [[#SendAsyncRequestWithUserBuffer|SendAsyncRequestWithUserBuffer]] || Handle *out_event_handle, uintptr_t message_buffer, size_t message_buffer_size, Handle session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Result || [[#GetProcessId|GetProcessId]] || uint64_t *out_process_id, Handle process_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 || Result || [[#GetThreadId|GetThreadId]] || uint64_t *out_thread_id, Handle thread_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || void || [[#Break|Break]] || BreakReason break_reason, uintptr_t arg, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 || Result || [[#OutputDebugString|OutputDebugString]] || const char *debug_str, size_t len&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || void || [[#ReturnFromException|ReturnFromException]] || Result result&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 || Result || [[#GetInfo|GetInfo]] || uint64_t *out, InfoType info_type, Handle handle, uint64_t info_subtype&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || void || [[#FlushEntireDataCache|FlushEntireDataCache]] || &lt;br /&gt;
|-&lt;br /&gt;
| 0x2B || Result || [[#FlushDataCache|FlushDataCache]] || uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| [3.0.0+] 0x2C  || Result || [[#MapPhysicalMemory|MapPhysicalMemory]] || uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| [3.0.0+] 0x2D  || Result || [[#UnmapPhysicalMemory|UnmapPhysicalMemory]] || uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0-5.1.0] 0x2E  || Result || GetFutureThreadInfo || arch::LastThreadContext *out_context, uintptr_t *out_tls_address, uint32_t *out_flags, int64_t ns&lt;br /&gt;
|-&lt;br /&gt;
| [6.0.0+] 0x2E  || Result || [[#GetDebugFutureThreadInfo|GetDebugFutureThreadInfo]] || arch::LastThreadContext *out_context, uint64_t *thread_id, Handle debug_handle, int64_t ns&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F || Result || [[#GetLastThreadInfo|GetLastThreadInfo]] || arch::LastThreadContext *out_context, uintptr_t *out_tls_address, uint32_t *out_flags&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Result || [[#GetResourceLimitLimitValue|GetResourceLimitLimitValue]] || int64_t *out_limit_value, Handle resource_limit_handle, LimitableResource which&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 || Result || [[#GetResourceLimitCurrentValue|GetResourceLimitCurrentValue]] || int64_t *out_current_value, Handle resource_limit_handle, LimitableResource which&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || Result || [[#SetThreadActivity|SetThreadActivity]] || Handle thread_handle, ThreadActivity thread_activity&lt;br /&gt;
|-&lt;br /&gt;
| 0x33  || Result || [[#GetThreadContext3|GetThreadContext3]] || ThreadContext *out_context, Handle thread_handle&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] 0x34 || Result || [[#WaitForAddress|WaitForAddress]] || uintptr_t address, ArbitrationType arb_type, int32_t value, int64_t timeout_ns&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] 0x35 || Result || [[#SignalToAddress|SignalToAddress]] || uintptr_t address, SignalType signal_type, int32_t value, int32_t count&lt;br /&gt;
|-&lt;br /&gt;
| [8.0.0+] 0x36 || void || [[#SynchronizePreemptionState|SynchronizePreemptionState]] || &lt;br /&gt;
|-&lt;br /&gt;
| [11.0.0+] 0x37 || Result || [[#GetResourceLimitPeakValue|GetResourceLimitPeakValue]] || int64_t *out_peak_value, Handle resource_limit_handle, LimitableResource which&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| [13.0.0+] 0x39 || Result || CreateIoPool || Handle *out_handle, IoPoolType which_pool&lt;br /&gt;
|-&lt;br /&gt;
| [13.0.0+] 0x3A || Result || CreateIoRegion || Handle *out_handle, Handle io_pool, PhysicalAddress physical_address, size_t size, MemoryMapping mapping, MemoryPermission perm&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| [1.0.0-3.0.2] 0x3C || void || [[#DumpInfo|DumpInfo]] || DumpInfoType dump_info_type, uint64_t arg&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] 0x3C || void || [[#KernelDebug|KernelDebug]] || KernelDebugType kern_debug_type, uint64_t arg0, uint64_t arg1, uint64_t arg2&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] 0x3D || void || [[#ChangeKernelTraceState|ChangeKernelTraceState]] || KernelTraceState kern_trace_state&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x40 || Result || [[#CreateSession|CreateSession]] || Handle *out_server_session_handle, Handle *out_client_session_handle, bool is_light, uintptr_t name&lt;br /&gt;
|-&lt;br /&gt;
| 0x41 || Result || [[#AcceptSession|AcceptSession]] || Handle *out_handle, Handle port&lt;br /&gt;
|-&lt;br /&gt;
| 0x42 || Result || [[#ReplyAndReceiveLight|ReplyAndReceiveLight]] || Handle handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x43 || Result || [[#ReplyAndReceive|ReplyAndReceive]] || int32_t *out_index, const Handle *handles, int32_t num_handles, Handle reply_target, int64_t timeout_ns&lt;br /&gt;
|-&lt;br /&gt;
| 0x44 || Result || [[#ReplyAndReceiveWithUserBuffer|ReplyAndReceiveWithUserBuffer]] || int32_t *out_index, uintptr_t message_buffer, size_t message_buffer_size, const Handle *handles, int32_t num_handles, Handle reply_target, int64_t timeout_ns&lt;br /&gt;
|-&lt;br /&gt;
| 0x45 || Result || [[#CreateEvent|CreateEvent]] || Handle *out_write_handle, Handle *out_read_handle&lt;br /&gt;
|-&lt;br /&gt;
| [13.0.0+] 0x46 || Result || MapIoRegion || Handle io_region, uintptr_t address, size_t size, MemoryPermission perm&lt;br /&gt;
|-&lt;br /&gt;
| [13.0.0+] 0x47 || Result || UnmapIoRegion || Handle io_region, uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x48 || Result || [[#MapPhysicalMemoryUnsafe|MapPhysicalMemoryUnsafe]] || uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x49 || Result || [[#UnmapPhysicalMemoryUnsafe|UnmapPhysicalMemoryUnsafe]] || uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x4A || Result || [[#SetUnsafeLimit|SetUnsafeLimit]] || size_t limit&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] 0x4B || Result || [[#CreateCodeMemory|CreateCodeMemory]] || Handle *out_handle, uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] 0x4C || Result || [[#ControlCodeMemory|ControlCodeMemory]] || Handle code_memory_handle, CodeMemoryOperation operation, uint64_t address, uint64_t size, MemoryPermission perm&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D || void || [[#SleepSystem|SleepSystem]] || &lt;br /&gt;
|-&lt;br /&gt;
| 0x4E || Result || [[#ReadWriteRegister|ReadWriteRegister]] || uint32_t *out_value, PhysicalAddress address, uint32_t mask, uint32_t value&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F || Result || [[#SetProcessActivity|SetProcessActivity]] || Handle process_handle, ProcessActivity process_activity&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || Result || [[#CreateSharedMemory|CreateSharedMemory]] || Handle *out_handle, size_t size, MemoryPermission owner_perm, MemoryPermission remote_perm&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 || Result || [[#MapTransferMemory|MapTransferMemory]] || Handle trmem_handle, uintptr_t address, size_t size, MemoryPermission owner_perm&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 || Result || [[#UnmapTransferMemory|UnmapTransferMemory]] || Handle trmem_handle, uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 || Result || [[#CreateInterruptEvent|CreateInterruptEvent]] || Handle *out_read_handle, int32_t interrupt_id, InterruptType interrupt_type&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 || Result || [[#QueryPhysicalAddress|QueryPhysicalAddress]] || arch::PhysicalMemoryInfo *out_info, uintptr_t address&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 || Result || [[#QueryIoMapping|QueryIoMapping]] || uintptr_t *out_address, [10.0.0+] size_t *out_size, PhysicalAddress physical_address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 || Result || [[#CreateDeviceAddressSpace|CreateDeviceAddressSpace]] || Handle *out_handle, uint64_t das_address, uint64_t das_size&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 || Result || [[#AttachDeviceAddressSpace|AttachDeviceAddressSpace]] || DeviceName device_name, Handle das_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x58 || Result || [[#DetachDeviceAddressSpace|DetachDeviceAddressSpace]] || DeviceName device_name, Handle das_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x59 || Result || [[#MapDeviceAddressSpaceByForce|MapDeviceAddressSpaceByForce]] || Handle das_handle, Handle process_handle, uint64_t process_address, size_t size, uint64_t device_address, uint32_t option&lt;br /&gt;
|-&lt;br /&gt;
| 0x5A || Result || [[#MapDeviceAddressSpaceAligned|MapDeviceAddressSpaceAligned]] || Handle das_handle, Handle process_handle, uint64_t process_address, size_t size, uint64_t device_address, uint32_t option&lt;br /&gt;
|-&lt;br /&gt;
| [1.0.0-12.1.0] 0x5B || Result || [[#MapDeviceAddressSpace|MapDeviceAddressSpace]] || size_t *out_mapped_size, Handle das_handle, Handle process_handle, uint64_t process_address, size_t size, uint64_t device_address, MemoryPermission device_perm&lt;br /&gt;
|-&lt;br /&gt;
| 0x5C || Result || [[#UnmapDeviceAddressSpace|UnmapDeviceAddressSpace]] || Handle das_handle, Handle process_handle, uint64_t process_address, size_t size, uint64_t device_address&lt;br /&gt;
|-&lt;br /&gt;
| 0x5D || Result || [[#InvalidateProcessDataCache|InvalidateProcessDataCache]] || Handle process_handle, uint64_t address, uint64_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x5E || Result || [[#StoreProcessDataCache|StoreProcessDataCache]] || Handle process_handle, uint64_t address, uint64_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x5F || Result || [[#FlushProcessDataCache|FlushProcessDataCache]] || Handle process_handle, uint64_t address, uint64_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || Result || [[#DebugActiveProcess|DebugActiveProcess]] || Handle *out_handle, uint64_t process_id&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 || Result || [[#BreakDebugProcess|BreakDebugProcess]] || Handle debug_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 || Result || [[#TerminateDebugProcess|TerminateDebugProcess]] || Handle debug_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 || Result || [[#GetDebugEvent|GetDebugEvent]] || arch::DebugEventInfo *out_info, Handle debug_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || Result || [[#ContinueDebugEvent|ContinueDebugEvent]] || Handle debug_handle, uint32_t flags, const uint64_t *thread_ids, int32_t num_thread_ids&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 || Result || [[#GetProcessList|GetProcessList]] || int32_t *out_num_processes, uint64_t *out_process_ids, int32_t max_out_count&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 || Result || [[#GetThreadList|GetThreadList]] || int32_t *out_num_threads, uint64_t *out_thread_ids, int32_t max_out_count, Handle debug_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 || Result || [[#GetDebugThreadContext|GetDebugThreadContext]] || ThreadContext *out_context, Handle debug_handle, uint64_t thread_id, uint32_t context_flags&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || Result || [[#SetDebugThreadContext|SetDebugThreadContext]] || Handle debug_handle, uint64_t thread_id, const ThreadContext *context, uint32_t context_flags&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 || Result || [[#QueryDebugProcessMemory|QueryDebugProcessMemory]] || arch::MemoryInfo *out_memory_info, PageInfo *out_page_info, Handle process_handle, uintptr_t address&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A || Result || [[#ReadDebugProcessMemory|ReadDebugProcessMemory]] || uintptr_t buffer, Handle debug_handle, uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B || Result || [[#WriteDebugProcessMemory|WriteDebugProcessMemory]] || Handle debug_handle, uintptr_t buffer, uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C || Result || [[#SetHardwareBreakPoint|SetHardwareBreakPoint]] || HardwareBreakPointRegisterName name, uint64_t flags, uint64_t value&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D || Result || [[#GetDebugThreadParam|GetDebugThreadParam]] || uint64_t *out_64, uint32_t *out_32, Handle debug_handle, uint64_t thread_id, DebugThreadParam param&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| [5.0.0+] 0x6F || Result || [[#GetSystemInfo|GetSystemInfo]] || uint64_t *out, SystemInfoType info_type, Handle handle, uint64_t info_subtype&lt;br /&gt;
|-&lt;br /&gt;
| 0x70 || Result || [[#CreatePort|CreatePort]] || Handle *out_server_handle, Handle *out_client_handle, int32_t max_sessions, bool is_light, uintptr_t name&lt;br /&gt;
|-&lt;br /&gt;
| 0x71 || Result || [[#ManageNamedPort|ManageNamedPort]] || Handle *out_server_handle, const char *name, int32_t max_sessions&lt;br /&gt;
|-&lt;br /&gt;
| 0x72 || Result || [[#ConnectToPort|ConnectToPort]] || Handle *out_handle, Handle port&lt;br /&gt;
|-&lt;br /&gt;
| 0x73 || Result || [[#SetProcessMemoryPermission|SetProcessMemoryPermission]] || Handle process_handle, uint64_t address, uint64_t size, MemoryPermission perm&lt;br /&gt;
|-&lt;br /&gt;
| 0x74 || Result || [[#MapProcessMemory|MapProcessMemory]] || uintptr_t dst_address, Handle process_handle, uint64_t src_address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x75 || Result || [[#UnmapProcessMemory|UnmapProcessMemory]] || uintptr_t dst_address, Handle process_handle, uint64_t src_address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x76 || Result || [[#QueryProcessMemory|QueryProcessMemory]] || arch::MemoryInfo *out_memory_info, PageInfo *out_page_info, Handle process_handle, uint64_t address&lt;br /&gt;
|-&lt;br /&gt;
| 0x77 || Result || [[#MapProcessCodeMemory|MapProcessCodeMemory]] || Handle process_handle, uint64_t dst_address, uint64_t src_address, uint64_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x78 || Result || [[#UnmapProcessCodeMemory|UnmapProcessCodeMemory]] || Handle process_handle, uint64_t dst_address, uint64_t src_address, uint64_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x79 || Result || [[#CreateProcess|CreateProcess]] || Handle *out_handle, const arch::CreateProcessParameter *parameters, const uint32_t *caps, int32_t num_caps&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A || Result || [[#StartProcess|StartProcess]] || Handle process_handle, int32_t priority, int32_t core_id, uint64_t main_thread_stack_size&lt;br /&gt;
|-&lt;br /&gt;
| 0x7B || Result || [[#TerminateProcess|TerminateProcess]] || Handle process_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C || Result || [[#GetProcessInfo|GetProcessInfo]] || int64_t *out_info, Handle process_handle, ProcessInfoType info_type&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D || Result || [[#CreateResourceLimit|CreateResourceLimit]] || Handle *out_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x7E || Result || [[#SetResourceLimitLimitValue|SetResourceLimitLimitValue]] || Handle resource_limit_handle, LimitableResource which, int64_t limit_value&lt;br /&gt;
|-&lt;br /&gt;
| 0x7F || void || [[#CallSecureMonitor|CallSecureMonitor]] || SecureMonitorArguments *args&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| [15.0.0+] 0x90  || Result || MapInsecureMemory || uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| [15.0.0+] 0x91  || Result || UnmapInsecureMemory || uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SetHeapSize ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || void* || HeapAddress&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the process heap to a given Size. It can both extend and shrink the heap.&lt;br /&gt;
&lt;br /&gt;
Size must be a multiple of 0x200000 (2MB).&lt;br /&gt;
&lt;br /&gt;
On success, the heap base-address (which is fixed by kernel, aslr&#039;d, and always in the Heap memory region) is written to HeapAddress.&lt;br /&gt;
&lt;br /&gt;
Uses current process pool partition. The memory allocated counts towards the caller&#039;s process Memory ResourceLimit.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Size must be less than or equal to 4GB.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCA01:&#039;&#039;&#039; Invalid size passed. It&#039;s either bigger than 4GB, or misaligned.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xD001:&#039;&#039;&#039; Size is bigger than the Heap Region size.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCE01:&#039;&#039;&#039; KMemoryBlockAllocator slab allocator exhausted.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xD401:&#039;&#039;&#039; The memory region is in an invalid state. Likely because a mapping was made in the heap region.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0x10801:&#039;&#039;&#039; Memory resource limit reached.&lt;br /&gt;
&lt;br /&gt;
== SetMemoryPermission ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || [[#MemoryPermission]] || MemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes permission of page-aligned memory region.&lt;br /&gt;
&lt;br /&gt;
Bit2 of permission (exec) is not allowed. Setting write-only is not allowed either (bit1).&lt;br /&gt;
&lt;br /&gt;
This can be used to move back and forth between ---, r-- and rw-.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success. The memory region was reprotected.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCC01:&#039;&#039;&#039; Unaligned address specified.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCA01:&#039;&#039;&#039; Unaligned or zero size specified.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xD401:&#039;&#039;&#039; The provided memory region does not fall within the userland address space.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xD801:&#039;&#039;&#039; Invalid permission specified. Valid permissions are ---, r-- and rw-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xD401:&#039;&#039;&#039; The provided memory region was in an invalid state. The region must have the [[#MemoryState|FlagCanReprotect]] state, and must not have the [[#MemoryAttribute|Locked]] or [[#MemoryAttribute|Uncached]] attributes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCE01:&#039;&#039;&#039; Kernel resource exhausted.&lt;br /&gt;
&lt;br /&gt;
== SetMemoryAttribute ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || uint32_t || Mask&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || uint32_t || Value&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes attribute of page-aligned memory region. The only allowed combination of Value and Mask is 0x8, which means only bit3 in [[#MemoryAttribute]] can be set or cleared.&lt;br /&gt;
&lt;br /&gt;
This is used to turn on/off caching for a given memory area. Useful when talking to devices such as the GPU.&lt;br /&gt;
&lt;br /&gt;
What happens &amp;quot;under the hood&amp;quot; is the &amp;quot;Memory Attribute Indirection Register&amp;quot; index is changed from 2 to 3 in the MMU descriptor.&lt;br /&gt;
&lt;br /&gt;
== MapMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || DstAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || SrcAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps a memory range into a different range.&lt;br /&gt;
&lt;br /&gt;
Mainly used for adding guard pages around stack.&lt;br /&gt;
&lt;br /&gt;
Source range gets reprotected to --- (it can no longer be accessed), and bit0 is set in the source [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
[1.0.0] This could be used to map into either the Alias Region or the Stack region.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] This can only be used to map into the Stack region.&lt;br /&gt;
&lt;br /&gt;
Code can get the range of the Alias region from [[#GetInfo]] id0=2,3, and on 2.0.0+ the range of the Stack region via [[#GetInfo]] id0=14, 15 (on 1.0.0, the Stack region had hardcoded limits).&lt;br /&gt;
&lt;br /&gt;
When mapped into the Alias region, the mapped memory will have state 0x482907.&lt;br /&gt;
&lt;br /&gt;
When mapped into the Stack region, the mapped memory will have state 0x5C3C0B.&lt;br /&gt;
&lt;br /&gt;
== UnmapMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || DstAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || SrcAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unmaps a region that was previously mapped with [[#MapMemory]].&lt;br /&gt;
&lt;br /&gt;
It&#039;s possible to unmap ranges partially, you don&#039;t need to unmap the entire range &amp;quot;in one go&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The srcaddr/dstaddr must match what was given when the pages were originally mapped.&lt;br /&gt;
&lt;br /&gt;
== QueryMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || [[#MemoryInfo]]* || MemoryInfo&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || [[#PageInfo]] || PageInfo&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries information about an address. Will always fetch the lowest page-aligned mapping that contains the provided address.&lt;br /&gt;
&lt;br /&gt;
Outputs a [[#MemoryInfo]] struct.&lt;br /&gt;
&lt;br /&gt;
== ExitProcess ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the current process.&lt;br /&gt;
&lt;br /&gt;
== CreateThread ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R1 || void(*)(void*) || Entry&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2 || void* || ThreadContext&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R3 || void* || StackTop&lt;br /&gt;
|-&lt;br /&gt;
| (In) W4 || R0 || int32_t || Priority&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || R4 || int32_t || ProcessorId&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a thread in the current process.&lt;br /&gt;
&lt;br /&gt;
ProcessorId must be 0,1,2,3 or -2, where -2 uses the default CpuId for process.&lt;br /&gt;
&lt;br /&gt;
== StartThread ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) None ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the thread for the provided handle.&lt;br /&gt;
&lt;br /&gt;
== ExitThread ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the current thread.&lt;br /&gt;
&lt;br /&gt;
== SleepThread ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0, R1 || uint64_t || Nanoseconds&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sleeps for a specified amount of time, or yields the thread.&lt;br /&gt;
&lt;br /&gt;
Setting nanoseconds to 0, -1, or -2 indicates a yielding type.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || Type&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Yielding without core migration&lt;br /&gt;
|-&lt;br /&gt;
| -1 || Yielding with core migration&lt;br /&gt;
|-&lt;br /&gt;
| -2 || Yielding to any other thread&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetThreadPriority ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1|| Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || int32_t || Priority&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets the priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== SetThreadPriority ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0|| Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1|| int32_t || Priority&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
Priority is a number 0-0x3F. Lower value means higher priority.&lt;br /&gt;
&lt;br /&gt;
== GetThreadCoreMask ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || int32_t || CoreMask0&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X2 || R2, R3 || uint64_t || CoreMask1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets the affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== SetThreadCoreMask ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || int32_t || CoreMask0&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || uint64_t || CoreMask1&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== GetCurrentProcessorNumber ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || uint32_t || CpuId&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets which cpu is executing the current thread.&lt;br /&gt;
&lt;br /&gt;
CpuId is an integer in the range 0-3.&lt;br /&gt;
&lt;br /&gt;
== SignalEvent ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;WritableEvent&amp;gt; || EventHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Puts the given event in the signaled state.&lt;br /&gt;
&lt;br /&gt;
Will wake up any thread currently waiting on this event. Can potentially trigger a reschedule.&lt;br /&gt;
&lt;br /&gt;
Any calls to [[#WaitSynchronization]] on this handle will return immediately, until the event&#039;s signaled state is reset.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success. Event is now in signaled state.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xE401:&#039;&#039;&#039; Invalid handle. The handle either does not exist, or is not a WritableEvent.&lt;br /&gt;
&lt;br /&gt;
== ClearEvent ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;WritableEvent&amp;gt; or Handle&amp;lt;ReadableEvent&amp;gt; || EventHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Takes the given event out of the signaled state, if it is signaled.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success, the event is now in the not-signaled state.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xE401:&#039;&#039;&#039; Invalid handle. The handle either does not exist, or is not a ReadableEvent nor a WritableEvent.&lt;br /&gt;
&lt;br /&gt;
== MapSharedMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;SharedMemory&amp;gt; || SharedMemoryHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || [[#MemoryPermission]] || MemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps the block supplied by the handle. The required permissions are different for the process that created the handle and all other processes.&lt;br /&gt;
&lt;br /&gt;
Increases reference count for the KSharedMemory object. Thus in order to release the memory associated with the object, all handles to it must be closed and all mappings must be unmapped.&lt;br /&gt;
&lt;br /&gt;
== UnmapSharedMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;SharedMemory&amp;gt; || SharedMemoryHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CreateTransferMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || [[#MemoryPermission]] || MemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;TransferMemory&amp;gt; || TransferMemoryHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one reprotects the src block with perms you give it. It also sets bit0 into [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
Executable bit perm not allowed.&lt;br /&gt;
&lt;br /&gt;
Closing all handles automatically causes the bit0 in [[#MemoryAttribute]] to clear, and the permission to reset.&lt;br /&gt;
&lt;br /&gt;
== CloseHandle ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle || Handle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ResetSignal ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;ReadableEvent&amp;gt; or Handle&amp;lt;Process&amp;gt; || Handle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the signal on the given handle, ensuring future calls to [[#WaitSynchronization]] on this handle will sleep until the handle is signaled again. If the handle is a ReadableEvent, this returns ResultInvalidState if the event is not signaled.&lt;br /&gt;
&lt;br /&gt;
If the handle is a Process, it will clear the signaled state (which is set when the process changes [[#ProcessState]]. Once the process enters the Exited state, calling ResetSignal on the process will no longer have an effect (the process is permanently signaled), and the syscall will return 0xFA01.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success. The signal was reset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xE401:&#039;&#039;&#039; The handle is invalid or of the wrong type.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xFA01:&#039;&#039;&#039; The handle was not signaled, or the process is in exited state, causing it to be permanently signaled.&lt;br /&gt;
&lt;br /&gt;
== WaitSynchronization ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R1 || Handle* || HandlesPtr&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || int32_t || HandlesNum&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R0, R3 || int64_t || Timeout&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || uint64_t || HandleIndex&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Works with HandlesNum &amp;lt;= 0x40.&lt;br /&gt;
&lt;br /&gt;
When zero handles are passed, this will wait forever until either timeout or cancellation occurs.&lt;br /&gt;
&lt;br /&gt;
Does not accept 0xFFFF8001 or 0xFFFF8000 as handles.&lt;br /&gt;
&lt;br /&gt;
=== Object types ===&lt;br /&gt;
&#039;&#039;&#039;KDebug:&#039;&#039;&#039; signals when there is a new [[#DebugEventInfo|DebugEvent]] (retrievable via [[#GetDebugEvent]]).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;KClientPort:&#039;&#039;&#039; signals when the number of sessions is less than the maximum allowed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;KProcess:&#039;&#039;&#039; signals when the process undergoes a state change (retrievable via [[#GetProcessInfo]]).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;KReadableEvent:&#039;&#039;&#039; signals when the event&#039;s corresponding KWritableEvent has been signaled via [[#SignalEvent]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;KServerPort:&#039;&#039;&#039; signals when there is an incoming connection waiting to be [[#AcceptSession|accepted]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;KServerSession:&#039;&#039;&#039; signals when there is an incoming message waiting to be [[#ReplyAndReceive|received]] or the pipe is closed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;KThread:&#039;&#039;&#039; signals when the thread has exited.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success. One of the objects was signaled before the timeout expired, or one of the objects is a Session with a closed remote. Handle index is updated to indicate which object signaled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0x7601:&#039;&#039;&#039; Thread termination requested. Handle index is not updated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xe401:&#039;&#039;&#039; Invalid handle. Returned when one of the handles passed is invalid. Handle index is not updated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xe601:&#039;&#039;&#039; Invalid address. Returned when the handles pointer is not a readable address. Handle index is not updated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xea01:&#039;&#039;&#039; Timeout. Returned when no objects have been signaled within the timeout. Handle index is not updated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xec01:&#039;&#039;&#039; Interrupted. Returned when another thread uses [[#CancelSynchronization]] to cancel this thread. Handle index is not updated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xee01:&#039;&#039;&#039; Too many handles. Returned when the number of handles passed is &amp;gt; 0x40.&lt;br /&gt;
&lt;br /&gt;
== CancelSynchronization ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the referenced thread is currently in a synchronization call ([[#WaitSynchronization]], [[#ReplyAndReceive]] or [[#ReplyAndReceiveLight]]), that call will be interrupted and return 0xec01.&lt;br /&gt;
If that thread is not currently executing such a synchronization call, the next call to a synchronization call will return 0xec01.&lt;br /&gt;
&lt;br /&gt;
This doesn&#039;t take force-pause (activity/debug pause) into account.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success. The thread was either interrupted or has had its flag set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xe401:&#039;&#039;&#039; Invalid handle. The handle given was either invalid or not a thread handle.&lt;br /&gt;
&lt;br /&gt;
== ArbitrateLock ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || uint32_t || Tag&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;                                  &lt;br /&gt;
&lt;br /&gt;
== ArbitrateUnlock ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== WaitProcessWideKeyAtomic ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0 || void* || KeyAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R1 || void* || TagAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || uint32_t || Tag&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R3, R4 || int64_t || Timeout&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SignalProcessWideKey ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || int32_t || Value&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetSystemTick ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X0 || R0, R1 || uint64_t || Ticks&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the value of cntpct_el0.&lt;br /&gt;
&lt;br /&gt;
The frequency is 19200000 Hz (constant from official sw).&lt;br /&gt;
&lt;br /&gt;
Official sw reads cntpct_el0 directly from usermode without using this SVC. [[ExeFS|sdk-nso]] has this SVC, but it&#039;s not known to be called anywhere.&lt;br /&gt;
&lt;br /&gt;
== ConnectToNamedPort ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || char* || PortName&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;Session&amp;gt; || SessionHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SendSyncRequestLight ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Session&amp;gt; || SessionHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SendSyncRequest ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Session&amp;gt; || SessionHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SendSyncRequestWithUserBuffer ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || Handle&amp;lt;Session&amp;gt; || SessionHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Size and Address must be 0x1000-aligned.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xcc01:&#039;&#039;&#039; Address is not 0x1000-aligned.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xca01:&#039;&#039;&#039; Size is not 0x1000-aligned.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xce01:&#039;&#039;&#039; KSessionRequest allocation failed (unlikely) or pointer buffer size exceeded.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xe401:&#039;&#039;&#039; Handles does not exist, or handle is not an instance of KClientSession.&lt;br /&gt;
&lt;br /&gt;
== SendAsyncRequestWithUserBuffer ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || Handle&amp;lt;Session&amp;gt; || SessionHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;ReadableEvent&amp;gt; || EventHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Size and Address must be 0x1000-aligned.&lt;br /&gt;
&lt;br /&gt;
== GetProcessId ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1, R2 || uint64_t || ProcessId&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetThreadId ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1, R2 || uint64_t || ThreadId&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Break ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || [[#BreakReason]] || BreakReason&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t ||&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Info&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the process is attached, report the Break event. Then, if [[#ContinueDebugEvent]] didn&#039;t apply IgnoreException on the thread: if TPIDR_EL0 is 0, adjust ELR_EL1 to retry to svc instruction (and set TPIDR_EL0 to 1).&lt;br /&gt;
&lt;br /&gt;
Otherwise, if bit31 in reason isn&#039;t set, perform crash reporting (see Exception Handling section below), if it doesn&#039;t terminate the process adjust ELR_EL1 as well.&lt;br /&gt;
&lt;br /&gt;
Otherwise just return 0.&lt;br /&gt;
&lt;br /&gt;
== OutputDebugString ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || char* || String&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ReturnFromException ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetInfo ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || [[#InfoType]] || InfoType&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || Handle || Handle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R0, R3 || uint64_t || InfoSubType&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1, R2 || uint64_t || Info&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FlushEntireDataCache ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || ||&lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FlushDataCache ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MapPhysicalMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Acts like [[#SetHeapSize]] except you can allocate heap at any address you&#039;d like.&lt;br /&gt;
&lt;br /&gt;
Uses current process pool partition.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCA01:&#039;&#039;&#039; Invalid size passed. It&#039;s either zero or not 4k-aligned&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCC01:&#039;&#039;&#039; Invalid address. (not 4k-aligned)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xDC01:&#039;&#039;&#039; Invalid memory range. It&#039;s either causes overflow, or does not fall into &amp;quot;reserved&amp;quot; address range (aka Alias). See AliasRegionAddress at [[#InfoType]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xFA01:&#039;&#039;&#039; Invalid state. (not enough SystemResource (see [[NPDM#SystemResourceSize]]))&lt;br /&gt;
&lt;br /&gt;
== UnmapPhysicalMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetDebugFutureThreadInfo ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R0, R1 || uint64_t || Timeout&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || uint64_t || LastThreadContextParam0&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X2 || uint64_t || LastThreadContextParam1&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X3 || uint64_t || LastThreadContextParam2&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X4 || uint64_t || LastThreadContextParam3&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X5 || uint64_t ||&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W6 || uint32_t ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetLastThreadInfo ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || uint64_t || LastThreadContextParam0&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X2 || uint64_t || LastThreadContextParam1&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X3 || uint64_t || LastThreadContextParam2&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X4 || uint64_t || LastThreadContextParam3&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X5 || uint64_t ||&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W6 || uint32_t ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetResourceLimitLimitValue ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;ResourceLimit&amp;gt; || ResourceLimitHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || [[#LimitableResource]] || LimitableResource&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1, R2 || int64_t || LimitValue&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetResourceLimitCurrentValue ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;ResourceLimit&amp;gt; || ResourceLimitHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || [[#LimitableResource]] || LimitableResource&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1, R2 || int64_t || CurrentValue&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SetThreadActivity ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || [[#ThreadActivity]] || ThreadActivity&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetThreadContext3 ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || [[#ThreadContext]]* || ThreadContext&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== WaitForAddress ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || [[#ArbitrationType]] || ArbitrationType&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || uint32_t || Value&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R3, R4 || uint64_t || Timeout&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SignalToAddress ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || [[#SignalType]] || SignalType&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || uint32_t || Value&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || R3 || uint32_t || NumToSignal&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0  || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SynchronizePreemptionState ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None ||  || &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetResourceLimitPeakValue ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;ResourceLimit&amp;gt; || ResourceLimitHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || [[#LimitableResource]] || LimitableResource&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1, R2 || int64_t || PeakValue&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DumpInfo ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || [[#DumpInfoType]] || DumpInfoType&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || DumpInfoSubType&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stubbed in retail kernel.&lt;br /&gt;
&lt;br /&gt;
[4.0.0+] This function was removed and replaced by [[#KernelDebug]].&lt;br /&gt;
&lt;br /&gt;
== KernelDebug ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || [[#KernelDebugType]] || KernelDebugType&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || &lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || &lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || uint64_t || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stubbed in retail kernel.&lt;br /&gt;
&lt;br /&gt;
== ChangeKernelTraceState ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || [[#KernelTraceState]] || KernelTraceState&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stubbed in retail kernel.&lt;br /&gt;
&lt;br /&gt;
== CreateSession ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || bool || IsLight&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || uint64_t || Name&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;ServerSession&amp;gt; || ServerSessionHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W2 || Handle&amp;lt;ClientSession&amp;gt; || ClientSessionHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== AcceptSession ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || Handle&amp;lt;Port&amp;gt; || PortHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;ServerSession&amp;gt; || ServerSessionHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0xf201:&#039;&#039;&#039; No session waiting to be accepted&lt;br /&gt;
&lt;br /&gt;
== ReplyAndReceiveLight ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Port&amp;gt; or Handle&amp;lt;ServerSession&amp;gt; || Handle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ReplyAndReceive ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R1 || Handle&amp;lt;Port&amp;gt;* or Handle&amp;lt;ServerSession&amp;gt;* || Handles&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || uint32_t || NumHandles&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || R3 || Handle&amp;lt;ServerSession&amp;gt; || ReplyTargetSessionHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || R0, R4 || uint64_t || Timeout&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || uint32_t || HandleIndex&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If ReplyTargetSessionHandle is not zero, a reply from the TLS will be sent to that session.&lt;br /&gt;
Then it will wait until either of the passed sessions has an incoming message, is closed, a passed port has an incoming connection, or the timeout expires.&lt;br /&gt;
If there is an incoming message, it is copied to the TLS.&lt;br /&gt;
&lt;br /&gt;
If ReplyTargetSessionHandle is zero, the TLS should contain a blank message. If this message has a C descriptor, the buffer it points to will be used as the pointer buffer. See [[IPC_Marshalling#IPC_buffers]]. Note that a pointer buffer cannot be specified if ReplyTargetSessionHandle is not zero.&lt;br /&gt;
&lt;br /&gt;
After being validated, passed handles will be enumerated in order; even if a session has been closed, if one that appears earlier in the list has an incoming message, it will take priority and a result code of 0x0 will be returned.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success. Either a session has an incoming message or a port has an incoming connection. HandleIndex is set appropriately.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xea01:&#039;&#039;&#039; Timeout. No handles were signalled before the timeout expired. HandleIndex is not updated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xf601:&#039;&#039;&#039; Port remote dead. One of the sessions has been closed. HandleIndex is set appropriately.&lt;br /&gt;
&lt;br /&gt;
== ReplyAndReceiveWithUserBuffer ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R3 || Handle&amp;lt;Port&amp;gt;* or Handle&amp;lt;ServerSession&amp;gt;* || Handles&lt;br /&gt;
|-&lt;br /&gt;
| (In) W4 || R0 || uint32_t || NumHandles&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || R4 || Handle&amp;lt;ServerSession&amp;gt; || ReplyTargetSessionHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X6 || R5, R6 || uint64_t || Timeout&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || uint32_t || HandleIndex&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CreateEvent ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || ||&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;WritableEvent&amp;gt; || WritableEventHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W2 || Handle&amp;lt;ReadableEvent&amp;gt; || ReadableEventHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MapPhysicalMemoryUnsafe ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same as [[#MapPhysicalMemory]] except it always uses pool partition 0.&lt;br /&gt;
&lt;br /&gt;
== UnmapPhysicalMemoryUnsafe ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SetUnsafeLimit ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || uint64_t || Limit&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CreateCodeMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;CodeMemory&amp;gt; || CodeMemoryHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Takes an address range with backing memory to create the code memory object.&lt;br /&gt;
&lt;br /&gt;
The memory is initially memset to 0xFF after being locked.&lt;br /&gt;
&lt;br /&gt;
== ControlCodeMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;CodeMemory&amp;gt; || CodeMemoryHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || [[#CodeMemoryOperation]] || CodeMemoryOperation&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R4, R5 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W4 || R6 || [[#MemoryPermission]] || MemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps the backing memory for a CodeMemory object into the current process.&lt;br /&gt;
&lt;br /&gt;
For [[#CodeMemoryOperation|MapOwner]], memory permission must be RW-.&lt;br /&gt;
&lt;br /&gt;
For [[#CodeMemoryOperation|MapSlave]], memory permission must be R-- or R-X.&lt;br /&gt;
&lt;br /&gt;
Operations [[#CodeMemoryOperation|UnmapOwner/UnmapSlave]] unmap memory that was previously mapped this way.&lt;br /&gt;
&lt;br /&gt;
This allows one &amp;quot;secure JIT&amp;quot; process to map the code memory as RW-, and the other &amp;quot;slave&amp;quot; process to map it R-X.&lt;br /&gt;
&lt;br /&gt;
[5.0.0+] Error 0xE401 is now returned when the process owner of the Code memory object is the same as the current process.&lt;br /&gt;
&lt;br /&gt;
== SleepSystem ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || || &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ReadWriteRegister ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || uint64_t || RegisterAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R0 || uint32_t || RwMask&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || R1 || uint32_t || InValue&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || uint32_t || OutValue&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Read/write IO registers with a hardcoded whitelist. Input address is physical-address and must be aligned to 4.&lt;br /&gt;
&lt;br /&gt;
rw_mask is 0 for reading and 0xffffffff for writing. You can also write individual bits by using a mask value.&lt;br /&gt;
&lt;br /&gt;
You can only write to registers inside physical pages 0x70019000 (MC), 0x7001C000 (MC0), 0x7001D000 (MC1), and they all share the same whitelist.&lt;br /&gt;
&lt;br /&gt;
The whitelist is same for writing as for reading.&lt;br /&gt;
&lt;br /&gt;
The whitelist is:&lt;br /&gt;
&lt;br /&gt;
0x054, 0x090, 0x094, 0x098, 0x09c, 0x0a0, 0x0a4, 0x0a8, 0x0ac, 0x0b0, 0x0b4, 0x0b8, 0x0bc, 0x0c0, 0x0c4, 0x0c8, 0x0d0, 0x0d4, 0x0d8, 0x0dc, 0x0e0, 0x100, 0x108, 0x10c, 0x118, 0x11c, 0x124, 0x128, 0x12c, 0x130, 0x134, 0x138, 0x13c, 0x158, 0x15c, 0x164, 0x168, 0x16c, 0x170, 0x174, 0x178, 0x17c, 0x200, 0x204, 0x2e4, 0x2e8, 0x2ec, 0x2f4, 0x2f8, 0x310, 0x314, 0x320, 0x328, 0x344, 0x348, 0x370, 0x374, 0x37c, 0x380, 0x390, 0x394, 0x398, 0x3ac, 0x3b8, 0x3bc, 0x3c0, 0x3c4, 0x3d8, 0x3e8, 0x41c, 0x420, 0x424, 0x428, 0x42c, 0x430, 0x44c, 0x47c, 0x480, 0x484, 0x50c, 0x554, 0x558, 0x55c, 0x670, 0x674, 0x690, 0x694, 0x698, 0x69c, 0x6a0, 0x6a4, 0x6c0, 0x6c4, 0x6f0, 0x6f4, 0x960, 0x970, 0x974, 0xa20, 0xa24, 0xb88, 0xb8c, 0xbc4, 0xbc8, 0xbcc, 0xbd0, 0xbd4, 0xbd8, 0xbdc, 0xbe0, 0xbe4, 0xbe8, 0xbec, 0xc00, 0xc5c, 0xcac&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Whitelist was extended with 0x4c4, 0x4c8, 0x4cc, 0x584, 0x588, 0x58c.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] The IO registers in range 0x7000E400 (PMC) size 0xC00 skip the whitelist, and do a TrustZone call using [[SMC#ReadWriteRegister|ReadWriteRegister]].&lt;br /&gt;
&lt;br /&gt;
[4.0.0+] Access to the Memory Controller (0x70019000) also uses smcReadWriteRegister.&lt;br /&gt;
&lt;br /&gt;
Here is the whitelist imposed by that SMC, relative to the start of the PMC registers:&lt;br /&gt;
&lt;br /&gt;
0x000, 0x00c, 0x010, 0x014, 0x01c, 0x020, 0x02c, 0x030, 0x034, 0x038, 0x03c, 0x040, 0x044, 0x048, 0x0dc, 0x0e0, 0x0e4, 0x160, 0x164, 0x168, 0x170, 0x1a8, 0x1b8, 0x1bc, 0x1c0, 0x1c4, 0x1c8, 0x2b4, 0x2d4, 0x440, 0x4d8&lt;br /&gt;
&lt;br /&gt;
Here is the whitelist imposed by the SMC [[SMC#ReadWriteRegister|ReadWriteRegister]] (checked in addition to the whitelist in the ReadWriteRegister SVC), relative to the start of the MC registers:&lt;br /&gt;
&lt;br /&gt;
0x000, 0x004, 0x008, 0x00C, 0x010, 0x01C, 0x020, 0x030, 0x034, 0x050, 0x054, 0x090, 0x094, 0x098, 0x09C, 0x0A0, 0x0A4, 0x0A8, 0x0AC, 0x0B0, 0x0B4, 0x0B8, 0x0BC, 0x0C0, 0x0C4, 0x0C8, 0x0D0, 0x0D4, 0x0D8, 0x0DC, 0x0E0, 0x100, 0x108, 0x10C, 0x118, 0x11C, 0x124, 0x128, 0x12C, 0x130, 0x134, 0x138, 0x13C, 0x158, 0x15C, 0x164, 0x168, 0x16C, 0x170, 0x174, 0x178, 0x17C, 0x200, 0x204, 0x238, 0x240, 0x244, 0x250, 0x254, 0x258, 0x264, 0x268, 0x26C, 0x270, 0x274, 0x280, 0x284, 0x288, 0x28C, 0x294, 0x2E4, 0x2E8, 0x2EC, 0x2F4, 0x2F8, 0x310, 0x314, 0x320, 0x328, 0x344, 0x348, 0x370, 0x374, 0x37C, 0x380, 0x390, 0x394, 0x398, 0x3AC, 0x3B8, 0x3BC, 0x3C0, 0x3C4, 0x3D8, 0x3E8, 0x41C, 0x420, 0x424, 0x428, 0x42C, 0x430, 0x44C, 0x47C, 0x480, 0x484, 0x4C4, 0x4C8, 0x4CC, 0x50C, 0x554, 0x558, 0x55C, 0x584, 0x588, 0x58C, 0x670, 0x674, 0x690, 0x694, 0x698, 0x69C, 0x6A0, 0x6A4, 0x6C0, 0x6C4, 0x6F0, 0x6F4, 0x960, 0x970, 0x974, 0x9B8, 0xA20, 0xA24, 0xA88, 0xA94, 0xA98, 0xA9C, 0xAA0, 0xAA4, 0xAA8, 0xAAC, 0xAB0, 0xAB4, 0xAB8, 0xABC, 0xAC0, 0xAC4, 0xAC8, 0xACC, 0xAD0, 0xAD4, 0xAD8, 0xADC, 0xAE0, 0xB88, 0xB8C, 0xBC4, 0xBC8, 0xBCC, 0xBD0, 0xBD4, 0xBD8, 0xBDC, 0xBE0, 0xBE4, 0xBE8, 0xBEC, 0xC00, 0xC5C, 0xCAC&lt;br /&gt;
&lt;br /&gt;
== SetProcessActivity ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || [[#ProcessActivity]] || ProcessActivity&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CreateSharedMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || [[#MemoryPermission]] || LocalMemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || [[#MemoryPermission]] || RemoteMemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;SharedMemory&amp;gt; || SharedMemoryHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other perm can be used to enforce permission 1, 3, or 0x10000000 if don&#039;t care.&lt;br /&gt;
&lt;br /&gt;
Allocates memory from the current process&#039; pool partition.&lt;br /&gt;
&lt;br /&gt;
== MapTransferMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || Handle&amp;lt;TransferMemory&amp;gt; || TransferMemoryHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || [[#MemoryPermission]] || MemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must pass same size and permissions as given in [[#CreateTransferMemory]], otherwise error.&lt;br /&gt;
&lt;br /&gt;
== UnmapTransferMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || Handle&amp;lt;TransferMemory&amp;gt; || TransferMemoryHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Size must match size given in map syscall, otherwise there&#039;s an invalid-size error.&lt;br /&gt;
&lt;br /&gt;
== CreateInterruptEvent ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || [[#Interrupt]] || Interrupt&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || [[#InterruptType]] || InterruptType&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;ReadableEvent&amp;gt; || ReadableEventHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an event handle for the given IRQ number. Waiting on this handle will wait until the IRQ is triggered. The InterruptType argument configures the triggering. If it is 0, the IRQ is active HIGH level sensitive, if it is 1 it is rising-edge sensitive.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xF001:&#039;&#039;&#039; Flags was &amp;gt; 1&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xF201:&#039;&#039;&#039; IRQ above 0x3FF or outside the [[NPDM#Kernel_Access_Control|IRQ access mask]] was given.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCE01:&#039;&#039;&#039; A SlabHeap was exhausted (too many interrupts created).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xF401:&#039;&#039;&#039; IRQ already has an event registered.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xD201:&#039;&#039;&#039; The handle table is full. Try closing some handles.&lt;br /&gt;
&lt;br /&gt;
== QueryPhysicalAddress ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || VirtualAddress&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]]|| Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || uint64_t || PhysicalMemoryInfoAddress&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X2 || uint64_t || PhysicalMemoryInfoBaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X3 || uint64_t || PhysicalMemoryInfoSize&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries the physical address of a virtual address. Will always fetch the lowest page-aligned mapping that contains the provided physical address.&lt;br /&gt;
&lt;br /&gt;
The returned PhysicalMemoryInfoBaseAddress is the virtual address of that page-aligned mapping, while PhysicalMemoryInfoAddress is the physical address of that page. PhysicalMemoryInfoSize is the amount of continuous physical memory in that mapping.&lt;br /&gt;
&lt;br /&gt;
== QueryIoMapping ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || uint64_t || IoAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R0 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1 || void* || VirtualAddress&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a virtual address mapped to a given IO range.&lt;br /&gt;
&lt;br /&gt;
== CreateDeviceAddressSpace ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || uint64_t || DeviceAddressSpaceStartAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R0, R1 || uint64_t || DeviceAddressSpaceEndAddress&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || Handle&amp;lt;DeviceAddressSpace&amp;gt; || DeviceAddressSpaceHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a virtual address space for binding device address spaces and returns a handle.&lt;br /&gt;
&lt;br /&gt;
StartAddr is normally set to 0 and EndAddr is normally set to 0xFFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== AttachDeviceAddressSpace ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || [[#DeviceName]] || DeviceName&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || Handle&amp;lt;DeviceAddressSpace&amp;gt; || DeviceAddressSpaceHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a device address space to a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== DetachDeviceAddressSpace ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || [[#DeviceName]] || DeviceName&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || Handle&amp;lt;DeviceAddressSpace&amp;gt; || DeviceAddressSpaceHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a device address space from a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== MapDeviceAddressSpaceByForce ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;DeviceAddressSpace&amp;gt; || DeviceAddressSpaceHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R4 || uint64_t || DeviceAddressSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || R5, R6 || uint64_t || DeviceAddressSpaceAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || R7 || uint32_t || Option&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
Address is the userspace destination address, while DeviceAddressSpaceAddress is the source address between DeviceAddressSpaceStartAddress and DeviceAddressSpaceEndAddress (passed to [[#CreateDeviceAddressSpace]]).&lt;br /&gt;
&lt;br /&gt;
The userspace destination address must have the [[SVC#MemoryState|FlagCanDeviceMap]] bit set. Bit [[SVC#MemoryAttribute|DeviceShared]] will be set after mapping.&lt;br /&gt;
&lt;br /&gt;
The Option encodes a [[#MemoryPermission]] in the low 16 bits, and an indicator of IO mapping in the high bits.&lt;br /&gt;
&lt;br /&gt;
== MapDeviceAddressSpaceAligned ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;DeviceAddressSpace&amp;gt; || DeviceAddressSpaceHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R4 || uint64_t || DeviceAddressSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || R5, R6 || uint64_t || DeviceAddressSpaceAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || R7 || uint32_t  || Option&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
Same as [[#MapDeviceAddressSpaceByForce]], but the userspace destination address must have the [[SVC#MemoryState|FlagCanAlignedDeviceMap]] bit set instead.&lt;br /&gt;
&lt;br /&gt;
The Option encodes a [[#MemoryPermission]] in the low 16 bits, and an indicator of IO mapping in the high bits.&lt;br /&gt;
&lt;br /&gt;
== MapDeviceAddressSpace ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;DeviceAddressSpace&amp;gt; || DeviceAddressSpaceHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R0, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || R4 || uint64_t || DeviceAddressSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| (In) X5 || R5, R6 || uint64_t || DeviceAddressSpaceAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) W6 || R7 || [[#MemoryPermission]] || MemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1 || uint64_t || Size&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== UnmapDeviceAddressSpace ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;DeviceAddressSpace&amp;gt; || DeviceAddressSpaceHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R4 || uint64_t || DeviceAddressSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || R5, R6 || uint64_t || DeviceAddressSpaceAddress&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unmaps an attached device address space from an userspace address.&lt;br /&gt;
&lt;br /&gt;
== InvalidateProcessDataCache ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R1, R4 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== StoreProcessDataCache ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R1, R4 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FlushProcessDataCache ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R1, R4 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DebugActiveProcess ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || uint64_t || ProcessId&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BreakDebugProcess ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== TerminateDebugProcess ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetDebugEvent ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || [[#DebugEventInfo]]* || DebugEventInfo&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ContinueDebugEvent ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || uint32_t || [[#ContinueDebugFlags]] ([1.0.0-2.3.0] [[#ContinueDebugFlagsOld]])&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2 ([1.0.0-2.3.0] R2, R3) || uint64_t* ([1.0.0-2.3.0] uint64_t)|| ThreadIdList ([1.0.0-2.3.0] ThreadId)&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R3 || uint64_t || [3.0.0+] NumThreadIds&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maximum NumThreadIds is 64. 0 means &amp;quot;all threads&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success. The process has been resumed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xe401:&#039;&#039;&#039; Invalid debug handle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xf401:&#039;&#039;&#039; Process has debug events queued or is already running.&lt;br /&gt;
&lt;br /&gt;
== GetProcessList ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R1 || uint64_t* || ProcessIdBuffer&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || uint32_t || ProcessIdBufferSize&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || uint32_t || NumProcesses&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fills the provided array with the pids of currently living processes. A process &amp;quot;lives&amp;quot; so long as it is currently running or a handle to it still exists.&lt;br /&gt;
&lt;br /&gt;
It returns the total number of processes currently alive. If this number is bigger than the size of ProcessIdBuffer, the user won&#039;t have all the pids.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xd401:&#039;&#039;&#039; The provided buffer is outside the process address space.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xe601:&#039;&#039;&#039; copyToUser failed. The provided buffer is not user-accessible.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xee01:&#039;&#039;&#039; The provided buffer size is too big. Max value is 0xFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== GetThreadList ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R1 || uint64_t* || ThreadIdBuffer&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || uint32_t || ThreadIdBufferSize&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || R3 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || uint32_t || NumThreads&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetDebugThreadContext ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0 || [[#ThreadContext]]* || ThreadContext&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R1 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || uint64_t || ThreadId&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || R4 || uint32_t || [[#ThreadContextFlags]]&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SetDebugThreadContext ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || uint64_t || ThreadId&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R1 || [[#ThreadContext]]* || ThreadContext&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || R4 || uint32_t || [[#ThreadContextFlags]]&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== QueryDebugProcessMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || [[#MemoryInfo]]* || MemoryInfo&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || [[#PageInfo]] || PageInfo&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ReadDebugProcessMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || MemoryBufferAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || void* || SrcAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== WriteDebugProcessMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || MemoryBufferAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || void* || DstAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SetHardwareBreakPoint ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || [[#HardwareBreakPointRegisterName]] || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || uint64_t || Flags&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R1, R4 || uint64_t || Value&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets one of the AArch64 hardware breakpoints. The nintendo switch has 6 hardware breakpoints, and 4 hardware watchpoints. The syscall has two behaviors depending on the value of HardwareBreakPointRegisterName:&lt;br /&gt;
&lt;br /&gt;
If HardwareBreakPointRegisterName &amp;lt; 0x10, then it sets one of the AArch64 hardware breakpoints. Flags will go to DBGBCRn_EL1, and value to DBGBVRn_EL1. The only flags the user is allowed to set are those in the bitmask 0x7F01E1. Furthermore, the kernel will or it with 0x4004, in order to set various security flags to guarantee the watchpoints only triggers for code in EL0. If the user asks for a Breakpoint Type of ContextIDR match, the kernel shall use the given DebugHandle to set DBGBVRn_EL1 to the ContextID of the debugged process.&lt;br /&gt;
&lt;br /&gt;
If HardwareBreakPointRegisterName is between 0x10 and 0x20 (exclusive), then it sets one of the AArch64 hardware watchpoints. Flags will go to DBGWCRn_EL1, and the value to DBGWVRn_EL1. The only flags the user is allowed to set are those in the bitmask 0xFF0F1FF9. Furthermore, the kernel will or it with 0x104004. This will set various security flags, and set the watchpoint type to be a Linked Watchpoint. This means that you need to link it to a Linked ContextIDR breakpoint. Check the ARM documentation for more information.&lt;br /&gt;
&lt;br /&gt;
Note that HardwareBreakPointRegisterName 0 to 4 match only to Virtual Address, while HardwareBreakPointRegisterName 5 and 6 match against either Virtual Address, ContextID, or VMID. As such, if you are configuring a breakpoint to link for a watchpoint, make sure you use hardware_breakpoint_id 5 or 6.&lt;br /&gt;
&lt;br /&gt;
For more documentation for hardware breakpoints, check out the AArch64 documentation for the [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0488h/way1382455558968.html DBGBCRn_EL1 register] and the [http://infocenter.arm.com/help/topic/com.arm.doc.ddi0488h/way1382455560629.html DBGWCRn_EL1 register]&lt;br /&gt;
&lt;br /&gt;
== GetDebugThreadParam ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R0, R1 || uint64_t || ThreadId&lt;br /&gt;
|-&lt;br /&gt;
| (In) W4 || R3 || [[#DebugThreadParam]] || DebugThreadParam&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1, R2 || uint64_t || Out0&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W2 || R3 || uint32_t || Out1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetSystemInfo ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || [[#SystemInfoType]] || SystemInfoType&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || Handle || Handle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || uint64_t || SystemInfoSubType&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || uint64_t || SystemInfo&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CreatePort ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || int32_t || MaxSessions&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || R3 || bool || IsLight&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || R0 || uint64_t || Name&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || Handle&amp;lt;Port&amp;gt; || ServerPortHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W2 || R2 || Handle&amp;lt;Port&amp;gt; || ClientPortHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ManageNamedPort ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || char* || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || int32_t || MaxSessions&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;Port&amp;gt; || ServerPortHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ConnectToPort ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || Handle&amp;lt;Port&amp;gt; || ClientPortHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;Session&amp;gt; || SessionHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SetProcessMemoryPermission ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || void* || Addr&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R1, R4 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || R5 || [[#MemoryPermission]] || MemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the memory permissions for the specified memory with the supplied process handle.&lt;br /&gt;
&lt;br /&gt;
This throws an error(0xD801) when the input perm is &amp;gt;0x5, hence -WX and RWX are not allowed.&lt;br /&gt;
&lt;br /&gt;
== MapProcessMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0 || void* || DstAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || void* || SrcAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R4 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps the src address from the supplied process handle into the current process.&lt;br /&gt;
&lt;br /&gt;
This allows mapping code and rodata with RW- permission.&lt;br /&gt;
&lt;br /&gt;
== UnmapProcessMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0 || void* || DstAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || void* || SrcAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R4 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unmaps what was mapped by [[#MapProcessMemory]].&lt;br /&gt;
&lt;br /&gt;
== QueryProcessMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0 || [[#MemoryInfo]]* || MemoryInfo&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R1, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || [[#PageInfo]] || PageInfo&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equivalent to [[#QueryMemory]] except takes a process handle.&lt;br /&gt;
&lt;br /&gt;
== MapProcessCodeMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || void* || DstAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R1, R4 || void* || SrcAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R5, R6 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Takes a process handle, and maps normal heap in that process as executable code in that process. Used when loading NROs. This does not support using the current-process handle alias.&lt;br /&gt;
&lt;br /&gt;
== UnmapProcessCodeMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || void* || DstAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R1, R4 || void* || SrcAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R5, R6 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unmaps what was mapped by [[#MapProcessCodeMemory]].&lt;br /&gt;
&lt;br /&gt;
== CreateProcess ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || [[#CreateProcessParameter]]* || CreateProcessParameter&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint32_t* || Capabilities&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || int32_t || CapabilitiesNum&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Takes a [[#CreateProcessParameter]] as input.&lt;br /&gt;
Capabilities points to an array of [[NPDM#Kernel_Access_Control|kernel capabilities]].&lt;br /&gt;
CapabilitiesNum is a number of capabilities in the Capabilities array (number of element, not number of bytes).&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCA01:&#039;&#039;&#039; Attempted to map more code pages than available in address space.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCC01:&#039;&#039;&#039; Provided CodeAddr is invalid (make sure it&#039;s in range?)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xE401:&#039;&#039;&#039; The resource handle passed is invalid.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xE601:&#039;&#039;&#039; Attempt to copy procinfo from user-supplied pointer failed. Attempt to copy capabilities_num from user-supplied pointer failed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xE801:&#039;&#039;&#039; Attempted to create a 32-bit process with a 36-bit address space.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xF001:&#039;&#039;&#039; Unused bits are set in mmuflags. Unknown address space type used.&lt;br /&gt;
&lt;br /&gt;
== StartProcess ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || int32_t || MainThreadPriority&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || int32_t || DefaultCpuId&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R3, R4 || uint64_t || MainThreadStackSize&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== TerminateProcess ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetProcessInfo ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R1 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R2 || [[#ProcessInfoType]] || ProcessInfoType&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1, R2 || uint64_t || [[#ProcessState]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an enum with value 0-7.&lt;br /&gt;
&lt;br /&gt;
== CreateResourceLimit ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || ||&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;ResourceLimit&amp;gt; || ResourceLimitHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SetResourceLimitLimitValue ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;ResourceLimit&amp;gt; || ResourceLimitHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || [[#LimitableResource]] || LimitableResource&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || int64_t || LimitValue&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CallSecureMonitor ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0 || uint64_t || [[SMC#Secure_Monitor_calls|FunctionId]]&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1-X7 || R1-R7 || uint64_t || SMC arguments&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X0 || R0 || [[SMC#Result|Result]] || SMC result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1-X7 || R1-R7 || uint64_t || SMC output&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Takes in a SMC function ID in X0, and arguments for that SMC function in X1-X7.&lt;br /&gt;
&lt;br /&gt;
Passing an invalid SMC function ID or calling from a core other than core 3 will result in a secure monitor panic.&lt;br /&gt;
&lt;br /&gt;
The kernel parses bits 9-15 in the passed SMC function ID (per the ARM SMC calling convention), and when set uses as an indicator to translate a pointer in the associated register (X1-X7) to a physical address. The kernel will translate any address mapped as R-W, other addresses (R--, R-X, or invalid pointers) will be translated as 0/NULL.&lt;br /&gt;
&lt;br /&gt;
Output is returned raw from the Secure Monitor; X0 will be the untranslated SMC result and X1-X7 will contain other SMC output (or be unchanged, depending on the SMC).&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
[2.0.0+] Exactly 6 debug SVCs require that [[SPL_services#GetConfig|IsDebugMode]] is non-zero. Error 0x4201 is returned otherwise.&lt;br /&gt;
* BreakDebugProcess&lt;br /&gt;
* ContinueDebugEvent&lt;br /&gt;
* WriteDebugProcessMemory&lt;br /&gt;
* SetDebugThreadContext&lt;br /&gt;
* TerminateDebugProcess&lt;br /&gt;
* SetHardwareBreakPoint&lt;br /&gt;
&lt;br /&gt;
DebugActiveProcess stops execution of the target process, the normal method for resuming it requires ContinueDebugEvent(see above). Closing the debug handle also results in execution being resumed.&lt;br /&gt;
&lt;br /&gt;
= Enum/Structures =&lt;br /&gt;
== InfoType ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Handle type || InfoType || InfoSubType || Description&lt;br /&gt;
|-&lt;br /&gt;
| Process || 0 || 0 || CoreMask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 1 || 0 || PriorityMask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 2 || 0 || AliasRegionAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 3 || 0 || AliasRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 4 || 0 || HeapRegionAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 5 || 0 || HeapRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 6 || 0 || TotalMemorySize. Total memory available(free+used).&lt;br /&gt;
|-&lt;br /&gt;
| Process || 7 || 0 || UsedMemorySize. Total used size of codebin memory + main-thread stack + allocated heap.&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 8 || 0 || DebuggerAttached&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 9 || 0 || ResourceLimit&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 10 || -1, {current coreid} || IdleTickCount&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 11 || 0-3 || RandomEntropy. Used to seed usermode PRNGs.&lt;br /&gt;
|-&lt;br /&gt;
| Process || 12 || 0 || [2.0.0+] AslrRegionAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 13 || 0 || [2.0.0+] AslrRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 14 || 0 || [2.0.0+] StackRegionAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 15 || 0 || [2.0.0+] StackRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 16 || 0 || [3.0.0+] SystemResourceSizeTotal&lt;br /&gt;
|-&lt;br /&gt;
| Process || 17 || 0 || [3.0.0+] SystemResourceSizeUsed&lt;br /&gt;
|-&lt;br /&gt;
| Process || 18 || 0 || [3.0.0+] ProgramId&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 19 || 0 || [4.0.0-4.1.0] InitialProcessIdRange_LowerBound&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 19 || 1 || [4.0.0-4.1.0] InitialProcessIdRange_UpperBound&lt;br /&gt;
|-&lt;br /&gt;
| Process || 20 || 0 || [5.0.0+] UserExceptionContextAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 21 || 0 || [6.0.0+] TotalNonSystemMemorySize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 22 || 0 || [6.0.0+] UsedNonSystemMemorySize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 23 || 0 || [9.0.0+] IsApplication&lt;br /&gt;
|-&lt;br /&gt;
| Process || 24 || 0 || [11.0.0+] FreeThreadCount&lt;br /&gt;
|-&lt;br /&gt;
| Thread  || 25 ([1.0.0-12.1.0] 0xF0000002) || 0-3, -1 || ThreadTickCount. When 0-3 are passed, gets specific core CPU ticks spent on thread. When -1 is passed, gets total CPU ticks spent on thread.&lt;br /&gt;
|-&lt;br /&gt;
| Process || 26 || 0 || [14.0.0+] IsSvcPermitted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SystemInfoType ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Handle type || SystemInfoType || SystemInfoSubType || Description&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 0 || 0 || TotalPhysicalMemorySize_Application&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 0 || 1 || TotalPhysicalMemorySize_Applet&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 0 || 2 || TotalPhysicalMemorySize_System&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 0 || 3 || TotalPhysicalMemorySize_SystemUnsafe&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 1 || 0 || UsedPhysicalMemorySize_Application&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 1 || 1 || UsedPhysicalMemorySize_Applet&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 1 || 2 || UsedPhysicalMemorySize_System&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 1 || 3 || UsedPhysicalMemorySize_SystemUnsafe&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 2 || 0 || InitialProcessIdRange_LowerBound&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 2 || 1 || InitialProcessIdRange_UpperBound&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ThreadContextFlags ==&lt;br /&gt;
Bitfield of one of more of these:&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bit || Bitmask || Name || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1 || General-purpose registers || If in 64-bit mode, GPRs 0–28 will be read/written. If in 32-bit mode, GPRs 0–12 will be read/written.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 2 || Control registers || Reads/writes the FP, LR, PC, SP, PSTATE, and TPIDR registers.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 4 || Floating-point registers || Reads/writes the floating-point vector registers.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 8 || Floating-point control registers || Reads/writes the FPCR and FPSR registers.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DeviceName ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || AFI&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AVPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DC&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DCB&lt;br /&gt;
|-&lt;br /&gt;
| 4 || HC&lt;br /&gt;
|-&lt;br /&gt;
| 5 || HDA&lt;br /&gt;
|-&lt;br /&gt;
| 6 || ISP2&lt;br /&gt;
|-&lt;br /&gt;
| 7 || MSENCNVENC&lt;br /&gt;
|-&lt;br /&gt;
| 8 || NV&lt;br /&gt;
|-&lt;br /&gt;
| 9 || NV2&lt;br /&gt;
|-&lt;br /&gt;
| 10 || PPCS&lt;br /&gt;
|-&lt;br /&gt;
| 11 || SATA&lt;br /&gt;
|-&lt;br /&gt;
| 12 || VI&lt;br /&gt;
|-&lt;br /&gt;
| 13 || VIC&lt;br /&gt;
|-&lt;br /&gt;
| 14 || XUSB_HOST&lt;br /&gt;
|-&lt;br /&gt;
| 15 || XUSB_DEV&lt;br /&gt;
|-&lt;br /&gt;
| 16 || TSEC&lt;br /&gt;
|-&lt;br /&gt;
| 17 || PPCS1&lt;br /&gt;
|-&lt;br /&gt;
| 18 || DC1&lt;br /&gt;
|-&lt;br /&gt;
| 19 || SDMMC1A&lt;br /&gt;
|-&lt;br /&gt;
| 20 || SDMMC2A&lt;br /&gt;
|-&lt;br /&gt;
| 21 || SDMMC3A&lt;br /&gt;
|-&lt;br /&gt;
| 22 || SDMMC4A&lt;br /&gt;
|-&lt;br /&gt;
| 23 || ISP2B&lt;br /&gt;
|-&lt;br /&gt;
| 24 || GPU&lt;br /&gt;
|-&lt;br /&gt;
| 25 || GPUB&lt;br /&gt;
|-&lt;br /&gt;
| 26 || PPCS2&lt;br /&gt;
|-&lt;br /&gt;
| 27 || NVDEC&lt;br /&gt;
|-&lt;br /&gt;
| 28 || APE&lt;br /&gt;
|-&lt;br /&gt;
| 29 || SE&lt;br /&gt;
|-&lt;br /&gt;
| 30 || NVJPG&lt;br /&gt;
|-&lt;br /&gt;
| 31 || HC1&lt;br /&gt;
|-&lt;br /&gt;
| 32 || SE1&lt;br /&gt;
|-&lt;br /&gt;
| 33 || AXIAP&lt;br /&gt;
|-&lt;br /&gt;
| 34 || ETR&lt;br /&gt;
|-&lt;br /&gt;
| 35 || TSECB&lt;br /&gt;
|-&lt;br /&gt;
| 36 || TSEC1&lt;br /&gt;
|-&lt;br /&gt;
| 37 || TSECB1&lt;br /&gt;
|-&lt;br /&gt;
| 38 || NVDEC1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CodeMemoryOperation ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || MapOwner&lt;br /&gt;
|-&lt;br /&gt;
| 1 || MapSlave&lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnmapOwner&lt;br /&gt;
|-&lt;br /&gt;
| 3 || UnmapSlave&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LimitableResource ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || PhysicalMemoryMax || Bytes of memory a process may allocate.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ThreadCountMax || Amount of threads a process can create.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || EventCountMax || Amount of events a process can create through [[#CreateEvent]] or [[#SendAsyncRequestWithUserBuffer]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || TransferMemoryCountMax || Amount of TransferMemory a process can create through [[#CreateTransferMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || SessionCountMax || Amount of session a process can create through [[#CreateSession]], [[#ConnectToPort]] or [[#ConnectToNamedPort]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ThreadActivity =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Runnable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ProcessActivity ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Runnable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ProcessInfoType ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ProcessState|ProcessState]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ProcessState ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Created ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreatedAttached ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Started ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Crashed || Processes will not enter this state unless they were created with [[#CreateProcessParameter|EnableDebug]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || StartedAttached ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Exiting ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Exited ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DebugSuspended ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DebugThreadParam ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || DynamicPriority&lt;br /&gt;
|-&lt;br /&gt;
| 1 || SchedulingStatus&lt;br /&gt;
|-&lt;br /&gt;
| 2 || PreferredCpuCore&lt;br /&gt;
|-&lt;br /&gt;
| 3 || CurrentCpuCore&lt;br /&gt;
|-&lt;br /&gt;
| 4 || AffinityMask&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Dynamic priority: output in out2&lt;br /&gt;
&lt;br /&gt;
Scheduling status: out1 contains bit0: is debug-suspended, bit1: is user-suspended ([[#SetThreadActivity]] 1 or [[#SetProcessActivity]] 1).&lt;br /&gt;
Out2 contains {suspended, idle, running, terminating} =&amp;gt; {5, 0, 1, 4}&lt;br /&gt;
&lt;br /&gt;
PreferredCpuCore: output in out2&lt;br /&gt;
&lt;br /&gt;
CurrentCpuCore: output in out2&lt;br /&gt;
&lt;br /&gt;
AffinityMask: output in out1&lt;br /&gt;
&lt;br /&gt;
== CreateProcessParameter ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 12 || || ProcessName (doesn&#039;t have to be null-terminated)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || 4 || || ProcessCategory (0: regular title, 1: kernel built-in)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 8 || || TitleId&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 8 || || CodeAddr&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || || CodeNumPages&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || || Flags&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit0 || Is64BitInstruction&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit3-1 || [[#AddressSpaceType]]&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit4 || [2.0.0+] EnableDebug&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit5 || EnableAslr&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit6 || IsApplication&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit7 || [4.0.0] UseSecureMemory&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit10-7 || [5.0.0+] MemoryRegion (0 = Application, 1 = Applet, 2 = SecureSystem, 3 = NonSecureSystem)&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit11 || [7.0.0+] OptimizeMemoryAllocation (only allowed in combination with IsApplication)&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 4 || || ResourceLimitHandle (can be zero)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 4 || || [3.0.0+] SystemResourceNumPages&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On [1.0.0] there&#039;s only one MemoryRegion.&lt;br /&gt;
&lt;br /&gt;
On [2.0.0-4.0.0] MemoryRegion is 1 for built-ins and 0 for rest.&lt;br /&gt;
&lt;br /&gt;
On [5.0.0] MemoryRegion is specified in CreateProcessArgs. There are now 4 pool partitions.&lt;br /&gt;
&lt;br /&gt;
On [5.0.0] (maybe lower?) a zero ResourceLimitHandle defaults to sysmodule limits and 0x12300000 bytes of memory.&lt;br /&gt;
&lt;br /&gt;
The PersonalMmHeap are allocated as follows:&lt;br /&gt;
* For the application, normal insecure pool is used. Carveout 5 is used to provide protection.&lt;br /&gt;
* For the applet, a pre-allocated secure pool segment of size 0x400000 is used.&lt;br /&gt;
* For sysmodules, secure pool is allocated.&lt;br /&gt;
&lt;br /&gt;
=== AddressSpaceType ===&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Type || Name || Width || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || AddressSpace32Bit || 32 ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AddressSpace64BitOld || 36 ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || AddressSpace32BitNoReserved || 32 || Appears to be missing map region [?]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] AddressSpace64Bit || 39 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 8 || BaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 8 || Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 4 || [[#MemoryType]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 4 || [[#MemoryAttribute]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 4 || [[#MemoryPermission]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || 4 || IpcRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || DeviceRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || Padding: always zero&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryPermission ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Name || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Read || Can be set by [[#SetMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Write || Can be set by [[#SetMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Execute || Can be set by [[#SetProcessMemoryPermission]] and [[#ControlCodeMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| 28 || DontCare ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryAttribute ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Name || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Locked || Used by MapMemory, as an async IPC user buffer.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || IpcLocked || True when IpcRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeviceShared || True when DeviceRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Uncached || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryState ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Description || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 7-0 || [[#MemoryType]] || &lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#SetMemoryPermission|FlagCanReprotect]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 9 || FlagCanDebug || Allows using [[#WriteDebugProcessMemory]] on segments mapped read-only.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || FlagCanUseIpc || Allows sending this region as an IPC A/B/W buffer with flags=0.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || FlagCanUseNonDeviceIpc || Allows sending this region as an IPC A/B/W buffer with flags=1.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || FlagCanUseNonSecureIpc || Allows sending this region as an IPC A/B/W buffer with flags=3.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || FlagMapped ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#SetProcessMemoryPermission|FlagCode]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [[#MapMemory|FlagCanAlias]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#MapProcessCodeMemory|FlagCanCodeAlias]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [[#CreateTransferMemory|FlagCanTransfer]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [[#QueryPhysicalAddress|FlagCanQueryPhysical]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [[#MapDeviceAddressSpace|FlagCanDeviceMap]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#MapDeviceAddressSpaceAligned|FlagCanAlignedDeviceMap]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#SendSyncRequestWithUserBuffer|FlagCanIpcUserBuffer]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 22 || FlagReferenceCounted || The physical memory blocks backing this region are refcounted.&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [[#MapProcessMemory|FlagCanMapProcess]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [[#SetMemoryAttribute|FlagCanChangeAttribute]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] [[#CreateCodeMemory|FlagCanCodeMemory]] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== MemoryType ===&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Type || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000000 || Free ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x00002001 || Io || Mapped by kernel capability parsing in [[#CreateProcess]]. &lt;br /&gt;
|-&lt;br /&gt;
| 0x00042002 || Static || Mapped by kernel capability parsing in [[#CreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00DC7E03 || Code || Mapped during [[#CreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| [1.0.0+]&lt;br /&gt;
&lt;br /&gt;
0x01FEBD04&lt;br /&gt;
&lt;br /&gt;
[4.0.0+]&lt;br /&gt;
&lt;br /&gt;
0x03FEBD04&lt;br /&gt;
|| CodeData || Transition from 0xDC7E03 performed by [[#SetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| [1.0.0+]&lt;br /&gt;
0x017EBD05&lt;br /&gt;
&lt;br /&gt;
[4.0.0+]&lt;br /&gt;
&lt;br /&gt;
0x037EBD05&lt;br /&gt;
|| Normal || Mapped using [[#SetHeapSize]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00402006 || Shared || Mapped using [[#MapSharedMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00482907 || [1.0.0] Alias || Mapped using [[#MapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00DD7E08 || AliasCode || Mapped using [[#MapProcessCodeMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| [1.0.0+]&lt;br /&gt;
&lt;br /&gt;
0x01FFBD09&lt;br /&gt;
&lt;br /&gt;
[4.0.0+]&lt;br /&gt;
&lt;br /&gt;
0x03FFBD09&lt;br /&gt;
|| AliasCodeData || Transition from 0xDD7E08 performed by [[#SetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x005C3C0A || [[IPC_Marshalling|Ipc]] || IPC buffers with descriptor flags=0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x005C3C0B || Stack || Mapped using [[#MapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x0040200C || [[Thread Local Storage|ThreadLocal]] || Mapped during [[#CreateThread]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x015C3C0D || Transfered || Mapped using [[#MapTransferMemory]] when the owning process has perm=0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x005C380E || SharedTransfered || Mapped using [[#MapTransferMemory]] when the owning process has perm!=0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0040380F || SharedCode || Mapped using [[#MapProcessMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000010 || Inaccessible ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x005C3811 || [[IPC_Marshalling|NonSecureIpc]] || IPC buffers with descriptor flags=1.&lt;br /&gt;
|-&lt;br /&gt;
| 0x004C2812 || [[IPC_Marshalling|NonDeviceIpc]] || IPC buffers with descriptor flags=3.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00002013 || Kernel || Mapped in kernel during [[#CreateThread]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00402214 || [4.0.0+] GeneratedCode || Mapped in kernel during [[#ControlCodeMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00402015 || [4.0.0+] CodeOut || Mapped in kernel during [[#ControlCodeMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00002016 || [13.0.0+] Coverage || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ArbitrationType ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Type&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || WaitIfLessThan&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || DecrementAndWaitIfLessThan&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || WaitIfEqual&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SignalType ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Type&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || Signal&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || SignalAndIncrementIfEqual&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || SignalAndModifyBasedOnWaitingThreadCountIfEqual&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ContinueDebugFlagsOld ==&lt;br /&gt;
[1.0.0-2.3.0]&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bit || Bitmask || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1 || IgnoreException (note: ResumeAllThreads or debug-suspended-thread-id needed)&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 2 || SwallowException&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 4 || ResumeAllThreads&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ContinueDebugFlags ==&lt;br /&gt;
[3.0.0+]&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bit || Bitmask || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1 || IgnoreException (note: doesn&#039;t need to be set in the same call than Resume)&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 2 || DontCatchExceptions&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 4 || Resume&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 8 || IgnoreOtherThreadsExceptions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
IgnoreExceptionsOfOthers is like IgnoreException but acts on all threads that aren&#039;t in the input list. The affected threads are resumed.&lt;br /&gt;
&lt;br /&gt;
Only one of of Resume and IgnoreOtherThreadsExceptions can be set at a time.&lt;br /&gt;
&lt;br /&gt;
If the input number of threads is 0, this means &amp;quot;all threads&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== DebugEventInfo ==&lt;br /&gt;
The below table is for the Aarch64 version of the system call. For A32, all u64 fields but title/process/thread id are actually u32, making the structure 0x28-byte-big (0x40 for a64).&lt;br /&gt;
&lt;br /&gt;
Size: 0x40&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || u32 || EventType&lt;br /&gt;
|-&lt;br /&gt;
| 4 || u32 || Flags (bit0: NeedsContinue)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || u64 || ThreadId&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || || PerTypeSpecifics&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
AttachProcess specific:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || u64 || TitleId&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || u64 || ProcessId&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || char[12] || ProcessName&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || u32 || MmuFlags&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || u64 || [5.0.0+] UserExceptionContextAddr&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
AttachThread specific:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || u64 || ThreadId&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || u64 || TlsPtr&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || u64 || Entrypoint&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Exit specific:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || u32|| Type (0=PausedThread, 1=RunningThread, 2=ExitedProcess, 3=TerminatedProcess)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Exception specific:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || u32 || ExceptionType&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || u64 || FaultRegister&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || || PerExceptionSpecifics&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== DebugEventType ===&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || AttachProcess&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AttachThread&lt;br /&gt;
|-&lt;br /&gt;
| 2 || ExitProcess&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ExitThread&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Exception&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== DebugExceptionType ===&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Trap (*)&lt;br /&gt;
|-&lt;br /&gt;
| 1 || InstructionAbort&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DataAbortMisc (**)&lt;br /&gt;
|-&lt;br /&gt;
| 3 || PcSpAlignmentFault&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DebuggerAttached&lt;br /&gt;
|-&lt;br /&gt;
| 5 || BreakPoint&lt;br /&gt;
|-&lt;br /&gt;
| 6 || UserBreak&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DebuggerBreak&lt;br /&gt;
|-&lt;br /&gt;
| 8 || BadSvcId&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [2.0.0+] SError&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; Undefined instructions, software breakpoints, some other traps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;**&amp;lt;/nowiki&amp;gt; Data aborts, FP traps, and everything else that doesn&#039;t belong to any of the above.&lt;br /&gt;
&lt;br /&gt;
Trap specifics:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || u32 || Opcode&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
BreakPoint specifics:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || u32 || IsWatchpoint&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
UserBreak specifics:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || u32 || Info0&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || u64 || Info1&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || u64 || Info2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
BadSvcId specifics:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || u32 || SvcId&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Exception handling =&lt;br /&gt;
First of all, a function that might be called by synchronous exception handler and that is called by the SError handler fetches the exception info, adjusts PC, panics on exceptions taken from EL1, then dispatches the exception.&lt;br /&gt;
&lt;br /&gt;
The dispatcher has two mutually exclusive exception reporting methods:&lt;br /&gt;
* by storing information at the start of the process&#039;s TLS memregion (TPIDRRO_EL0) and jumping back to the crt0&lt;br /&gt;
* by using KDebug&lt;br /&gt;
&lt;br /&gt;
KDebug dispatching is used when at least one of the following conditions are met:&lt;br /&gt;
* SMC ConfigItem KernelMemConfig bit 1 is NOT set (it isn&#039;t on retail), unless: this is a software or hardware breakpoint, or a watchpoint, or [4.0.0+?] the process is attached and this is a Google PNaCl trap instruction (see LLVM source)&lt;br /&gt;
* FAR doesn&#039;t point to a valid address in mapped-readable CodeStatic memory (i.e. this is the case for NRO and JIT memory) or this is one of the following exceptions (it particular, that doesn&#039;t include FP exceptions occurring in CodeStatic memory):&lt;br /&gt;
** Uncategorized&lt;br /&gt;
** IllegalState&lt;br /&gt;
** SupervisorCallA32&lt;br /&gt;
** SupervisorCallA64&lt;br /&gt;
** PCAlignment&lt;br /&gt;
** SPAlignment&lt;br /&gt;
** SError&lt;br /&gt;
** BreakpointLowerEl&lt;br /&gt;
** SoftwareStepLowerEl (note: no way set single-step flag; not parsed)&lt;br /&gt;
** WatchpointLowerEl&lt;br /&gt;
** SoftwareBreakpointA32 (note: not parsed)&lt;br /&gt;
** SoftwareBreakpointA64 (note: not parsed)&lt;br /&gt;
    &lt;br /&gt;
In all other cases the userland-handled exception path is taken.&lt;br /&gt;
&lt;br /&gt;
KDebug path:&lt;br /&gt;
&lt;br /&gt;
If the process is attached, the exception is reported to the KDebug. If the thread was continued using flag IgnoreExceptions, it returns from the exception as if nothing happened.&lt;br /&gt;
&lt;br /&gt;
If the latter is not the case, or if the process isn&#039;t attached, proceed to [2.0.0+] crash reporting (or in [1.0.0] just terminate the process): &lt;br /&gt;
if EnableDebug is set, and depending on the process state (more than one crash per process isn&#039;t permitted) it may signal itself with ProcessState_Crashed so that PM asks NS to start creport so that creport attaches to it and reports the crashes. Otherwise, just terminate.&lt;br /&gt;
&lt;br /&gt;
Userland reporting path and [[#ReturnFromException]]:&lt;br /&gt;
&lt;br /&gt;
TLS region start (A64):&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x148 || Exception stack&lt;br /&gt;
|-&lt;br /&gt;
| 0x148 || 0x78 || ExceptionFrameA64&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
ExceptionFrameA64:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x48 (8*9) || GPRs 0..8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x8 || lr&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || 0x8 || sp&lt;br /&gt;
|-&lt;br /&gt;
| 0x58 || 0x8 || pc (elr_el1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || 0x4 || pstate &amp;amp; 0xFF0FFE20&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || 0x4 || afsr0&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || 0x4 || afsr1&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C || 0x4 || esr&lt;br /&gt;
|-&lt;br /&gt;
| 0x70 || 0x8 || far&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLS region start (A32):&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x178 || Exception stack&lt;br /&gt;
|-&lt;br /&gt;
| 0x148 || 0x44 || ExceptionFrameA32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
ExceptionFrameA32:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 (8*4) || GPRs 0..7.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x4 || sp&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x4 || lr&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x4 || pc (elr_el1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 0x4 || tpidr_el0 = 1&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x4 || cpsr &amp;amp; 0xFF0FFE20&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || 0x4 || afsr0&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x4 || afsr1&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C || 0x4 || esr&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || 0x4 || far&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In that case, after storing the regs in the TLS, the exception handler returns to the application&#039;s crt0 (entrypoint), with X0=&amp;lt;error description code&amp;gt; (see below) and X1=SP=frame=&amp;lt;stack top&amp;gt; (see above)&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Desc. code || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0x100 || Instruction abort&lt;br /&gt;
|-&lt;br /&gt;
| 0x102 || Misaligned PC&lt;br /&gt;
|-&lt;br /&gt;
| 0x103 || Misaligned SP&lt;br /&gt;
|-&lt;br /&gt;
| 0x106 || [2.0.0+] SError&lt;br /&gt;
|-&lt;br /&gt;
| 0x301 || Bad SVC&lt;br /&gt;
|-&lt;br /&gt;
| 0x104 || Uncategorized, CP15RTTrap, CP15RRTTrap, CP14RTTrap, CP14RRTTrap, IllegalState, SystemRegisterTrap&lt;br /&gt;
|-&lt;br /&gt;
| 0x101 || None of the above, EC &amp;lt;= 0x34 and not a breakpoint&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(During normal app boot the process is invoked with X0=0 and X1=main_thread_handle. The crt0 of retail apps determines whether to boot normally or handle an exception if X0 is set to 0 or not)&lt;br /&gt;
&lt;br /&gt;
The application is supposed to promptly update the contents of elr_el1 to a user handler (and any other regs it sees fit) and call [[#ReturnFromException]] (error code) to call that handler. The latter is then expected to promptly abort the program.&lt;br /&gt;
&lt;br /&gt;
[[#ReturnFromException]] updates the contents of the kernel stack frame with what the user provided in the TLS structure, sets TPIDR_EL0 to 1, then:&lt;br /&gt;
* if the provided error code is 0, gracefully pivots and returns from exception&lt;br /&gt;
* if it is not, replays the exception and pass it to the KDebug (see above). One can pass 0x10001 to prevent process termination. If the process is attached, this also prevents crash-collection/termination (different from the exception handler behavior)&lt;br /&gt;
&lt;br /&gt;
If an exception occurs from the above user handler, the entire exception handling process will repeat with the new exception.&lt;br /&gt;
&lt;br /&gt;
Note that if a thread that wasn&#039;t faulting calls [[#ReturnFromException]], it signals an &amp;quot;invalid syscall&amp;quot; exception&lt;br /&gt;
&lt;br /&gt;
Note that [[SMC|IsDebugMode]] is not used during exception-handling, except for enabling printing a message to UART-A. This UART code causes a system-hang on retail (likely due to a loop that doesn&#039;t exit). This printing doesn&#039;t seem to run when the process is attached for debugging?&lt;/div&gt;</summary>
		<author><name>Liamwhite</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=SVC&amp;diff=12138</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=SVC&amp;diff=12138"/>
		<updated>2023-02-18T18:29:57Z</updated>

		<summary type="html">&lt;p&gt;Liamwhite: ClearEvent does not fail if the event is not signaled&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
= System calls =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ID || Return Type || Name || Arguments&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Result || [[#SetHeapSize|SetHeapSize]] || uintptr_t *out_address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Result || [[#SetMemoryPermission|SetMemoryPermission]] || uintptr_t address, size_t size, MemoryPermission perm&lt;br /&gt;
|-&lt;br /&gt;
| 0x03 || Result || [[#SetMemoryAttribute|SetMemoryAttribute]] || uintptr_t address, size_t size, uint32_t mask, uint32_t attr&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Result || [[#MapMemory|MapMemory]] || uintptr_t dst_address, uintptr_t src_address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Result || [[#UnmapMemory|UnmapMemory]] || uintptr_t dst_address, uintptr_t src_address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || Result || [[#QueryMemory|QueryMemory]] || arch::MemoryInfo *out_memory_info, PageInfo *out_page_info, uintptr_t address&lt;br /&gt;
|-&lt;br /&gt;
| 0x07 || void || [[#ExitProcess|ExitProcess]] || &lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Result || [[#CreateThread|CreateThread]] || Handle *out_handle, ThreadFunc func, uintptr_t arg, uintptr_t stack_bottom, int32_t priority, int32_t core_id&lt;br /&gt;
|-&lt;br /&gt;
| 0x09 || Result || [[#StartThread|StartThread]] || Handle thread_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || void || [[#ExitThread|ExitThread]] || &lt;br /&gt;
|-&lt;br /&gt;
| 0x0B || void || [[#SleepThread|SleepThread]] || int64_t ns&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Result || [[#GetThreadPriority|GetThreadPriority]] || int32_t *out_priority, Handle thread_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x0D || Result || [[#SetThreadPriority|SetThreadPriority]] || Handle thread_handle, int32_t priority&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E || Result || [[#GetThreadCoreMask|GetThreadCoreMask]] || int32_t *out_core_id, uint64_t *out_affinity_mask, Handle thread_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x0F || Result || [[#SetThreadCoreMask|SetThreadCoreMask]] || Handle thread_handle, int32_t core_id, uint64_t affinity_mask&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || int32_t || [[#GetCurrentProcessorNumber|GetCurrentProcessorNumber]] || &lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || Result || [[#SignalEvent|SignalEvent]] || Handle event_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || Result || [[#ClearEvent|ClearEvent]] || Handle event_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || Result || [[#MapSharedMemory|MapSharedMemory]] || Handle shmem_handle, uintptr_t address, size_t size, MemoryPermission map_perm&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Result || [[#UnmapSharedMemory|UnmapSharedMemory]] || Handle shmem_handle, uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 || Result || [[#CreateTransferMemory|CreateTransferMemory]] || Handle *out_handle, uintptr_t address, size_t size, MemoryPermission map_perm&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || Result || [[#CloseHandle|CloseHandle]] || Handle handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 || Result || [[#ResetSignal|ResetSignal]] || Handle handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Result || [[#WaitSynchronization|WaitSynchronization]] || int32_t *out_index, const Handle *handles, int32_t numHandles, int64_t timeout_ns&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 || Result || [[#CancelSynchronization|CancelSynchronization]] || Handle handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A || Result || [[#ArbitrateLock|ArbitrateLock]] || Handle thread_handle, uintptr_t address, uint32_t tag&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B || Result || [[#ArbitrateUnlock|ArbitrateUnlock]] || uintptr_t address&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Result || [[#WaitProcessWideKeyAtomic|WaitProcessWideKeyAtomic]] || uintptr_t address, uintptr_t cv_key, uint32_t tag, int64_t timeout_ns&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D || void || [[#SignalProcessWideKey|SignalProcessWideKey]] || uintptr_t cv_key, int32_t count&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E || int64_t || [[#GetSystemTick|GetSystemTick]] || &lt;br /&gt;
|-&lt;br /&gt;
| 0x1F || Result || [[#ConnectToNamedPort|ConnectToNamedPort]] || Handle *out_handle, const char *name&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Result || [[#SendSyncRequestLight|SendSyncRequestLight]] || Handle session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || Result || [[#SendSyncRequest|SendSyncRequest]] || Handle session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || Result || [[#SendSyncRequestWithUserBuffer|SendSyncRequestWithUserBuffer]] || uintptr_t message_buffer, size_t message_buffer_size, Handle session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 || Result || [[#SendAsyncRequestWithUserBuffer|SendAsyncRequestWithUserBuffer]] || Handle *out_event_handle, uintptr_t message_buffer, size_t message_buffer_size, Handle session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Result || [[#GetProcessId|GetProcessId]] || uint64_t *out_process_id, Handle process_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 || Result || [[#GetThreadId|GetThreadId]] || uint64_t *out_thread_id, Handle thread_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || void || [[#Break|Break]] || BreakReason break_reason, uintptr_t arg, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 || Result || [[#OutputDebugString|OutputDebugString]] || const char *debug_str, size_t len&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || void || [[#ReturnFromException|ReturnFromException]] || Result result&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 || Result || [[#GetInfo|GetInfo]] || uint64_t *out, InfoType info_type, Handle handle, uint64_t info_subtype&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || void || [[#FlushEntireDataCache|FlushEntireDataCache]] || &lt;br /&gt;
|-&lt;br /&gt;
| 0x2B || Result || [[#FlushDataCache|FlushDataCache]] || uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| [3.0.0+] 0x2C  || Result || [[#MapPhysicalMemory|MapPhysicalMemory]] || uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| [3.0.0+] 0x2D  || Result || [[#UnmapPhysicalMemory|UnmapPhysicalMemory]] || uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0-5.1.0] 0x2E  || Result || GetFutureThreadInfo || arch::LastThreadContext *out_context, uintptr_t *out_tls_address, uint32_t *out_flags, int64_t ns&lt;br /&gt;
|-&lt;br /&gt;
| [6.0.0+] 0x2E  || Result || [[#GetDebugFutureThreadInfo|GetDebugFutureThreadInfo]] || arch::LastThreadContext *out_context, uint64_t *thread_id, Handle debug_handle, int64_t ns&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F || Result || [[#GetLastThreadInfo|GetLastThreadInfo]] || arch::LastThreadContext *out_context, uintptr_t *out_tls_address, uint32_t *out_flags&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Result || [[#GetResourceLimitLimitValue|GetResourceLimitLimitValue]] || int64_t *out_limit_value, Handle resource_limit_handle, LimitableResource which&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 || Result || [[#GetResourceLimitCurrentValue|GetResourceLimitCurrentValue]] || int64_t *out_current_value, Handle resource_limit_handle, LimitableResource which&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || Result || [[#SetThreadActivity|SetThreadActivity]] || Handle thread_handle, ThreadActivity thread_activity&lt;br /&gt;
|-&lt;br /&gt;
| 0x33  || Result || [[#GetThreadContext3|GetThreadContext3]] || ThreadContext *out_context, Handle thread_handle&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] 0x34 || Result || [[#WaitForAddress|WaitForAddress]] || uintptr_t address, ArbitrationType arb_type, int32_t value, int64_t timeout_ns&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] 0x35 || Result || [[#SignalToAddress|SignalToAddress]] || uintptr_t address, SignalType signal_type, int32_t value, int32_t count&lt;br /&gt;
|-&lt;br /&gt;
| [8.0.0+] 0x36 || void || [[#SynchronizePreemptionState|SynchronizePreemptionState]] || &lt;br /&gt;
|-&lt;br /&gt;
| [11.0.0+] 0x37 || Result || [[#GetResourceLimitPeakValue|GetResourceLimitPeakValue]] || int64_t *out_peak_value, Handle resource_limit_handle, LimitableResource which&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| [13.0.0+] 0x39 || Result || CreateIoPool || Handle *out_handle, IoPoolType which_pool&lt;br /&gt;
|-&lt;br /&gt;
| [13.0.0+] 0x3A || Result || CreateIoRegion || Handle *out_handle, Handle io_pool, PhysicalAddress physical_address, size_t size, MemoryMapping mapping, MemoryPermission perm&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| [1.0.0-3.0.2] 0x3C || void || [[#DumpInfo|DumpInfo]] || DumpInfoType dump_info_type, uint64_t arg&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] 0x3C || void || [[#KernelDebug|KernelDebug]] || KernelDebugType kern_debug_type, uint64_t arg0, uint64_t arg1, uint64_t arg2&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] 0x3D || void || [[#ChangeKernelTraceState|ChangeKernelTraceState]] || KernelTraceState kern_trace_state&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x40 || Result || [[#CreateSession|CreateSession]] || Handle *out_server_session_handle, Handle *out_client_session_handle, bool is_light, uintptr_t name&lt;br /&gt;
|-&lt;br /&gt;
| 0x41 || Result || [[#AcceptSession|AcceptSession]] || Handle *out_handle, Handle port&lt;br /&gt;
|-&lt;br /&gt;
| 0x42 || Result || [[#ReplyAndReceiveLight|ReplyAndReceiveLight]] || Handle handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x43 || Result || [[#ReplyAndReceive|ReplyAndReceive]] || int32_t *out_index, const Handle *handles, int32_t num_handles, Handle reply_target, int64_t timeout_ns&lt;br /&gt;
|-&lt;br /&gt;
| 0x44 || Result || [[#ReplyAndReceiveWithUserBuffer|ReplyAndReceiveWithUserBuffer]] || int32_t *out_index, uintptr_t message_buffer, size_t message_buffer_size, const Handle *handles, int32_t num_handles, Handle reply_target, int64_t timeout_ns&lt;br /&gt;
|-&lt;br /&gt;
| 0x45 || Result || [[#CreateEvent|CreateEvent]] || Handle *out_write_handle, Handle *out_read_handle&lt;br /&gt;
|-&lt;br /&gt;
| [13.0.0+] 0x46 || Result || MapIoRegion || Handle io_region, uintptr_t address, size_t size, MemoryPermission perm&lt;br /&gt;
|-&lt;br /&gt;
| [13.0.0+] 0x47 || Result || UnmapIoRegion || Handle io_region, uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x48 || Result || [[#MapPhysicalMemoryUnsafe|MapPhysicalMemoryUnsafe]] || uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x49 || Result || [[#UnmapPhysicalMemoryUnsafe|UnmapPhysicalMemoryUnsafe]] || uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x4A || Result || [[#SetUnsafeLimit|SetUnsafeLimit]] || size_t limit&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] 0x4B || Result || [[#CreateCodeMemory|CreateCodeMemory]] || Handle *out_handle, uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] 0x4C || Result || [[#ControlCodeMemory|ControlCodeMemory]] || Handle code_memory_handle, CodeMemoryOperation operation, uint64_t address, uint64_t size, MemoryPermission perm&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D || void || [[#SleepSystem|SleepSystem]] || &lt;br /&gt;
|-&lt;br /&gt;
| 0x4E || Result || [[#ReadWriteRegister|ReadWriteRegister]] || uint32_t *out_value, PhysicalAddress address, uint32_t mask, uint32_t value&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F || Result || [[#SetProcessActivity|SetProcessActivity]] || Handle process_handle, ProcessActivity process_activity&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || Result || [[#CreateSharedMemory|CreateSharedMemory]] || Handle *out_handle, size_t size, MemoryPermission owner_perm, MemoryPermission remote_perm&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 || Result || [[#MapTransferMemory|MapTransferMemory]] || Handle trmem_handle, uintptr_t address, size_t size, MemoryPermission owner_perm&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 || Result || [[#UnmapTransferMemory|UnmapTransferMemory]] || Handle trmem_handle, uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 || Result || [[#CreateInterruptEvent|CreateInterruptEvent]] || Handle *out_read_handle, int32_t interrupt_id, InterruptType interrupt_type&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 || Result || [[#QueryPhysicalAddress|QueryPhysicalAddress]] || arch::PhysicalMemoryInfo *out_info, uintptr_t address&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 || Result || [[#QueryIoMapping|QueryIoMapping]] || uintptr_t *out_address, [10.0.0+] size_t *out_size, PhysicalAddress physical_address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 || Result || [[#CreateDeviceAddressSpace|CreateDeviceAddressSpace]] || Handle *out_handle, uint64_t das_address, uint64_t das_size&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 || Result || [[#AttachDeviceAddressSpace|AttachDeviceAddressSpace]] || DeviceName device_name, Handle das_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x58 || Result || [[#DetachDeviceAddressSpace|DetachDeviceAddressSpace]] || DeviceName device_name, Handle das_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x59 || Result || [[#MapDeviceAddressSpaceByForce|MapDeviceAddressSpaceByForce]] || Handle das_handle, Handle process_handle, uint64_t process_address, size_t size, uint64_t device_address, uint32_t option&lt;br /&gt;
|-&lt;br /&gt;
| 0x5A || Result || [[#MapDeviceAddressSpaceAligned|MapDeviceAddressSpaceAligned]] || Handle das_handle, Handle process_handle, uint64_t process_address, size_t size, uint64_t device_address, uint32_t option&lt;br /&gt;
|-&lt;br /&gt;
| [1.0.0-12.1.0] 0x5B || Result || [[#MapDeviceAddressSpace|MapDeviceAddressSpace]] || size_t *out_mapped_size, Handle das_handle, Handle process_handle, uint64_t process_address, size_t size, uint64_t device_address, MemoryPermission device_perm&lt;br /&gt;
|-&lt;br /&gt;
| 0x5C || Result || [[#UnmapDeviceAddressSpace|UnmapDeviceAddressSpace]] || Handle das_handle, Handle process_handle, uint64_t process_address, size_t size, uint64_t device_address&lt;br /&gt;
|-&lt;br /&gt;
| 0x5D || Result || [[#InvalidateProcessDataCache|InvalidateProcessDataCache]] || Handle process_handle, uint64_t address, uint64_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x5E || Result || [[#StoreProcessDataCache|StoreProcessDataCache]] || Handle process_handle, uint64_t address, uint64_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x5F || Result || [[#FlushProcessDataCache|FlushProcessDataCache]] || Handle process_handle, uint64_t address, uint64_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || Result || [[#DebugActiveProcess|DebugActiveProcess]] || Handle *out_handle, uint64_t process_id&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 || Result || [[#BreakDebugProcess|BreakDebugProcess]] || Handle debug_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 || Result || [[#TerminateDebugProcess|TerminateDebugProcess]] || Handle debug_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 || Result || [[#GetDebugEvent|GetDebugEvent]] || arch::DebugEventInfo *out_info, Handle debug_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || Result || [[#ContinueDebugEvent|ContinueDebugEvent]] || Handle debug_handle, uint32_t flags, const uint64_t *thread_ids, int32_t num_thread_ids&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 || Result || [[#GetProcessList|GetProcessList]] || int32_t *out_num_processes, uint64_t *out_process_ids, int32_t max_out_count&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 || Result || [[#GetThreadList|GetThreadList]] || int32_t *out_num_threads, uint64_t *out_thread_ids, int32_t max_out_count, Handle debug_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 || Result || [[#GetDebugThreadContext|GetDebugThreadContext]] || ThreadContext *out_context, Handle debug_handle, uint64_t thread_id, uint32_t context_flags&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || Result || [[#SetDebugThreadContext|SetDebugThreadContext]] || Handle debug_handle, uint64_t thread_id, const ThreadContext *context, uint32_t context_flags&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 || Result || [[#QueryDebugProcessMemory|QueryDebugProcessMemory]] || arch::MemoryInfo *out_memory_info, PageInfo *out_page_info, Handle process_handle, uintptr_t address&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A || Result || [[#ReadDebugProcessMemory|ReadDebugProcessMemory]] || uintptr_t buffer, Handle debug_handle, uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B || Result || [[#WriteDebugProcessMemory|WriteDebugProcessMemory]] || Handle debug_handle, uintptr_t buffer, uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C || Result || [[#SetHardwareBreakPoint|SetHardwareBreakPoint]] || HardwareBreakPointRegisterName name, uint64_t flags, uint64_t value&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D || Result || [[#GetDebugThreadParam|GetDebugThreadParam]] || uint64_t *out_64, uint32_t *out_32, Handle debug_handle, uint64_t thread_id, DebugThreadParam param&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| [5.0.0+] 0x6F || Result || [[#GetSystemInfo|GetSystemInfo]] || uint64_t *out, SystemInfoType info_type, Handle handle, uint64_t info_subtype&lt;br /&gt;
|-&lt;br /&gt;
| 0x70 || Result || [[#CreatePort|CreatePort]] || Handle *out_server_handle, Handle *out_client_handle, int32_t max_sessions, bool is_light, uintptr_t name&lt;br /&gt;
|-&lt;br /&gt;
| 0x71 || Result || [[#ManageNamedPort|ManageNamedPort]] || Handle *out_server_handle, const char *name, int32_t max_sessions&lt;br /&gt;
|-&lt;br /&gt;
| 0x72 || Result || [[#ConnectToPort|ConnectToPort]] || Handle *out_handle, Handle port&lt;br /&gt;
|-&lt;br /&gt;
| 0x73 || Result || [[#SetProcessMemoryPermission|SetProcessMemoryPermission]] || Handle process_handle, uint64_t address, uint64_t size, MemoryPermission perm&lt;br /&gt;
|-&lt;br /&gt;
| 0x74 || Result || [[#MapProcessMemory|MapProcessMemory]] || uintptr_t dst_address, Handle process_handle, uint64_t src_address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x75 || Result || [[#UnmapProcessMemory|UnmapProcessMemory]] || uintptr_t dst_address, Handle process_handle, uint64_t src_address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x76 || Result || [[#QueryProcessMemory|QueryProcessMemory]] || arch::MemoryInfo *out_memory_info, PageInfo *out_page_info, Handle process_handle, uint64_t address&lt;br /&gt;
|-&lt;br /&gt;
| 0x77 || Result || [[#MapProcessCodeMemory|MapProcessCodeMemory]] || Handle process_handle, uint64_t dst_address, uint64_t src_address, uint64_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x78 || Result || [[#UnmapProcessCodeMemory|UnmapProcessCodeMemory]] || Handle process_handle, uint64_t dst_address, uint64_t src_address, uint64_t size&lt;br /&gt;
|-&lt;br /&gt;
| 0x79 || Result || [[#CreateProcess|CreateProcess]] || Handle *out_handle, const arch::CreateProcessParameter *parameters, const uint32_t *caps, int32_t num_caps&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A || Result || [[#StartProcess|StartProcess]] || Handle process_handle, int32_t priority, int32_t core_id, uint64_t main_thread_stack_size&lt;br /&gt;
|-&lt;br /&gt;
| 0x7B || Result || [[#TerminateProcess|TerminateProcess]] || Handle process_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C || Result || [[#GetProcessInfo|GetProcessInfo]] || int64_t *out_info, Handle process_handle, ProcessInfoType info_type&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D || Result || [[#CreateResourceLimit|CreateResourceLimit]] || Handle *out_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x7E || Result || [[#SetResourceLimitLimitValue|SetResourceLimitLimitValue]] || Handle resource_limit_handle, LimitableResource which, int64_t limit_value&lt;br /&gt;
|-&lt;br /&gt;
| 0x7F || void || [[#CallSecureMonitor|CallSecureMonitor]] || SecureMonitorArguments *args&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| [15.0.0+] 0x90  || Result || MapInsecureMemory || uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
| [15.0.0+] 0x91  || Result || UnmapInsecureMemory || uintptr_t address, size_t size&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SetHeapSize ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || void* || HeapAddress&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the process heap to a given Size. It can both extend and shrink the heap.&lt;br /&gt;
&lt;br /&gt;
Size must be a multiple of 0x200000 (2MB).&lt;br /&gt;
&lt;br /&gt;
On success, the heap base-address (which is fixed by kernel, aslr&#039;d, and always in the Heap memory region) is written to HeapAddress.&lt;br /&gt;
&lt;br /&gt;
Uses current process pool partition. The memory allocated counts towards the caller&#039;s process Memory ResourceLimit.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Size must be less than or equal to 4GB.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCA01:&#039;&#039;&#039; Invalid size passed. It&#039;s either bigger than 4GB, or misaligned.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xD001:&#039;&#039;&#039; Size is bigger than the Heap Region size.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCE01:&#039;&#039;&#039; KMemoryBlockAllocator slab allocator exhausted.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xD401:&#039;&#039;&#039; The memory region is in an invalid state. Likely because a mapping was made in the heap region.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0x10801:&#039;&#039;&#039; Memory resource limit reached.&lt;br /&gt;
&lt;br /&gt;
== SetMemoryPermission ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || [[#MemoryPermission]] || MemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes permission of page-aligned memory region.&lt;br /&gt;
&lt;br /&gt;
Bit2 of permission (exec) is not allowed. Setting write-only is not allowed either (bit1).&lt;br /&gt;
&lt;br /&gt;
This can be used to move back and forth between ---, r-- and rw-.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success. The memory region was reprotected.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCC01:&#039;&#039;&#039; Unaligned address specified.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCA01:&#039;&#039;&#039; Unaligned or zero size specified.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xD401:&#039;&#039;&#039; The provided memory region does not fall within the userland address space.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xD801:&#039;&#039;&#039; Invalid permission specified. Valid permissions are ---, r-- and rw-.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xD401:&#039;&#039;&#039; The provided memory region was in an invalid state. The region must have the [[#MemoryState|FlagCanReprotect]] state, and must not have the [[#MemoryAttribute|Locked]] or [[#MemoryAttribute|Uncached]] attributes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCE01:&#039;&#039;&#039; Kernel resource exhausted.&lt;br /&gt;
&lt;br /&gt;
== SetMemoryAttribute ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || uint32_t || Mask&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || uint32_t || Value&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes attribute of page-aligned memory region. The only allowed combination of Value and Mask is 0x8, which means only bit3 in [[#MemoryAttribute]] can be set or cleared.&lt;br /&gt;
&lt;br /&gt;
This is used to turn on/off caching for a given memory area. Useful when talking to devices such as the GPU.&lt;br /&gt;
&lt;br /&gt;
What happens &amp;quot;under the hood&amp;quot; is the &amp;quot;Memory Attribute Indirection Register&amp;quot; index is changed from 2 to 3 in the MMU descriptor.&lt;br /&gt;
&lt;br /&gt;
== MapMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || DstAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || SrcAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps a memory range into a different range.&lt;br /&gt;
&lt;br /&gt;
Mainly used for adding guard pages around stack.&lt;br /&gt;
&lt;br /&gt;
Source range gets reprotected to --- (it can no longer be accessed), and bit0 is set in the source [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
[1.0.0] This could be used to map into either the Alias Region or the Stack region.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] This can only be used to map into the Stack region.&lt;br /&gt;
&lt;br /&gt;
Code can get the range of the Alias region from [[#GetInfo]] id0=2,3, and on 2.0.0+ the range of the Stack region via [[#GetInfo]] id0=14, 15 (on 1.0.0, the Stack region had hardcoded limits).&lt;br /&gt;
&lt;br /&gt;
When mapped into the Alias region, the mapped memory will have state 0x482907.&lt;br /&gt;
&lt;br /&gt;
When mapped into the Stack region, the mapped memory will have state 0x5C3C0B.&lt;br /&gt;
&lt;br /&gt;
== UnmapMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || DstAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || SrcAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unmaps a region that was previously mapped with [[#MapMemory]].&lt;br /&gt;
&lt;br /&gt;
It&#039;s possible to unmap ranges partially, you don&#039;t need to unmap the entire range &amp;quot;in one go&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The srcaddr/dstaddr must match what was given when the pages were originally mapped.&lt;br /&gt;
&lt;br /&gt;
== QueryMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || [[#MemoryInfo]]* || MemoryInfo&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || [[#PageInfo]] || PageInfo&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries information about an address. Will always fetch the lowest page-aligned mapping that contains the provided address.&lt;br /&gt;
&lt;br /&gt;
Outputs a [[#MemoryInfo]] struct.&lt;br /&gt;
&lt;br /&gt;
== ExitProcess ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the current process.&lt;br /&gt;
&lt;br /&gt;
== CreateThread ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R1 || void(*)(void*) || Entry&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2 || void* || ThreadContext&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R3 || void* || StackTop&lt;br /&gt;
|-&lt;br /&gt;
| (In) W4 || R0 || int32_t || Priority&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || R4 || int32_t || ProcessorId&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a thread in the current process.&lt;br /&gt;
&lt;br /&gt;
ProcessorId must be 0,1,2,3 or -2, where -2 uses the default CpuId for process.&lt;br /&gt;
&lt;br /&gt;
== StartThread ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) None ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts the thread for the provided handle.&lt;br /&gt;
&lt;br /&gt;
== ExitThread ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exits the current thread.&lt;br /&gt;
&lt;br /&gt;
== SleepThread ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0, R1 || uint64_t || Nanoseconds&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sleeps for a specified amount of time, or yields the thread.&lt;br /&gt;
&lt;br /&gt;
Setting nanoseconds to 0, -1, or -2 indicates a yielding type.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || Type&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Yielding without core migration&lt;br /&gt;
|-&lt;br /&gt;
| -1 || Yielding with core migration&lt;br /&gt;
|-&lt;br /&gt;
| -2 || Yielding to any other thread&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetThreadPriority ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1|| Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || int32_t || Priority&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets the priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== SetThreadPriority ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0|| Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1|| int32_t || Priority&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
Priority is a number 0-0x3F. Lower value means higher priority.&lt;br /&gt;
&lt;br /&gt;
== GetThreadCoreMask ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || int32_t || CoreMask0&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X2 || R2, R3 || uint64_t || CoreMask1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets the affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== SetThreadCoreMask ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || int32_t || CoreMask0&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || uint64_t || CoreMask1&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== GetCurrentProcessorNumber ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || uint32_t || CpuId&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets which cpu is executing the current thread.&lt;br /&gt;
&lt;br /&gt;
CpuId is an integer in the range 0-3.&lt;br /&gt;
&lt;br /&gt;
== SignalEvent ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;WritableEvent&amp;gt; || EventHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Puts the given event in the signaled state.&lt;br /&gt;
&lt;br /&gt;
Will wake up any thread currently waiting on this event. Can potentially trigger a reschedule.&lt;br /&gt;
&lt;br /&gt;
Any calls to [[#WaitSynchronization]] on this handle will return immediately, until the event&#039;s signaled state is reset.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success. Event is now in signaled state.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xE401:&#039;&#039;&#039; Invalid handle. The handle either does not exist, or is not a WritableEvent.&lt;br /&gt;
&lt;br /&gt;
== ClearEvent ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;WritableEvent&amp;gt; or Handle&amp;lt;ReadableEvent&amp;gt; || EventHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Takes the given event out of the signaled state, if it is signaled.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success, the event is now in the not-signaled state.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xE401:&#039;&#039;&#039; Invalid handle. The handle either does not exist, or is not a ReadableEvent nor a WritableEvent.&lt;br /&gt;
&lt;br /&gt;
== MapSharedMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;SharedMemory&amp;gt; || SharedMemoryHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || [[#MemoryPermission]] || MemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps the block supplied by the handle. The required permissions are different for the process that created the handle and all other processes.&lt;br /&gt;
&lt;br /&gt;
Increases reference count for the KSharedMemory object. Thus in order to release the memory associated with the object, all handles to it must be closed and all mappings must be unmapped.&lt;br /&gt;
&lt;br /&gt;
== UnmapSharedMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;SharedMemory&amp;gt; || SharedMemoryHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CreateTransferMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || [[#MemoryPermission]] || MemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;TransferMemory&amp;gt; || TransferMemoryHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one reprotects the src block with perms you give it. It also sets bit0 into [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
Executable bit perm not allowed.&lt;br /&gt;
&lt;br /&gt;
Closing all handles automatically causes the bit0 in [[#MemoryAttribute]] to clear, and the permission to reset.&lt;br /&gt;
&lt;br /&gt;
== CloseHandle ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle || Handle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ResetSignal ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;ReadableEvent&amp;gt; or Handle&amp;lt;Process&amp;gt; || Handle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resets the signal on the given handle, ensuring future calls to [[#WaitSynchronization]] on this handle will sleep until the handle is signaled again. If the handle is a ReadableEvent, this is equivalent to calling ClearEvent() on the handle.&lt;br /&gt;
&lt;br /&gt;
If the handle is a Process, it will clear the signaled state (which is set when the process changes [[#ProcessState]]. Once the process enters the Exited state, calling ResetSignal on the process will no longer have an effect (the process is permanently signaled), and the syscall will return 0xFA01.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success. The signal was reset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xE401:&#039;&#039;&#039; The handle is invalid or of the wrong type.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xFA01:&#039;&#039;&#039; The handle was not signaled, or the process is in exited state, causing it to be permanently signaled.&lt;br /&gt;
&lt;br /&gt;
== WaitSynchronization ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R1 || Handle* || HandlesPtr&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || int32_t || HandlesNum&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R0, R3 || int64_t || Timeout&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || uint64_t || HandleIndex&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Works with HandlesNum &amp;lt;= 0x40.&lt;br /&gt;
&lt;br /&gt;
When zero handles are passed, this will wait forever until either timeout or cancellation occurs.&lt;br /&gt;
&lt;br /&gt;
Does not accept 0xFFFF8001 or 0xFFFF8000 as handles.&lt;br /&gt;
&lt;br /&gt;
=== Object types ===&lt;br /&gt;
&#039;&#039;&#039;KDebug:&#039;&#039;&#039; signals when there is a new [[#DebugEventInfo|DebugEvent]] (retrievable via [[#GetDebugEvent]]).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;KClientPort:&#039;&#039;&#039; signals when the number of sessions is less than the maximum allowed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;KProcess:&#039;&#039;&#039; signals when the process undergoes a state change (retrievable via [[#GetProcessInfo]]).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;KReadableEvent:&#039;&#039;&#039; signals when the event&#039;s corresponding KWritableEvent has been signaled via [[#SignalEvent]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;KServerPort:&#039;&#039;&#039; signals when there is an incoming connection waiting to be [[#AcceptSession|accepted]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;KServerSession:&#039;&#039;&#039; signals when there is an incoming message waiting to be [[#ReplyAndReceive|received]] or the pipe is closed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;KThread:&#039;&#039;&#039; signals when the thread has exited.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success. One of the objects was signaled before the timeout expired, or one of the objects is a Session with a closed remote. Handle index is updated to indicate which object signaled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0x7601:&#039;&#039;&#039; Thread termination requested. Handle index is not updated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xe401:&#039;&#039;&#039; Invalid handle. Returned when one of the handles passed is invalid. Handle index is not updated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xe601:&#039;&#039;&#039; Invalid address. Returned when the handles pointer is not a readable address. Handle index is not updated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xea01:&#039;&#039;&#039; Timeout. Returned when no objects have been signaled within the timeout. Handle index is not updated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xec01:&#039;&#039;&#039; Interrupted. Returned when another thread uses [[#CancelSynchronization]] to cancel this thread. Handle index is not updated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xee01:&#039;&#039;&#039; Too many handles. Returned when the number of handles passed is &amp;gt; 0x40.&lt;br /&gt;
&lt;br /&gt;
== CancelSynchronization ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the referenced thread is currently in a synchronization call ([[#WaitSynchronization]], [[#ReplyAndReceive]] or [[#ReplyAndReceiveLight]]), that call will be interrupted and return 0xec01.&lt;br /&gt;
If that thread is not currently executing such a synchronization call, the next call to a synchronization call will return 0xec01.&lt;br /&gt;
&lt;br /&gt;
This doesn&#039;t take force-pause (activity/debug pause) into account.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success. The thread was either interrupted or has had its flag set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xe401:&#039;&#039;&#039; Invalid handle. The handle given was either invalid or not a thread handle.&lt;br /&gt;
&lt;br /&gt;
== ArbitrateLock ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || uint32_t || Tag&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;                                  &lt;br /&gt;
&lt;br /&gt;
== ArbitrateUnlock ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== WaitProcessWideKeyAtomic ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0 || void* || KeyAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R1 || void* || TagAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || uint32_t || Tag&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R3, R4 || int64_t || Timeout&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SignalProcessWideKey ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || int32_t || Value&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetSystemTick ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X0 || R0, R1 || uint64_t || Ticks&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the value of cntpct_el0.&lt;br /&gt;
&lt;br /&gt;
The frequency is 19200000 Hz (constant from official sw).&lt;br /&gt;
&lt;br /&gt;
Official sw reads cntpct_el0 directly from usermode without using this SVC. [[ExeFS|sdk-nso]] has this SVC, but it&#039;s not known to be called anywhere.&lt;br /&gt;
&lt;br /&gt;
== ConnectToNamedPort ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || char* || PortName&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;Session&amp;gt; || SessionHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SendSyncRequestLight ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Session&amp;gt; || SessionHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SendSyncRequest ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Session&amp;gt; || SessionHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SendSyncRequestWithUserBuffer ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || Handle&amp;lt;Session&amp;gt; || SessionHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Size and Address must be 0x1000-aligned.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xcc01:&#039;&#039;&#039; Address is not 0x1000-aligned.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xca01:&#039;&#039;&#039; Size is not 0x1000-aligned.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xce01:&#039;&#039;&#039; KSessionRequest allocation failed (unlikely) or pointer buffer size exceeded.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xe401:&#039;&#039;&#039; Handles does not exist, or handle is not an instance of KClientSession.&lt;br /&gt;
&lt;br /&gt;
== SendAsyncRequestWithUserBuffer ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || Handle&amp;lt;Session&amp;gt; || SessionHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;ReadableEvent&amp;gt; || EventHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Size and Address must be 0x1000-aligned.&lt;br /&gt;
&lt;br /&gt;
== GetProcessId ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1, R2 || uint64_t || ProcessId&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetThreadId ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1, R2 || uint64_t || ThreadId&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Break ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || [[#BreakReason]] || BreakReason&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t ||&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Info&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the process is attached, report the Break event. Then, if [[#ContinueDebugEvent]] didn&#039;t apply IgnoreException on the thread: if TPIDR_EL0 is 0, adjust ELR_EL1 to retry to svc instruction (and set TPIDR_EL0 to 1).&lt;br /&gt;
&lt;br /&gt;
Otherwise, if bit31 in reason isn&#039;t set, perform crash reporting (see Exception Handling section below), if it doesn&#039;t terminate the process adjust ELR_EL1 as well.&lt;br /&gt;
&lt;br /&gt;
Otherwise just return 0.&lt;br /&gt;
&lt;br /&gt;
== OutputDebugString ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || char* || String&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ReturnFromException ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetInfo ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || [[#InfoType]] || InfoType&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || Handle || Handle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R0, R3 || uint64_t || InfoSubType&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1, R2 || uint64_t || Info&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FlushEntireDataCache ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || ||&lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FlushDataCache ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MapPhysicalMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Acts like [[#SetHeapSize]] except you can allocate heap at any address you&#039;d like.&lt;br /&gt;
&lt;br /&gt;
Uses current process pool partition.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCA01:&#039;&#039;&#039; Invalid size passed. It&#039;s either zero or not 4k-aligned&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCC01:&#039;&#039;&#039; Invalid address. (not 4k-aligned)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xDC01:&#039;&#039;&#039; Invalid memory range. It&#039;s either causes overflow, or does not fall into &amp;quot;reserved&amp;quot; address range (aka Alias). See AliasRegionAddress at [[#InfoType]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xFA01:&#039;&#039;&#039; Invalid state. (not enough SystemResource (see [[NPDM#SystemResourceSize]]))&lt;br /&gt;
&lt;br /&gt;
== UnmapPhysicalMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetDebugFutureThreadInfo ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R0, R1 || uint64_t || Timeout&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || uint64_t || LastThreadContextParam0&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X2 || uint64_t || LastThreadContextParam1&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X3 || uint64_t || LastThreadContextParam2&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X4 || uint64_t || LastThreadContextParam3&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X5 || uint64_t ||&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W6 || uint32_t ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetLastThreadInfo ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || uint64_t || LastThreadContextParam0&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X2 || uint64_t || LastThreadContextParam1&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X3 || uint64_t || LastThreadContextParam2&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X4 || uint64_t || LastThreadContextParam3&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X5 || uint64_t ||&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W6 || uint32_t ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetResourceLimitLimitValue ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;ResourceLimit&amp;gt; || ResourceLimitHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || [[#LimitableResource]] || LimitableResource&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1, R2 || int64_t || LimitValue&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetResourceLimitCurrentValue ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;ResourceLimit&amp;gt; || ResourceLimitHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || [[#LimitableResource]] || LimitableResource&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1, R2 || int64_t || CurrentValue&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SetThreadActivity ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || [[#ThreadActivity]] || ThreadActivity&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetThreadContext3 ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || [[#ThreadContext]]* || ThreadContext&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || Handle&amp;lt;Thread&amp;gt; || ThreadHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== WaitForAddress ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || [[#ArbitrationType]] || ArbitrationType&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || uint32_t || Value&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R3, R4 || uint64_t || Timeout&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SignalToAddress ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || [[#SignalType]] || SignalType&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || uint32_t || Value&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || R3 || uint32_t || NumToSignal&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0  || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SynchronizePreemptionState ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None ||  || &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetResourceLimitPeakValue ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;ResourceLimit&amp;gt; || ResourceLimitHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || [[#LimitableResource]] || LimitableResource&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1, R2 || int64_t || PeakValue&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DumpInfo ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || [[#DumpInfoType]] || DumpInfoType&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || DumpInfoSubType&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stubbed in retail kernel.&lt;br /&gt;
&lt;br /&gt;
[4.0.0+] This function was removed and replaced by [[#KernelDebug]].&lt;br /&gt;
&lt;br /&gt;
== KernelDebug ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || [[#KernelDebugType]] || KernelDebugType&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || &lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || &lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || uint64_t || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stubbed in retail kernel.&lt;br /&gt;
&lt;br /&gt;
== ChangeKernelTraceState ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || [[#KernelTraceState]] || KernelTraceState&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stubbed in retail kernel.&lt;br /&gt;
&lt;br /&gt;
== CreateSession ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || bool || IsLight&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || uint64_t || Name&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;ServerSession&amp;gt; || ServerSessionHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W2 || Handle&amp;lt;ClientSession&amp;gt; || ClientSessionHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== AcceptSession ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || Handle&amp;lt;Port&amp;gt; || PortHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;ServerSession&amp;gt; || ServerSessionHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0xf201:&#039;&#039;&#039; No session waiting to be accepted&lt;br /&gt;
&lt;br /&gt;
== ReplyAndReceiveLight ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Port&amp;gt; or Handle&amp;lt;ServerSession&amp;gt; || Handle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ReplyAndReceive ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R1 || Handle&amp;lt;Port&amp;gt;* or Handle&amp;lt;ServerSession&amp;gt;* || Handles&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || uint32_t || NumHandles&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || R3 || Handle&amp;lt;ServerSession&amp;gt; || ReplyTargetSessionHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || R0, R4 || uint64_t || Timeout&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || uint32_t || HandleIndex&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If ReplyTargetSessionHandle is not zero, a reply from the TLS will be sent to that session.&lt;br /&gt;
Then it will wait until either of the passed sessions has an incoming message, is closed, a passed port has an incoming connection, or the timeout expires.&lt;br /&gt;
If there is an incoming message, it is copied to the TLS.&lt;br /&gt;
&lt;br /&gt;
If ReplyTargetSessionHandle is zero, the TLS should contain a blank message. If this message has a C descriptor, the buffer it points to will be used as the pointer buffer. See [[IPC_Marshalling#IPC_buffers]]. Note that a pointer buffer cannot be specified if ReplyTargetSessionHandle is not zero.&lt;br /&gt;
&lt;br /&gt;
After being validated, passed handles will be enumerated in order; even if a session has been closed, if one that appears earlier in the list has an incoming message, it will take priority and a result code of 0x0 will be returned.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success. Either a session has an incoming message or a port has an incoming connection. HandleIndex is set appropriately.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xea01:&#039;&#039;&#039; Timeout. No handles were signalled before the timeout expired. HandleIndex is not updated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xf601:&#039;&#039;&#039; Port remote dead. One of the sessions has been closed. HandleIndex is set appropriately.&lt;br /&gt;
&lt;br /&gt;
== ReplyAndReceiveWithUserBuffer ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R3 || Handle&amp;lt;Port&amp;gt;* or Handle&amp;lt;ServerSession&amp;gt;* || Handles&lt;br /&gt;
|-&lt;br /&gt;
| (In) W4 || R0 || uint32_t || NumHandles&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || R4 || Handle&amp;lt;ServerSession&amp;gt; || ReplyTargetSessionHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X6 || R5, R6 || uint64_t || Timeout&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || uint32_t || HandleIndex&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CreateEvent ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || ||&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;WritableEvent&amp;gt; || WritableEventHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W2 || Handle&amp;lt;ReadableEvent&amp;gt; || ReadableEventHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MapPhysicalMemoryUnsafe ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same as [[#MapPhysicalMemory]] except it always uses pool partition 0.&lt;br /&gt;
&lt;br /&gt;
== UnmapPhysicalMemoryUnsafe ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SetUnsafeLimit ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || uint64_t || Limit&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CreateCodeMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;CodeMemory&amp;gt; || CodeMemoryHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Takes an address range with backing memory to create the code memory object.&lt;br /&gt;
&lt;br /&gt;
The memory is initially memset to 0xFF after being locked.&lt;br /&gt;
&lt;br /&gt;
== ControlCodeMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;CodeMemory&amp;gt; || CodeMemoryHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || [[#CodeMemoryOperation]] || CodeMemoryOperation&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R4, R5 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W4 || R6 || [[#MemoryPermission]] || MemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps the backing memory for a CodeMemory object into the current process.&lt;br /&gt;
&lt;br /&gt;
For [[#CodeMemoryOperation|MapOwner]], memory permission must be RW-.&lt;br /&gt;
&lt;br /&gt;
For [[#CodeMemoryOperation|MapSlave]], memory permission must be R-- or R-X.&lt;br /&gt;
&lt;br /&gt;
Operations [[#CodeMemoryOperation|UnmapOwner/UnmapSlave]] unmap memory that was previously mapped this way.&lt;br /&gt;
&lt;br /&gt;
This allows one &amp;quot;secure JIT&amp;quot; process to map the code memory as RW-, and the other &amp;quot;slave&amp;quot; process to map it R-X.&lt;br /&gt;
&lt;br /&gt;
[5.0.0+] Error 0xE401 is now returned when the process owner of the Code memory object is the same as the current process.&lt;br /&gt;
&lt;br /&gt;
== SleepSystem ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || || &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ReadWriteRegister ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || uint64_t || RegisterAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R0 || uint32_t || RwMask&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || R1 || uint32_t || InValue&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || uint32_t || OutValue&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Read/write IO registers with a hardcoded whitelist. Input address is physical-address and must be aligned to 4.&lt;br /&gt;
&lt;br /&gt;
rw_mask is 0 for reading and 0xffffffff for writing. You can also write individual bits by using a mask value.&lt;br /&gt;
&lt;br /&gt;
You can only write to registers inside physical pages 0x70019000 (MC), 0x7001C000 (MC0), 0x7001D000 (MC1), and they all share the same whitelist.&lt;br /&gt;
&lt;br /&gt;
The whitelist is same for writing as for reading.&lt;br /&gt;
&lt;br /&gt;
The whitelist is:&lt;br /&gt;
&lt;br /&gt;
0x054, 0x090, 0x094, 0x098, 0x09c, 0x0a0, 0x0a4, 0x0a8, 0x0ac, 0x0b0, 0x0b4, 0x0b8, 0x0bc, 0x0c0, 0x0c4, 0x0c8, 0x0d0, 0x0d4, 0x0d8, 0x0dc, 0x0e0, 0x100, 0x108, 0x10c, 0x118, 0x11c, 0x124, 0x128, 0x12c, 0x130, 0x134, 0x138, 0x13c, 0x158, 0x15c, 0x164, 0x168, 0x16c, 0x170, 0x174, 0x178, 0x17c, 0x200, 0x204, 0x2e4, 0x2e8, 0x2ec, 0x2f4, 0x2f8, 0x310, 0x314, 0x320, 0x328, 0x344, 0x348, 0x370, 0x374, 0x37c, 0x380, 0x390, 0x394, 0x398, 0x3ac, 0x3b8, 0x3bc, 0x3c0, 0x3c4, 0x3d8, 0x3e8, 0x41c, 0x420, 0x424, 0x428, 0x42c, 0x430, 0x44c, 0x47c, 0x480, 0x484, 0x50c, 0x554, 0x558, 0x55c, 0x670, 0x674, 0x690, 0x694, 0x698, 0x69c, 0x6a0, 0x6a4, 0x6c0, 0x6c4, 0x6f0, 0x6f4, 0x960, 0x970, 0x974, 0xa20, 0xa24, 0xb88, 0xb8c, 0xbc4, 0xbc8, 0xbcc, 0xbd0, 0xbd4, 0xbd8, 0xbdc, 0xbe0, 0xbe4, 0xbe8, 0xbec, 0xc00, 0xc5c, 0xcac&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Whitelist was extended with 0x4c4, 0x4c8, 0x4cc, 0x584, 0x588, 0x58c.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] The IO registers in range 0x7000E400 (PMC) size 0xC00 skip the whitelist, and do a TrustZone call using [[SMC#ReadWriteRegister|ReadWriteRegister]].&lt;br /&gt;
&lt;br /&gt;
[4.0.0+] Access to the Memory Controller (0x70019000) also uses smcReadWriteRegister.&lt;br /&gt;
&lt;br /&gt;
Here is the whitelist imposed by that SMC, relative to the start of the PMC registers:&lt;br /&gt;
&lt;br /&gt;
0x000, 0x00c, 0x010, 0x014, 0x01c, 0x020, 0x02c, 0x030, 0x034, 0x038, 0x03c, 0x040, 0x044, 0x048, 0x0dc, 0x0e0, 0x0e4, 0x160, 0x164, 0x168, 0x170, 0x1a8, 0x1b8, 0x1bc, 0x1c0, 0x1c4, 0x1c8, 0x2b4, 0x2d4, 0x440, 0x4d8&lt;br /&gt;
&lt;br /&gt;
Here is the whitelist imposed by the SMC [[SMC#ReadWriteRegister|ReadWriteRegister]] (checked in addition to the whitelist in the ReadWriteRegister SVC), relative to the start of the MC registers:&lt;br /&gt;
&lt;br /&gt;
0x000, 0x004, 0x008, 0x00C, 0x010, 0x01C, 0x020, 0x030, 0x034, 0x050, 0x054, 0x090, 0x094, 0x098, 0x09C, 0x0A0, 0x0A4, 0x0A8, 0x0AC, 0x0B0, 0x0B4, 0x0B8, 0x0BC, 0x0C0, 0x0C4, 0x0C8, 0x0D0, 0x0D4, 0x0D8, 0x0DC, 0x0E0, 0x100, 0x108, 0x10C, 0x118, 0x11C, 0x124, 0x128, 0x12C, 0x130, 0x134, 0x138, 0x13C, 0x158, 0x15C, 0x164, 0x168, 0x16C, 0x170, 0x174, 0x178, 0x17C, 0x200, 0x204, 0x238, 0x240, 0x244, 0x250, 0x254, 0x258, 0x264, 0x268, 0x26C, 0x270, 0x274, 0x280, 0x284, 0x288, 0x28C, 0x294, 0x2E4, 0x2E8, 0x2EC, 0x2F4, 0x2F8, 0x310, 0x314, 0x320, 0x328, 0x344, 0x348, 0x370, 0x374, 0x37C, 0x380, 0x390, 0x394, 0x398, 0x3AC, 0x3B8, 0x3BC, 0x3C0, 0x3C4, 0x3D8, 0x3E8, 0x41C, 0x420, 0x424, 0x428, 0x42C, 0x430, 0x44C, 0x47C, 0x480, 0x484, 0x4C4, 0x4C8, 0x4CC, 0x50C, 0x554, 0x558, 0x55C, 0x584, 0x588, 0x58C, 0x670, 0x674, 0x690, 0x694, 0x698, 0x69C, 0x6A0, 0x6A4, 0x6C0, 0x6C4, 0x6F0, 0x6F4, 0x960, 0x970, 0x974, 0x9B8, 0xA20, 0xA24, 0xA88, 0xA94, 0xA98, 0xA9C, 0xAA0, 0xAA4, 0xAA8, 0xAAC, 0xAB0, 0xAB4, 0xAB8, 0xABC, 0xAC0, 0xAC4, 0xAC8, 0xACC, 0xAD0, 0xAD4, 0xAD8, 0xADC, 0xAE0, 0xB88, 0xB8C, 0xBC4, 0xBC8, 0xBCC, 0xBD0, 0xBD4, 0xBD8, 0xBDC, 0xBE0, 0xBE4, 0xBE8, 0xBEC, 0xC00, 0xC5C, 0xCAC&lt;br /&gt;
&lt;br /&gt;
== SetProcessActivity ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || [[#ProcessActivity]] || ProcessActivity&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CreateSharedMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || [[#MemoryPermission]] || LocalMemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || [[#MemoryPermission]] || RemoteMemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;SharedMemory&amp;gt; || SharedMemoryHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other perm can be used to enforce permission 1, 3, or 0x10000000 if don&#039;t care.&lt;br /&gt;
&lt;br /&gt;
Allocates memory from the current process&#039; pool partition.&lt;br /&gt;
&lt;br /&gt;
== MapTransferMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || Handle&amp;lt;TransferMemory&amp;gt; || TransferMemoryHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || [[#MemoryPermission]] || MemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must pass same size and permissions as given in [[#CreateTransferMemory]], otherwise error.&lt;br /&gt;
&lt;br /&gt;
== UnmapTransferMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || Handle&amp;lt;TransferMemory&amp;gt; || TransferMemoryHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Size must match size given in map syscall, otherwise there&#039;s an invalid-size error.&lt;br /&gt;
&lt;br /&gt;
== CreateInterruptEvent ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || [[#Interrupt]] || Interrupt&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || [[#InterruptType]] || InterruptType&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;ReadableEvent&amp;gt; || ReadableEventHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an event handle for the given IRQ number. Waiting on this handle will wait until the IRQ is triggered. The InterruptType argument configures the triggering. If it is 0, the IRQ is active HIGH level sensitive, if it is 1 it is rising-edge sensitive.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xF001:&#039;&#039;&#039; Flags was &amp;gt; 1&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xF201:&#039;&#039;&#039; IRQ above 0x3FF or outside the [[NPDM#Kernel_Access_Control|IRQ access mask]] was given.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCE01:&#039;&#039;&#039; A SlabHeap was exhausted (too many interrupts created).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xF401:&#039;&#039;&#039; IRQ already has an event registered.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xD201:&#039;&#039;&#039; The handle table is full. Try closing some handles.&lt;br /&gt;
&lt;br /&gt;
== QueryPhysicalAddress ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || VirtualAddress&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]]|| Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || uint64_t || PhysicalMemoryInfoAddress&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X2 || uint64_t || PhysicalMemoryInfoBaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X3 || uint64_t || PhysicalMemoryInfoSize&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queries the physical address of a virtual address. Will always fetch the lowest page-aligned mapping that contains the provided physical address.&lt;br /&gt;
&lt;br /&gt;
The returned PhysicalMemoryInfoBaseAddress is the virtual address of that page-aligned mapping, while PhysicalMemoryInfoAddress is the physical address of that page. PhysicalMemoryInfoSize is the amount of continuous physical memory in that mapping.&lt;br /&gt;
&lt;br /&gt;
== QueryIoMapping ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || uint64_t || IoAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R0 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1 || void* || VirtualAddress&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a virtual address mapped to a given IO range.&lt;br /&gt;
&lt;br /&gt;
== CreateDeviceAddressSpace ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || uint64_t || DeviceAddressSpaceStartAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R0, R1 || uint64_t || DeviceAddressSpaceEndAddress&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || Handle&amp;lt;DeviceAddressSpace&amp;gt; || DeviceAddressSpaceHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a virtual address space for binding device address spaces and returns a handle.&lt;br /&gt;
&lt;br /&gt;
StartAddr is normally set to 0 and EndAddr is normally set to 0xFFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== AttachDeviceAddressSpace ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || [[#DeviceName]] || DeviceName&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || Handle&amp;lt;DeviceAddressSpace&amp;gt; || DeviceAddressSpaceHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Attaches a device address space to a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== DetachDeviceAddressSpace ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || [[#DeviceName]] || DeviceName&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || Handle&amp;lt;DeviceAddressSpace&amp;gt; || DeviceAddressSpaceHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detaches a device address space from a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== MapDeviceAddressSpaceByForce ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;DeviceAddressSpace&amp;gt; || DeviceAddressSpaceHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R4 || uint64_t || DeviceAddressSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || R5, R6 || uint64_t || DeviceAddressSpaceAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || R7 || uint32_t || Option&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
Address is the userspace destination address, while DeviceAddressSpaceAddress is the source address between DeviceAddressSpaceStartAddress and DeviceAddressSpaceEndAddress (passed to [[#CreateDeviceAddressSpace]]).&lt;br /&gt;
&lt;br /&gt;
The userspace destination address must have the [[SVC#MemoryState|FlagCanDeviceMap]] bit set. Bit [[SVC#MemoryAttribute|DeviceShared]] will be set after mapping.&lt;br /&gt;
&lt;br /&gt;
The Option encodes a [[#MemoryPermission]] in the low 16 bits, and an indicator of IO mapping in the high bits.&lt;br /&gt;
&lt;br /&gt;
== MapDeviceAddressSpaceAligned ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;DeviceAddressSpace&amp;gt; || DeviceAddressSpaceHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R4 || uint64_t || DeviceAddressSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || R5, R6 || uint64_t || DeviceAddressSpaceAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || R7 || uint32_t  || Option&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
Same as [[#MapDeviceAddressSpaceByForce]], but the userspace destination address must have the [[SVC#MemoryState|FlagCanAlignedDeviceMap]] bit set instead.&lt;br /&gt;
&lt;br /&gt;
The Option encodes a [[#MemoryPermission]] in the low 16 bits, and an indicator of IO mapping in the high bits.&lt;br /&gt;
&lt;br /&gt;
== MapDeviceAddressSpace ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;DeviceAddressSpace&amp;gt; || DeviceAddressSpaceHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R0, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || R4 || uint64_t || DeviceAddressSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| (In) X5 || R5, R6 || uint64_t || DeviceAddressSpaceAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) W6 || R7 || [[#MemoryPermission]] || MemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1 || uint64_t || Size&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== UnmapDeviceAddressSpace ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;DeviceAddressSpace&amp;gt; || DeviceAddressSpaceHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R4 || uint64_t || DeviceAddressSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || R5, R6 || uint64_t || DeviceAddressSpaceAddress&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unmaps an attached device address space from an userspace address.&lt;br /&gt;
&lt;br /&gt;
== InvalidateProcessDataCache ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R1, R4 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== StoreProcessDataCache ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R1, R4 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FlushProcessDataCache ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R1, R4 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DebugActiveProcess ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || uint64_t || ProcessId&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BreakDebugProcess ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== TerminateDebugProcess ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetDebugEvent ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || [[#DebugEventInfo]]* || DebugEventInfo&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ContinueDebugEvent ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || uint32_t || [[#ContinueDebugFlags]] ([1.0.0-2.3.0] [[#ContinueDebugFlagsOld]])&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2 ([1.0.0-2.3.0] R2, R3) || uint64_t* ([1.0.0-2.3.0] uint64_t)|| ThreadIdList ([1.0.0-2.3.0] ThreadId)&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R3 || uint64_t || [3.0.0+] NumThreadIds&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maximum NumThreadIds is 64. 0 means &amp;quot;all threads&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success. The process has been resumed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xe401:&#039;&#039;&#039; Invalid debug handle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xf401:&#039;&#039;&#039; Process has debug events queued or is already running.&lt;br /&gt;
&lt;br /&gt;
== GetProcessList ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R1 || uint64_t* || ProcessIdBuffer&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || uint32_t || ProcessIdBufferSize&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || uint32_t || NumProcesses&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fills the provided array with the pids of currently living processes. A process &amp;quot;lives&amp;quot; so long as it is currently running or a handle to it still exists.&lt;br /&gt;
&lt;br /&gt;
It returns the total number of processes currently alive. If this number is bigger than the size of ProcessIdBuffer, the user won&#039;t have all the pids.&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xd401:&#039;&#039;&#039; The provided buffer is outside the process address space.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xe601:&#039;&#039;&#039; copyToUser failed. The provided buffer is not user-accessible.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xee01:&#039;&#039;&#039; The provided buffer size is too big. Max value is 0xFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== GetThreadList ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R1 || uint64_t* || ThreadIdBuffer&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || uint32_t || ThreadIdBufferSize&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || R3 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || uint32_t || NumThreads&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetDebugThreadContext ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0 || [[#ThreadContext]]* || ThreadContext&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R1 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || uint64_t || ThreadId&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || R4 || uint32_t || [[#ThreadContextFlags]]&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SetDebugThreadContext ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || uint64_t || ThreadId&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R1 || [[#ThreadContext]]* || ThreadContext&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || R4 || uint32_t || [[#ThreadContextFlags]]&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== QueryDebugProcessMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || [[#MemoryInfo]]* || MemoryInfo&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || [[#PageInfo]] || PageInfo&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ReadDebugProcessMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || void* || MemoryBufferAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || void* || SrcAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== WriteDebugProcessMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || void* || MemoryBufferAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || void* || DstAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SetHardwareBreakPoint ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || [[#HardwareBreakPointRegisterName]] || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || uint64_t || Flags&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R1, R4 || uint64_t || Value&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets one of the AArch64 hardware breakpoints. The nintendo switch has 6 hardware breakpoints, and 4 hardware watchpoints. The syscall has two behaviors depending on the value of HardwareBreakPointRegisterName:&lt;br /&gt;
&lt;br /&gt;
If HardwareBreakPointRegisterName &amp;lt; 0x10, then it sets one of the AArch64 hardware breakpoints. Flags will go to DBGBCRn_EL1, and value to DBGBVRn_EL1. The only flags the user is allowed to set are those in the bitmask 0x7F01E1. Furthermore, the kernel will or it with 0x4004, in order to set various security flags to guarantee the watchpoints only triggers for code in EL0. If the user asks for a Breakpoint Type of ContextIDR match, the kernel shall use the given DebugHandle to set DBGBVRn_EL1 to the ContextID of the debugged process.&lt;br /&gt;
&lt;br /&gt;
If HardwareBreakPointRegisterName is between 0x10 and 0x20 (exclusive), then it sets one of the AArch64 hardware watchpoints. Flags will go to DBGWCRn_EL1, and the value to DBGWVRn_EL1. The only flags the user is allowed to set are those in the bitmask 0xFF0F1FF9. Furthermore, the kernel will or it with 0x104004. This will set various security flags, and set the watchpoint type to be a Linked Watchpoint. This means that you need to link it to a Linked ContextIDR breakpoint. Check the ARM documentation for more information.&lt;br /&gt;
&lt;br /&gt;
Note that HardwareBreakPointRegisterName 0 to 4 match only to Virtual Address, while HardwareBreakPointRegisterName 5 and 6 match against either Virtual Address, ContextID, or VMID. As such, if you are configuring a breakpoint to link for a watchpoint, make sure you use hardware_breakpoint_id 5 or 6.&lt;br /&gt;
&lt;br /&gt;
For more documentation for hardware breakpoints, check out the AArch64 documentation for the [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0488h/way1382455558968.html DBGBCRn_EL1 register] and the [http://infocenter.arm.com/help/topic/com.arm.doc.ddi0488h/way1382455560629.html DBGWCRn_EL1 register]&lt;br /&gt;
&lt;br /&gt;
== GetDebugThreadParam ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2 || Handle&amp;lt;Debug&amp;gt; || DebugHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R0, R1 || uint64_t || ThreadId&lt;br /&gt;
|-&lt;br /&gt;
| (In) W4 || R3 || [[#DebugThreadParam]] || DebugThreadParam&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1, R2 || uint64_t || Out0&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W2 || R3 || uint32_t || Out1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetSystemInfo ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || [[#SystemInfoType]] || SystemInfoType&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || Handle || Handle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || uint64_t || SystemInfoSubType&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || uint64_t || SystemInfo&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CreatePort ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || int32_t || MaxSessions&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || R3 || bool || IsLight&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || R0 || uint64_t || Name&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || Handle&amp;lt;Port&amp;gt; || ServerPortHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W2 || R2 || Handle&amp;lt;Port&amp;gt; || ClientPortHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ManageNamedPort ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || char* || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || int32_t || MaxSessions&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;Port&amp;gt; || ServerPortHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ConnectToPort ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || Handle&amp;lt;Port&amp;gt; || ClientPortHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;Session&amp;gt; || SessionHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SetProcessMemoryPermission ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || void* || Addr&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R1, R4 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || R5 || [[#MemoryPermission]] || MemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the memory permissions for the specified memory with the supplied process handle.&lt;br /&gt;
&lt;br /&gt;
This throws an error(0xD801) when the input perm is &amp;gt;0x5, hence -WX and RWX are not allowed.&lt;br /&gt;
&lt;br /&gt;
== MapProcessMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0 || void* || DstAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || void* || SrcAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R4 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps the src address from the supplied process handle into the current process.&lt;br /&gt;
&lt;br /&gt;
This allows mapping code and rodata with RW- permission.&lt;br /&gt;
&lt;br /&gt;
== UnmapProcessMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0 || void* || DstAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || void* || SrcAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R4 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unmaps what was mapped by [[#MapProcessMemory]].&lt;br /&gt;
&lt;br /&gt;
== QueryProcessMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0 || [[#MemoryInfo]]* || MemoryInfo&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R1, R3 || void* || Address&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || R1 || [[#PageInfo]] || PageInfo&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equivalent to [[#QueryMemory]] except takes a process handle.&lt;br /&gt;
&lt;br /&gt;
== MapProcessCodeMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || void* || DstAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R1, R4 || void* || SrcAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R5, R6 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Takes a process handle, and maps normal heap in that process as executable code in that process. Used when loading NROs. This does not support using the current-process handle alias.&lt;br /&gt;
&lt;br /&gt;
== UnmapProcessCodeMemory ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || R2, R3 || void* || DstAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R1, R4 || void* || SrcAddress&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R5, R6 || uint64_t || Size&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unmaps what was mapped by [[#MapProcessCodeMemory]].&lt;br /&gt;
&lt;br /&gt;
== CreateProcess ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || [[#CreateProcessParameter]]* || CreateProcessParameter&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || uint32_t* || Capabilities&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || int32_t || CapabilitiesNum&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Takes a [[#CreateProcessParameter]] as input.&lt;br /&gt;
Capabilities points to an array of [[NPDM#Kernel_Access_Control|kernel capabilities]].&lt;br /&gt;
CapabilitiesNum is a number of capabilities in the Capabilities array (number of element, not number of bytes).&lt;br /&gt;
&lt;br /&gt;
=== Result codes ===&lt;br /&gt;
&#039;&#039;&#039;0x0:&#039;&#039;&#039; Success.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCA01:&#039;&#039;&#039; Attempted to map more code pages than available in address space.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xCC01:&#039;&#039;&#039; Provided CodeAddr is invalid (make sure it&#039;s in range?)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xE401:&#039;&#039;&#039; The resource handle passed is invalid.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xE601:&#039;&#039;&#039; Attempt to copy procinfo from user-supplied pointer failed. Attempt to copy capabilities_num from user-supplied pointer failed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xE801:&#039;&#039;&#039; Attempted to create a 32-bit process with a 36-bit address space.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0xF001:&#039;&#039;&#039; Unused bits are set in mmuflags. Unknown address space type used.&lt;br /&gt;
&lt;br /&gt;
== StartProcess ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || int32_t || MainThreadPriority&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || R2 || int32_t || DefaultCpuId&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || R3, R4 || uint64_t || MainThreadStackSize&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== TerminateProcess ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetProcessInfo ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R1 || Handle&amp;lt;Process&amp;gt; || ProcessHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R2 || [[#ProcessInfoType]] || ProcessInfoType&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || R1, R2 || uint64_t || [[#ProcessState]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an enum with value 0-7.&lt;br /&gt;
&lt;br /&gt;
== CreateResourceLimit ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || ||&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || Result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle&amp;lt;ResourceLimit&amp;gt; || ResourceLimitHandle&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SetResourceLimitLimitValue ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || R0 || Handle&amp;lt;ResourceLimit&amp;gt; || ResourceLimitHandle&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || R1 || [[#LimitableResource]] || LimitableResource&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || R2, R3 || int64_t || LimitValue&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || R0 || [[#Result]] || Result&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CallSecureMonitor ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument64 || Argument32 || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || R0 || uint64_t || [[SMC#Secure_Monitor_calls|FunctionId]]&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1-X7 || R1-R7 || uint64_t || SMC arguments&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X0 || R0 || [[SMC#Result|Result]] || SMC result&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1-X7 || R1-R7 || uint64_t || SMC output&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Takes in a SMC function ID in X0, and arguments for that SMC function in X1-X7.&lt;br /&gt;
&lt;br /&gt;
Passing an invalid SMC function ID or calling from a core other than core 3 will result in a secure monitor panic.&lt;br /&gt;
&lt;br /&gt;
The kernel parses bits 9-15 in the passed SMC function ID (per the ARM SMC calling convention), and when set uses as an indicator to translate a pointer in the associated register (X1-X7) to a physical address. The kernel will translate any address mapped as R-W, other addresses (R--, R-X, or invalid pointers) will be translated as 0/NULL.&lt;br /&gt;
&lt;br /&gt;
Output is returned raw from the Secure Monitor; X0 will be the untranslated SMC result and X1-X7 will contain other SMC output (or be unchanged, depending on the SMC).&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
[2.0.0+] Exactly 6 debug SVCs require that [[SPL_services#GetConfig|IsDebugMode]] is non-zero. Error 0x4201 is returned otherwise.&lt;br /&gt;
* BreakDebugProcess&lt;br /&gt;
* ContinueDebugEvent&lt;br /&gt;
* WriteDebugProcessMemory&lt;br /&gt;
* SetDebugThreadContext&lt;br /&gt;
* TerminateDebugProcess&lt;br /&gt;
* SetHardwareBreakPoint&lt;br /&gt;
&lt;br /&gt;
DebugActiveProcess stops execution of the target process, the normal method for resuming it requires ContinueDebugEvent(see above). Closing the debug handle also results in execution being resumed.&lt;br /&gt;
&lt;br /&gt;
= Enum/Structures =&lt;br /&gt;
== InfoType ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Handle type || InfoType || InfoSubType || Description&lt;br /&gt;
|-&lt;br /&gt;
| Process || 0 || 0 || CoreMask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 1 || 0 || PriorityMask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 2 || 0 || AliasRegionAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 3 || 0 || AliasRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 4 || 0 || HeapRegionAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 5 || 0 || HeapRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 6 || 0 || TotalMemorySize. Total memory available(free+used).&lt;br /&gt;
|-&lt;br /&gt;
| Process || 7 || 0 || UsedMemorySize. Total used size of codebin memory + main-thread stack + allocated heap.&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 8 || 0 || DebuggerAttached&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 9 || 0 || ResourceLimit&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 10 || -1, {current coreid} || IdleTickCount&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 11 || 0-3 || RandomEntropy. Used to seed usermode PRNGs.&lt;br /&gt;
|-&lt;br /&gt;
| Process || 12 || 0 || [2.0.0+] AslrRegionAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 13 || 0 || [2.0.0+] AslrRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 14 || 0 || [2.0.0+] StackRegionAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 15 || 0 || [2.0.0+] StackRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 16 || 0 || [3.0.0+] SystemResourceSizeTotal&lt;br /&gt;
|-&lt;br /&gt;
| Process || 17 || 0 || [3.0.0+] SystemResourceSizeUsed&lt;br /&gt;
|-&lt;br /&gt;
| Process || 18 || 0 || [3.0.0+] ProgramId&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 19 || 0 || [4.0.0-4.1.0] InitialProcessIdRange_LowerBound&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 19 || 1 || [4.0.0-4.1.0] InitialProcessIdRange_UpperBound&lt;br /&gt;
|-&lt;br /&gt;
| Process || 20 || 0 || [5.0.0+] UserExceptionContextAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 21 || 0 || [6.0.0+] TotalNonSystemMemorySize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 22 || 0 || [6.0.0+] UsedNonSystemMemorySize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 23 || 0 || [9.0.0+] IsApplication&lt;br /&gt;
|-&lt;br /&gt;
| Process || 24 || 0 || [11.0.0+] FreeThreadCount&lt;br /&gt;
|-&lt;br /&gt;
| Thread  || 25 ([1.0.0-12.1.0] 0xF0000002) || 0-3, -1 || ThreadTickCount. When 0-3 are passed, gets specific core CPU ticks spent on thread. When -1 is passed, gets total CPU ticks spent on thread.&lt;br /&gt;
|-&lt;br /&gt;
| Process || 26 || 0 || [14.0.0+] IsSvcPermitted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SystemInfoType ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Handle type || SystemInfoType || SystemInfoSubType || Description&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 0 || 0 || TotalPhysicalMemorySize_Application&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 0 || 1 || TotalPhysicalMemorySize_Applet&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 0 || 2 || TotalPhysicalMemorySize_System&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 0 || 3 || TotalPhysicalMemorySize_SystemUnsafe&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 1 || 0 || UsedPhysicalMemorySize_Application&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 1 || 1 || UsedPhysicalMemorySize_Applet&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 1 || 2 || UsedPhysicalMemorySize_System&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 1 || 3 || UsedPhysicalMemorySize_SystemUnsafe&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 2 || 0 || InitialProcessIdRange_LowerBound&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 2 || 1 || InitialProcessIdRange_UpperBound&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ThreadContextFlags ==&lt;br /&gt;
Bitfield of one of more of these:&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bit || Bitmask || Name || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1 || General-purpose registers || If in 64-bit mode, GPRs 0–28 will be read/written. If in 32-bit mode, GPRs 0–12 will be read/written.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 2 || Control registers || Reads/writes the FP, LR, PC, SP, PSTATE, and TPIDR registers.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 4 || Floating-point registers || Reads/writes the floating-point vector registers.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 8 || Floating-point control registers || Reads/writes the FPCR and FPSR registers.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DeviceName ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || AFI&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AVPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DC&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DCB&lt;br /&gt;
|-&lt;br /&gt;
| 4 || HC&lt;br /&gt;
|-&lt;br /&gt;
| 5 || HDA&lt;br /&gt;
|-&lt;br /&gt;
| 6 || ISP2&lt;br /&gt;
|-&lt;br /&gt;
| 7 || MSENCNVENC&lt;br /&gt;
|-&lt;br /&gt;
| 8 || NV&lt;br /&gt;
|-&lt;br /&gt;
| 9 || NV2&lt;br /&gt;
|-&lt;br /&gt;
| 10 || PPCS&lt;br /&gt;
|-&lt;br /&gt;
| 11 || SATA&lt;br /&gt;
|-&lt;br /&gt;
| 12 || VI&lt;br /&gt;
|-&lt;br /&gt;
| 13 || VIC&lt;br /&gt;
|-&lt;br /&gt;
| 14 || XUSB_HOST&lt;br /&gt;
|-&lt;br /&gt;
| 15 || XUSB_DEV&lt;br /&gt;
|-&lt;br /&gt;
| 16 || TSEC&lt;br /&gt;
|-&lt;br /&gt;
| 17 || PPCS1&lt;br /&gt;
|-&lt;br /&gt;
| 18 || DC1&lt;br /&gt;
|-&lt;br /&gt;
| 19 || SDMMC1A&lt;br /&gt;
|-&lt;br /&gt;
| 20 || SDMMC2A&lt;br /&gt;
|-&lt;br /&gt;
| 21 || SDMMC3A&lt;br /&gt;
|-&lt;br /&gt;
| 22 || SDMMC4A&lt;br /&gt;
|-&lt;br /&gt;
| 23 || ISP2B&lt;br /&gt;
|-&lt;br /&gt;
| 24 || GPU&lt;br /&gt;
|-&lt;br /&gt;
| 25 || GPUB&lt;br /&gt;
|-&lt;br /&gt;
| 26 || PPCS2&lt;br /&gt;
|-&lt;br /&gt;
| 27 || NVDEC&lt;br /&gt;
|-&lt;br /&gt;
| 28 || APE&lt;br /&gt;
|-&lt;br /&gt;
| 29 || SE&lt;br /&gt;
|-&lt;br /&gt;
| 30 || NVJPG&lt;br /&gt;
|-&lt;br /&gt;
| 31 || HC1&lt;br /&gt;
|-&lt;br /&gt;
| 32 || SE1&lt;br /&gt;
|-&lt;br /&gt;
| 33 || AXIAP&lt;br /&gt;
|-&lt;br /&gt;
| 34 || ETR&lt;br /&gt;
|-&lt;br /&gt;
| 35 || TSECB&lt;br /&gt;
|-&lt;br /&gt;
| 36 || TSEC1&lt;br /&gt;
|-&lt;br /&gt;
| 37 || TSECB1&lt;br /&gt;
|-&lt;br /&gt;
| 38 || NVDEC1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CodeMemoryOperation ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || MapOwner&lt;br /&gt;
|-&lt;br /&gt;
| 1 || MapSlave&lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnmapOwner&lt;br /&gt;
|-&lt;br /&gt;
| 3 || UnmapSlave&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LimitableResource ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || PhysicalMemoryMax || Bytes of memory a process may allocate.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ThreadCountMax || Amount of threads a process can create.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || EventCountMax || Amount of events a process can create through [[#CreateEvent]] or [[#SendAsyncRequestWithUserBuffer]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || TransferMemoryCountMax || Amount of TransferMemory a process can create through [[#CreateTransferMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || SessionCountMax || Amount of session a process can create through [[#CreateSession]], [[#ConnectToPort]] or [[#ConnectToNamedPort]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ThreadActivity =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Runnable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ProcessActivity ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Runnable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ProcessInfoType ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ProcessState|ProcessState]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ProcessState ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Created ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreatedAttached ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Started ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Crashed || Processes will not enter this state unless they were created with [[#CreateProcessParameter|EnableDebug]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || StartedAttached ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Exiting ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Exited ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DebugSuspended ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DebugThreadParam ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || DynamicPriority&lt;br /&gt;
|-&lt;br /&gt;
| 1 || SchedulingStatus&lt;br /&gt;
|-&lt;br /&gt;
| 2 || PreferredCpuCore&lt;br /&gt;
|-&lt;br /&gt;
| 3 || CurrentCpuCore&lt;br /&gt;
|-&lt;br /&gt;
| 4 || AffinityMask&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Dynamic priority: output in out2&lt;br /&gt;
&lt;br /&gt;
Scheduling status: out1 contains bit0: is debug-suspended, bit1: is user-suspended ([[#SetThreadActivity]] 1 or [[#SetProcessActivity]] 1).&lt;br /&gt;
Out2 contains {suspended, idle, running, terminating} =&amp;gt; {5, 0, 1, 4}&lt;br /&gt;
&lt;br /&gt;
PreferredCpuCore: output in out2&lt;br /&gt;
&lt;br /&gt;
CurrentCpuCore: output in out2&lt;br /&gt;
&lt;br /&gt;
AffinityMask: output in out1&lt;br /&gt;
&lt;br /&gt;
== CreateProcessParameter ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 12 || || ProcessName (doesn&#039;t have to be null-terminated)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || 4 || || ProcessCategory (0: regular title, 1: kernel built-in)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 8 || || TitleId&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 8 || || CodeAddr&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || || CodeNumPages&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || || Flags&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit0 || Is64BitInstruction&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit3-1 || [[#AddressSpaceType]]&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit4 || [2.0.0+] EnableDebug&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit5 || EnableAslr&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit6 || IsApplication&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit7 || [4.0.0] UseSecureMemory&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit10-7 || [5.0.0+] MemoryRegion (0 = Application, 1 = Applet, 2 = SecureSystem, 3 = NonSecureSystem)&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit11 || [7.0.0+] OptimizeMemoryAllocation (only allowed in combination with IsApplication)&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 4 || || ResourceLimitHandle (can be zero)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 4 || || [3.0.0+] SystemResourceNumPages&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On [1.0.0] there&#039;s only one MemoryRegion.&lt;br /&gt;
&lt;br /&gt;
On [2.0.0-4.0.0] MemoryRegion is 1 for built-ins and 0 for rest.&lt;br /&gt;
&lt;br /&gt;
On [5.0.0] MemoryRegion is specified in CreateProcessArgs. There are now 4 pool partitions.&lt;br /&gt;
&lt;br /&gt;
On [5.0.0] (maybe lower?) a zero ResourceLimitHandle defaults to sysmodule limits and 0x12300000 bytes of memory.&lt;br /&gt;
&lt;br /&gt;
The PersonalMmHeap are allocated as follows:&lt;br /&gt;
* For the application, normal insecure pool is used. Carveout 5 is used to provide protection.&lt;br /&gt;
* For the applet, a pre-allocated secure pool segment of size 0x400000 is used.&lt;br /&gt;
* For sysmodules, secure pool is allocated.&lt;br /&gt;
&lt;br /&gt;
=== AddressSpaceType ===&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Type || Name || Width || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || AddressSpace32Bit || 32 ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AddressSpace64BitOld || 36 ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || AddressSpace32BitNoReserved || 32 || Appears to be missing map region [?]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] AddressSpace64Bit || 39 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 8 || BaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 8 || Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 4 || [[#MemoryType]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 4 || [[#MemoryAttribute]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 4 || [[#MemoryPermission]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || 4 || IpcRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || DeviceRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || Padding: always zero&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryPermission ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Name || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Read || Can be set by [[#SetMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Write || Can be set by [[#SetMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Execute || Can be set by [[#SetProcessMemoryPermission]] and [[#ControlCodeMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| 28 || DontCare ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryAttribute ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Name || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Locked || Used by MapMemory, as an async IPC user buffer.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || IpcLocked || True when IpcRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeviceShared || True when DeviceRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Uncached || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryState ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Description || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 7-0 || [[#MemoryType]] || &lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#SetMemoryPermission|FlagCanReprotect]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 9 || FlagCanDebug || Allows using [[#WriteDebugProcessMemory]] on segments mapped read-only.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || FlagCanUseIpc || Allows sending this region as an IPC A/B/W buffer with flags=0.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || FlagCanUseNonDeviceIpc || Allows sending this region as an IPC A/B/W buffer with flags=1.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || FlagCanUseNonSecureIpc || Allows sending this region as an IPC A/B/W buffer with flags=3.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || FlagMapped ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#SetProcessMemoryPermission|FlagCode]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [[#MapMemory|FlagCanAlias]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#MapProcessCodeMemory|FlagCanCodeAlias]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [[#CreateTransferMemory|FlagCanTransfer]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [[#QueryPhysicalAddress|FlagCanQueryPhysical]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [[#MapDeviceAddressSpace|FlagCanDeviceMap]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#MapDeviceAddressSpaceAligned|FlagCanAlignedDeviceMap]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#SendSyncRequestWithUserBuffer|FlagCanIpcUserBuffer]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 22 || FlagReferenceCounted || The physical memory blocks backing this region are refcounted.&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [[#MapProcessMemory|FlagCanMapProcess]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [[#SetMemoryAttribute|FlagCanChangeAttribute]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] [[#CreateCodeMemory|FlagCanCodeMemory]] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== MemoryType ===&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Type || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000000 || Free ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x00002001 || Io || Mapped by kernel capability parsing in [[#CreateProcess]]. &lt;br /&gt;
|-&lt;br /&gt;
| 0x00042002 || Static || Mapped by kernel capability parsing in [[#CreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00DC7E03 || Code || Mapped during [[#CreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| [1.0.0+]&lt;br /&gt;
&lt;br /&gt;
0x01FEBD04&lt;br /&gt;
&lt;br /&gt;
[4.0.0+]&lt;br /&gt;
&lt;br /&gt;
0x03FEBD04&lt;br /&gt;
|| CodeData || Transition from 0xDC7E03 performed by [[#SetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| [1.0.0+]&lt;br /&gt;
0x017EBD05&lt;br /&gt;
&lt;br /&gt;
[4.0.0+]&lt;br /&gt;
&lt;br /&gt;
0x037EBD05&lt;br /&gt;
|| Normal || Mapped using [[#SetHeapSize]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00402006 || Shared || Mapped using [[#MapSharedMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00482907 || [1.0.0] Alias || Mapped using [[#MapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00DD7E08 || AliasCode || Mapped using [[#MapProcessCodeMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| [1.0.0+]&lt;br /&gt;
&lt;br /&gt;
0x01FFBD09&lt;br /&gt;
&lt;br /&gt;
[4.0.0+]&lt;br /&gt;
&lt;br /&gt;
0x03FFBD09&lt;br /&gt;
|| AliasCodeData || Transition from 0xDD7E08 performed by [[#SetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x005C3C0A || [[IPC_Marshalling|Ipc]] || IPC buffers with descriptor flags=0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x005C3C0B || Stack || Mapped using [[#MapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x0040200C || [[Thread Local Storage|ThreadLocal]] || Mapped during [[#CreateThread]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x015C3C0D || Transfered || Mapped using [[#MapTransferMemory]] when the owning process has perm=0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x005C380E || SharedTransfered || Mapped using [[#MapTransferMemory]] when the owning process has perm!=0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0040380F || SharedCode || Mapped using [[#MapProcessMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000010 || Inaccessible ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x005C3811 || [[IPC_Marshalling|NonSecureIpc]] || IPC buffers with descriptor flags=1.&lt;br /&gt;
|-&lt;br /&gt;
| 0x004C2812 || [[IPC_Marshalling|NonDeviceIpc]] || IPC buffers with descriptor flags=3.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00002013 || Kernel || Mapped in kernel during [[#CreateThread]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00402214 || [4.0.0+] GeneratedCode || Mapped in kernel during [[#ControlCodeMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00402015 || [4.0.0+] CodeOut || Mapped in kernel during [[#ControlCodeMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00002016 || [13.0.0+] Coverage || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ArbitrationType ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Type&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || WaitIfLessThan&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || DecrementAndWaitIfLessThan&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || WaitIfEqual&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SignalType ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Type&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || Signal&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || SignalAndIncrementIfEqual&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || SignalAndModifyBasedOnWaitingThreadCountIfEqual&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ContinueDebugFlagsOld ==&lt;br /&gt;
[1.0.0-2.3.0]&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bit || Bitmask || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1 || IgnoreException (note: ResumeAllThreads or debug-suspended-thread-id needed)&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 2 || SwallowException&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 4 || ResumeAllThreads&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ContinueDebugFlags ==&lt;br /&gt;
[3.0.0+]&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bit || Bitmask || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1 || IgnoreException (note: doesn&#039;t need to be set in the same call than Resume)&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 2 || DontCatchExceptions&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 4 || Resume&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 8 || IgnoreOtherThreadsExceptions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
IgnoreExceptionsOfOthers is like IgnoreException but acts on all threads that aren&#039;t in the input list. The affected threads are resumed.&lt;br /&gt;
&lt;br /&gt;
Only one of of Resume and IgnoreOtherThreadsExceptions can be set at a time.&lt;br /&gt;
&lt;br /&gt;
If the input number of threads is 0, this means &amp;quot;all threads&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== DebugEventInfo ==&lt;br /&gt;
The below table is for the Aarch64 version of the system call. For A32, all u64 fields but title/process/thread id are actually u32, making the structure 0x28-byte-big (0x40 for a64).&lt;br /&gt;
&lt;br /&gt;
Size: 0x40&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || u32 || EventType&lt;br /&gt;
|-&lt;br /&gt;
| 4 || u32 || Flags (bit0: NeedsContinue)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || u64 || ThreadId&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || || PerTypeSpecifics&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
AttachProcess specific:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || u64 || TitleId&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || u64 || ProcessId&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || char[12] || ProcessName&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || u32 || MmuFlags&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || u64 || [5.0.0+] UserExceptionContextAddr&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
AttachThread specific:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || u64 || ThreadId&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || u64 || TlsPtr&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || u64 || Entrypoint&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Exit specific:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || u32|| Type (0=PausedThread, 1=RunningThread, 2=ExitedProcess, 3=TerminatedProcess)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Exception specific:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || u32 || ExceptionType&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || u64 || FaultRegister&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || || PerExceptionSpecifics&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== DebugEventType ===&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || AttachProcess&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AttachThread&lt;br /&gt;
|-&lt;br /&gt;
| 2 || ExitProcess&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ExitThread&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Exception&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== DebugExceptionType ===&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Trap (*)&lt;br /&gt;
|-&lt;br /&gt;
| 1 || InstructionAbort&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DataAbortMisc (**)&lt;br /&gt;
|-&lt;br /&gt;
| 3 || PcSpAlignmentFault&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DebuggerAttached&lt;br /&gt;
|-&lt;br /&gt;
| 5 || BreakPoint&lt;br /&gt;
|-&lt;br /&gt;
| 6 || UserBreak&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DebuggerBreak&lt;br /&gt;
|-&lt;br /&gt;
| 8 || BadSvcId&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [2.0.0+] SError&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; Undefined instructions, software breakpoints, some other traps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;**&amp;lt;/nowiki&amp;gt; Data aborts, FP traps, and everything else that doesn&#039;t belong to any of the above.&lt;br /&gt;
&lt;br /&gt;
Trap specifics:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || u32 || Opcode&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
BreakPoint specifics:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || u32 || IsWatchpoint&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
UserBreak specifics:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || u32 || Info0&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || u64 || Info1&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || u64 || Info2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
BadSvcId specifics:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || u32 || SvcId&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Exception handling =&lt;br /&gt;
First of all, a function that might be called by synchronous exception handler and that is called by the SError handler fetches the exception info, adjusts PC, panics on exceptions taken from EL1, then dispatches the exception.&lt;br /&gt;
&lt;br /&gt;
The dispatcher has two mutually exclusive exception reporting methods:&lt;br /&gt;
* by storing information at the start of the process&#039;s TLS memregion (TPIDRRO_EL0) and jumping back to the crt0&lt;br /&gt;
* by using KDebug&lt;br /&gt;
&lt;br /&gt;
KDebug dispatching is used when at least one of the following conditions are met:&lt;br /&gt;
* SMC ConfigItem KernelMemConfig bit 1 is NOT set (it isn&#039;t on retail), unless: this is a software or hardware breakpoint, or a watchpoint, or [4.0.0+?] the process is attached and this is a Google PNaCl trap instruction (see LLVM source)&lt;br /&gt;
* FAR doesn&#039;t point to a valid address in mapped-readable CodeStatic memory (i.e. this is the case for NRO and JIT memory) or this is one of the following exceptions (it particular, that doesn&#039;t include FP exceptions occurring in CodeStatic memory):&lt;br /&gt;
** Uncategorized&lt;br /&gt;
** IllegalState&lt;br /&gt;
** SupervisorCallA32&lt;br /&gt;
** SupervisorCallA64&lt;br /&gt;
** PCAlignment&lt;br /&gt;
** SPAlignment&lt;br /&gt;
** SError&lt;br /&gt;
** BreakpointLowerEl&lt;br /&gt;
** SoftwareStepLowerEl (note: no way set single-step flag; not parsed)&lt;br /&gt;
** WatchpointLowerEl&lt;br /&gt;
** SoftwareBreakpointA32 (note: not parsed)&lt;br /&gt;
** SoftwareBreakpointA64 (note: not parsed)&lt;br /&gt;
    &lt;br /&gt;
In all other cases the userland-handled exception path is taken.&lt;br /&gt;
&lt;br /&gt;
KDebug path:&lt;br /&gt;
&lt;br /&gt;
If the process is attached, the exception is reported to the KDebug. If the thread was continued using flag IgnoreExceptions, it returns from the exception as if nothing happened.&lt;br /&gt;
&lt;br /&gt;
If the latter is not the case, or if the process isn&#039;t attached, proceed to [2.0.0+] crash reporting (or in [1.0.0] just terminate the process): &lt;br /&gt;
if EnableDebug is set, and depending on the process state (more than one crash per process isn&#039;t permitted) it may signal itself with ProcessState_Crashed so that PM asks NS to start creport so that creport attaches to it and reports the crashes. Otherwise, just terminate.&lt;br /&gt;
&lt;br /&gt;
Userland reporting path and [[#ReturnFromException]]:&lt;br /&gt;
&lt;br /&gt;
TLS region start (A64):&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x148 || Exception stack&lt;br /&gt;
|-&lt;br /&gt;
| 0x148 || 0x78 || ExceptionFrameA64&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
ExceptionFrameA64:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x48 (8*9) || GPRs 0..8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x8 || lr&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || 0x8 || sp&lt;br /&gt;
|-&lt;br /&gt;
| 0x58 || 0x8 || pc (elr_el1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || 0x4 || pstate &amp;amp; 0xFF0FFE20&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || 0x4 || afsr0&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || 0x4 || afsr1&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C || 0x4 || esr&lt;br /&gt;
|-&lt;br /&gt;
| 0x70 || 0x8 || far&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLS region start (A32):&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x178 || Exception stack&lt;br /&gt;
|-&lt;br /&gt;
| 0x148 || 0x44 || ExceptionFrameA32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
ExceptionFrameA32:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 (8*4) || GPRs 0..7.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x4 || sp&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x4 || lr&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x4 || pc (elr_el1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 0x4 || tpidr_el0 = 1&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x4 || cpsr &amp;amp; 0xFF0FFE20&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || 0x4 || afsr0&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x4 || afsr1&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C || 0x4 || esr&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || 0x4 || far&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In that case, after storing the regs in the TLS, the exception handler returns to the application&#039;s crt0 (entrypoint), with X0=&amp;lt;error description code&amp;gt; (see below) and X1=SP=frame=&amp;lt;stack top&amp;gt; (see above)&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Desc. code || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0x100 || Instruction abort&lt;br /&gt;
|-&lt;br /&gt;
| 0x102 || Misaligned PC&lt;br /&gt;
|-&lt;br /&gt;
| 0x103 || Misaligned SP&lt;br /&gt;
|-&lt;br /&gt;
| 0x106 || [2.0.0+] SError&lt;br /&gt;
|-&lt;br /&gt;
| 0x301 || Bad SVC&lt;br /&gt;
|-&lt;br /&gt;
| 0x104 || Uncategorized, CP15RTTrap, CP15RRTTrap, CP14RTTrap, CP14RRTTrap, IllegalState, SystemRegisterTrap&lt;br /&gt;
|-&lt;br /&gt;
| 0x101 || None of the above, EC &amp;lt;= 0x34 and not a breakpoint&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(During normal app boot the process is invoked with X0=0 and X1=main_thread_handle. The crt0 of retail apps determines whether to boot normally or handle an exception if X0 is set to 0 or not)&lt;br /&gt;
&lt;br /&gt;
The application is supposed to promptly update the contents of elr_el1 to a user handler (and any other regs it sees fit) and call [[#ReturnFromException]] (error code) to call that handler. The latter is then expected to promptly abort the program.&lt;br /&gt;
&lt;br /&gt;
[[#ReturnFromException]] updates the contents of the kernel stack frame with what the user provided in the TLS structure, sets TPIDR_EL0 to 1, then:&lt;br /&gt;
* if the provided error code is 0, gracefully pivots and returns from exception&lt;br /&gt;
* if it is not, replays the exception and pass it to the KDebug (see above). One can pass 0x10001 to prevent process termination. If the process is attached, this also prevents crash-collection/termination (different from the exception handler behavior)&lt;br /&gt;
&lt;br /&gt;
If an exception occurs from the above user handler, the entire exception handling process will repeat with the new exception.&lt;br /&gt;
&lt;br /&gt;
Note that if a thread that wasn&#039;t faulting calls [[#ReturnFromException]], it signals an &amp;quot;invalid syscall&amp;quot; exception&lt;br /&gt;
&lt;br /&gt;
Note that [[SMC|IsDebugMode]] is not used during exception-handling, except for enabling printing a message to UART-A. This UART code causes a system-hang on retail (likely due to a loop that doesn&#039;t exit). This printing doesn&#039;t seem to run when the process is attached for debugging?&lt;/div&gt;</summary>
		<author><name>Liamwhite</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Super_Mario_3D_All-Stars&amp;diff=11664</id>
		<title>Super Mario 3D All-Stars</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Super_Mario_3D_All-Stars&amp;diff=11664"/>
		<updated>2022-04-17T14:06:32Z</updated>

		<summary type="html">&lt;p&gt;Liamwhite: fix wiki syntax&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Super Mario 3D All-Stars (SM3DAS) game.&lt;br /&gt;
&lt;br /&gt;
The initial menu is the Stardust launcher, which has the base [[NCM_services#ProgramId|ProgramId]] 010049900F546000. Each game launched from here has a different [[Applet_Manager_services#ProgramSpecifyKind|ProgramIndex]], therefore each [[NCM_services#ProgramId|ProgramId]] differs: 0x1 (010049900F546001) SuperMario64, 0x2 (010049900F546002) SuperMarioSunshine, 0x3 (010049900F546003) SuperMarioGalaxy.&lt;br /&gt;
&lt;br /&gt;
The launcher launches each game by using [[Applet_Manager_services#ExecuteProgram|ExecuteProgram]] with ProgramIndex={above values}, with 0x10-byte [[Applet_Manager_services#UnpopToUserChannel|parameter-data]]: {+0x0 = [[Settings_services#LanguageCode|LanguageCode]] selected in the launcher for this game, +0x8/+0xC = floats loaded from a fixed-data array specific for each game, which games can use with [[Audio_services#SetAudioDeviceOutputVolumeAuto|SetAudioDeviceOutputVolume]]}. Each game returns to the launcher by using [[Applet_Manager_services#ExecuteProgram|ExecuteProgram]] with ProgramIndex=0, no [[Applet_Manager_services#UnpopToUserChannel|parameter-data]] is passed to the launcher.&lt;br /&gt;
&lt;br /&gt;
Each game uses different methods of emulation.&lt;br /&gt;
&lt;br /&gt;
These games use Vulkan for rendering.&lt;br /&gt;
&lt;br /&gt;
These games save PlayReports with [[BCAT_services|prepo]], the fields include &amp;quot;num_stars&amp;quot; etc.&lt;br /&gt;
&lt;br /&gt;
The pause-menu when pressing the &#039;-&#039; button in each game uses the Offline web-applet with [[Internet_Browser#WebSession|WebSession]].&lt;br /&gt;
&lt;br /&gt;
= NPDM =&lt;br /&gt;
This section documents the [[NPDM]] for the launcher and each game.&lt;br /&gt;
* Launcher: Roughly the same as most Switch games&#039; NPDM.&lt;br /&gt;
* SuperMario64: Locked down since this uses [[JIT_services|JIT]]. Compared to the Launcher NPDM (besides ProgramId):&lt;br /&gt;
** ProgramIdMin/ProgramIdMax is 010049900F546001-010049900F546001, with other NPDMs it&#039;s the normal full Application-range.&lt;br /&gt;
** Access to [[SVC|svcMapPhysicalMemory]]/[[SVC|svcUnmapPhysicalMemory]] was removed, and access to [[SVC|svcCreateCodeMemory]] was added.&lt;br /&gt;
** The only other difference is service-access-control: this was locked down, and only has the following services: [[Account_services|acc:u0]], [[NS_Services|aoc:u]], [[PPC_services#apm|apm]], [[Applet_Manager_services|appletOE]], [[Audio_services|audren:u]], [[Filesystem_services|fsp-srv]], [[HID_services|hid]], [[JIT_services|jit:u]], [[RO_services|ldr:ro]], [[Log_services|lm]], [[NV_services|nvdrv]], [[Parental_Control_services|pctl]], [[BCAT_services|prepo:u]], [[Settings_services|set]], [[PCV_services|time:u]], [[Display_services|vi:u]].&lt;br /&gt;
** Note that aoc:u, pctl, and lm are only accessible since sdknso automatically initializes these during startup, the main-codebin itself doesn&#039;t use these.&lt;br /&gt;
* SuperMarioSunshine: Same as Launcher (besides ProgramId), except [[NPDM#Flags|flag]] OptimizeMemoryAllocation is set.&lt;br /&gt;
* SuperMarioGalaxy: Same as Launcher (besides ProgramId), except [[NPDM#Flags|flags]] is 0x4: Is64BitInstruction=0(AArch32) and ProcessAddressSpace=0x2.&lt;br /&gt;
&lt;br /&gt;
= SuperMario64 =&lt;br /&gt;
This is a Nintendo 64 emulator. This uses [[JIT_services|JIT]] for running the emulated executable. RomFs also contains an AOT [[NRO]]. A NRO does get loaded, however it&#039;s not used other than that (no symbols from the NRO are resolved).&lt;br /&gt;
&lt;br /&gt;
At the time of release, this was the very first title to use [[JIT_services|JIT]] on retail.&lt;br /&gt;
&lt;br /&gt;
The ROMIMAGE .bin in RomFs is identical to the [https://tcrf.net/Super_Mario_64_(Nintendo_64)/Regional_and_Version_Differences#Shindou_Pak_Taiou_Version Shindou] region N64 ROM. Patches are applied at runtime with the config/lua files.&lt;br /&gt;
&lt;br /&gt;
The LanguageCode is loaded from the launch-parameter passed by the launcher, if not available it will fallback to the output from [[Applet_Manager_services#GetDesiredLanguage|GetDesiredLanguage]]. This is used to select the &amp;lt;language&amp;gt; to load from RomFs &amp;quot;/Message/&amp;quot;, the data from there is then used for patching the ROM. Note that the .lua file runs &amp;lt;code&amp;gt;n64InitMessageData();&amp;lt;/code&amp;gt; from the GameBegin() function.&lt;br /&gt;
&lt;br /&gt;
The ROMIMAGE .bin in RomFs can be replaced with other data (an unofficial image for example) when the config files are adjusted, however note that in some cases a hang may occur during the loading screen.&lt;br /&gt;
&lt;br /&gt;
RomFs contains the following:&lt;br /&gt;
* &amp;quot;/Pipeline.cache&amp;quot;, &amp;quot;/shader_p1_frag.spv&amp;quot;, &amp;quot;/shader_p1_vert.spv&amp;quot;, &amp;quot;/shader_vulkan_frag.spv&amp;quot;, &amp;quot;/shader_vulkan_vert.spv&amp;quot;&lt;br /&gt;
* &amp;quot;/Message/&amp;lt;language&amp;gt;/&amp;quot; contains:&lt;br /&gt;
** &amp;quot;Messages.bin&amp;quot;, &amp;quot;UI_Font8.bin&amp;quot;, &amp;quot;UI_Font16.bin&amp;quot;, &amp;quot;UI_Font16_code2.bin&amp;quot;, &amp;quot;UI_FontS88.bin&amp;quot;.&lt;br /&gt;
* &amp;quot;/.nrr/&amp;quot; contains:&lt;br /&gt;
** &amp;quot;EmuAppNX64.nrr&amp;quot;: The [[NRR]] for the [[JIT_services|JitPlugin]].&lt;br /&gt;
** &amp;quot;04_UNSMJ3.002.nrr&amp;quot;: [[NRR]] for the AOT [[NRO]].&lt;br /&gt;
* &amp;quot;/nro/&amp;quot; contains:&lt;br /&gt;
** &amp;quot;EmuSystemJITPlugin.nro&amp;quot;: The [[NRO]] for the [[JIT_services|JitPlugin]].&lt;br /&gt;
** &amp;quot;NROBuilder.nro&amp;quot;: AOT [[NRO]].&lt;br /&gt;
** &amp;quot;05_UNSMJ3.002.nro&amp;quot;: Same as &amp;quot;NROBuilder.nro&amp;quot;.&lt;br /&gt;
** &amp;quot;/rom/&amp;quot;: This contains the ROM sub-directory, in this case that dir-name is &amp;quot;Stardust_JP&amp;quot; which contains the following:&lt;br /&gt;
*** &amp;quot;Textures/texture_pack.cpio&amp;quot;: Standard (?) .cpio archive containing textures.&lt;br /&gt;
*** &amp;quot;00_UNSMJ3.002.meta&amp;quot;: Contains json metadata for the other files in this directory, etc.&lt;br /&gt;
*** &amp;quot;01_UNSMJ3.002.bin&amp;quot;: This is the ROMIMAGE.&lt;br /&gt;
*** &amp;quot;02_UNSMJ3.002.cfg&amp;quot;: Configuration json file, ROMCONFIG.&lt;br /&gt;
*** &amp;quot;03_UNSMJ3.002.pcb&amp;quot;: This is the &amp;quot;PRECMP&amp;quot; file referenced by the .meta. See [[#EmuSystemJITPlugin]]. Using this can be disabled by changing the &amp;quot;PRECMP&amp;quot; string in the .meta to an invalid string, etc.&lt;br /&gt;
*** &amp;quot;04_UNSMJ3.002.nrr&amp;quot;: Unused [[NRR]] which is the same as &amp;quot;/.nrr/04_UNSMJ3.002.nrr&amp;quot;, except the [[NRR#Certification|Certification]] and ApplicationId are all-zero.&lt;br /&gt;
*** &amp;quot;05_UNSMJ3.002.nro&amp;quot;: Identical to &amp;quot;/nro/05_UNSMJ3.002.nro&amp;quot;.&lt;br /&gt;
*** &amp;quot;06_UNSMJ3.002.lua&amp;quot;: This is the &amp;quot;ROMPATCH&amp;quot; Lua file referenced by the .meta.&lt;br /&gt;
*** &amp;quot;07_UNSMJ3.002.ppl&amp;quot;: This is the &amp;quot;PIPELINE&amp;quot; file referenced by the .meta.&lt;br /&gt;
&lt;br /&gt;
== Emulation Notes ==&lt;br /&gt;
The generated-code runs from the main-thread. The following 4 threads are created:&lt;br /&gt;
* Audio thread.&lt;br /&gt;
* &amp;quot;g_trlRenderTaskThread&amp;quot;. Calls funcptr/object-vfunc from a list of tasks (funcptr/object only used if set), where the tasks are sent by the main-thread. These tasks can be triggered by accessing various IO regs with Write32 (see below), etc.&lt;br /&gt;
* A thread which basically does nothing, just uses a Semaphore and sleeps, while checking state.&lt;br /&gt;
* An unknown thread.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;n64MemDefault{Read/Write}{bitsize}(...)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}: implements memory read/write, all read/written data is byte-swapped. First param is the u32 vaddr. For Write, the second param is the value. For Read, the returned u32 is the read value.&lt;br /&gt;
* &amp;lt;code&amp;gt;n64MemDefaultReadSpecial{bitsize}(...)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}: same as &amp;lt;code&amp;gt;n64MemDefaultRead{bitsize}&amp;lt;/code&amp;gt;, except this runs the additional Special functionality when accessing RAM.&lt;br /&gt;
* &amp;lt;code&amp;gt;n64MemDefault{Read/Write}{bitsize}WithDestLog(...)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}: same as &amp;lt;code&amp;gt;n64MemDefault{Read/Write}{bitsize}&amp;lt;/code&amp;gt;, except this calls an additional logging func when accessing RAM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Read8/Write8 only implements access for RAM and SP_DMEM/SP_IMEM. 0 is returned for Read when the address is unrecognized.&lt;br /&gt;
* Read16/Write16 only implements access for RAM. Read16WithDestLog/Write16WithDestLog will additionally call the logging func if the address is in the IO region (high byte is 0x04). 0 is returned for Read when the address is unrecognized.&lt;br /&gt;
* Read32/Write32 implements RAM access and all supported non-RAM IO/memory access. 0 is returned for Read when the address is unrecognized.&lt;br /&gt;
* Read64/Write64 are implemented the same as *16 above, except this is for 64bit.&lt;br /&gt;
&lt;br /&gt;
== EmuSystemJITPlugin ==&lt;br /&gt;
This section documents the [[JIT_services|JIT]] plugin.&lt;br /&gt;
&lt;br /&gt;
First, [[JIT_services#Control|Control]] is used with a 0xEB0-byte struct for the InBuffer, and cmd in_u64=0. The OutBuffer is unused. This does initialization, and copies the input struct to workmem+0x0.&lt;br /&gt;
&lt;br /&gt;
The u64 for [[JIT_services#GenerateCode|GenerateCode]] is the type: 1-4 are valid. Type1 is used first, then type2. Then type3 is used with data loaded from the &amp;quot;PRECMP&amp;quot; file (the passed array data will be empty if the PRECMP file is not available). Type4 is only used when executing an emu_pc_addr which was not previously compiled, with a matching emu_pc_addr.&lt;br /&gt;
&lt;br /&gt;
The u32 for the input Struct32 size is ignored by the plugin.&lt;br /&gt;
&lt;br /&gt;
* Type1: Struct32 and InBuffer are unused. Generates the entry code which can be called for running the rest of the code in the CodeMemory. After the generated code finishes setup, it jumps to x0.&lt;br /&gt;
* Type2: Struct32 and InBuffer are unused. Generates the code for returning from CodeMemory, which is used by the rest of the generated code.&lt;br /&gt;
* Type3: The emulator passes the 0x8-bytes from InBuffer+0 as the input Struct32, however the plugin doesn&#039;t use the Struct32. The emulator passes InBuffer_size=0x8C00048 and OutBuffer_size=0x2900008. This generates code for the MIPS code specified in the InBuffer. The InBuffer contains array data etc. The InBuffer can contain multiple blocks of code, which are generally individual MIPS functions. The MIPS instructions are big-endian.&lt;br /&gt;
* Type4: 0x20-bytes are passed for the input Struct32: u32 +0 = emu_pc_addr, u32 +4 = set by emulator but unused by the plugin, u32 +0x18 = instruction_count (which determines the InBuffer size), the rest is unused / overwritten by the plugin. This generates code for the MIPS code specified in the InBuffer. InBuffer+0 is the u32s for the big-endian MIPS instructions. The OutBuffer is 0x2000C-bytes:&lt;br /&gt;
** +0x0 is an array of u32s with the count from u32 +0x20004. Each entry is the generated-code offset for each compiled MIPS instruction, relative to the CodeRange offset.&lt;br /&gt;
** +0x10000 is an array of u32s with the count from u32 +0x20004. Each entry is flags for each compiled MIPS instruction.&lt;br /&gt;
** The 3 u32s at +0x20000 are the same as OutBuffer+0x0 with type1/type2 (except the last two fields can be non-zero). +0x20004 is the total compiled MIPS instructions. +0x20008 is emu_pc_addr for the first compiled instruction.&lt;br /&gt;
&lt;br /&gt;
0xC-bytes are copied to the OutBuffer with type1/type2, these come from workmem. These 3 u32s are left at all-zero, except for +0 which is the generated_code_size (which is then copied to the output CodeRange size).&lt;br /&gt;
&lt;br /&gt;
The 0xEB0-byte controldata struct has the following structure (all addrs/data are from the emulator user-process):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || Data addr: g_pGPR&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8 || Data addr: g_pFPR&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8 || Data addr: g_pCP0&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x8 || Data addr: g_nRegHi&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x8 || Data addr: g_nRegLo&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x8 || Data addr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x8 || Data addr: g_nFCSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x8 || Data addr: g_bN64CpuCmpEndCheck&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || 0x8 || Data addr: g_nN64CpuPC&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x8 || Data addr: g_nN64CpuJmpPC. s32, normally -1. When not -1 this is a value which can be copied into g_nN64CpuJmpPC by the generated code, with g_nN64CpuJmpPC being reset to -1 afterwards regardless of the original value.&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || 0x8 || Data addr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x58 || 0x8 || Data addr: g_nN64CpuHaveExp&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || 0x658 || Array of funcptrs. Called with w0=instruction_value from generated code for handling instructions&#039; implementation, when the plugin itself doesn&#039;t handle it.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B8 || 0x8 || Funcptr: &amp;lt;code&amp;gt;n64CPUProcInstCOP1Check()&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C0 || 0x8 || Funcptr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C8 || 0x8 || Funcptr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D0 || 0x8 || Funcptr: &amp;lt;code&amp;gt;n64CPUSetRegisterCP0(int, unsigned int)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D8 || 0x8 || Funcptr: &amp;lt;code&amp;gt;n64CPUGetRegisterCP0(int)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x6E0 || 0x20 || Funcptrs for reading data: &amp;lt;code&amp;gt;n64MemDefaultRead{bitsize}(unsigned int)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64} (32 uses &amp;lt;code&amp;gt;n64MemDefaultRead32WithDestLog&amp;lt;/code&amp;gt;). Unused by the plugin.&lt;br /&gt;
|-&lt;br /&gt;
| 0x700 || 0x20 || Funcptrs for reading Special data: &amp;lt;code&amp;gt;n64MemDefaultReadSpecial{bitsize}(unsigned int)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}.&lt;br /&gt;
|-&lt;br /&gt;
| 0x720 || 0x20 || Funcptrs for writing data: &amp;lt;code&amp;gt;n64MemDefaultWrite{bitsize}(unsigned int, ...)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64} (32 uses &amp;lt;code&amp;gt;n64MemDefaultWrite32WithDestLog&amp;lt;/code&amp;gt;). Unused by the plugin.&lt;br /&gt;
|-&lt;br /&gt;
| 0x740 || 0x20 || Funcptrs for reading data via the WithDestLog version: &amp;lt;code&amp;gt;n64MemDefaultRead{bitsize}WithDestLog(unsigned int)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}.&lt;br /&gt;
|-&lt;br /&gt;
| 0x760 || 0x20 || Funcptrs for writing data via the WithDestLog version: &amp;lt;code&amp;gt;n64MemDefaultWrite{bitsize}WithDestLog(unsigned int, ...)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}.&lt;br /&gt;
|-&lt;br /&gt;
| 0x780 || 0x8 || Funcptr: &amp;lt;code&amp;gt;n64CPU_CallLuaAfterInst(unsigned int, unsigned int)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x788 || 0x8 || Funcptr: &amp;lt;code&amp;gt;n64CPU_CallLuaBeforeInst(unsigned int, unsigned int)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x790 || 0x8 || Funcptr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x798 || 0x4 || Array count for the the following array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x79C || 0x180 (0x20*0xC) || Array data with the above count, each entry is 0xC-bytes. The emulator loads this from config array &amp;quot;Idle&amp;quot;. +0 = u32 emu_pc_addr (config &amp;quot;JmpAddr&amp;quot;), +4 = u32 instruction_value (config &amp;quot;JmpInst&amp;quot;), +8 = u32 is_idle (config &amp;quot;IsIdle&amp;quot;, 0x1 = enabled).&lt;br /&gt;
|-&lt;br /&gt;
| 0x91C || 0x4 || Array count for the the following array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x920 || 0x500 (0x40*0x14) || Array data with the above count, each entry is 0x14-bytes. The emulator loads this from config array &amp;quot;SpecialInst&amp;quot;. +0 = u32 emu_pc_addr (config &amp;quot;Addr&amp;quot;), +4 = u32 instruction_value (config &amp;quot;Inst&amp;quot;), +8 = u32 flags. The emulator sets the flags to 0 by default, then compares config &amp;quot;Type&amp;quot; with various strings to determine the value. Flags: bit0 = Type &amp;quot;BreakLoop&amp;quot;, bit5 = Type &amp;quot;LoadFrameBuffer&amp;quot;, bit6 = Type &amp;quot;Lua_BeforeInst&amp;quot;, bit7 = Type &amp;quot;Lua_AfterInst&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When the config for {any of the previously mentioned Type strings} is set to value 1, the emulator will also enable the corresponding flags bit mentioned above. Likewise with config &amp;quot;Return&amp;quot;, which sets flags bit8.&lt;br /&gt;
&lt;br /&gt;
When the plugin loads a funcptr from +0x740, it will load a funcptr from +0x700 instead if there&#039;s a matching entry here which has bit5 set.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE20 || 0x4 || Array count for the the following array. The plugin doesn&#039;t use this.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE24 || 0x80 (0x10*0x8) || Array data with the above count, each entry is 0x8-bytes. The emulator loads this from config array &amp;quot;FrameBuffer&amp;quot;. +0 = u32 (config &amp;quot;Addr&amp;quot;), +4 = u32 (config &amp;quot;Length&amp;quot;). The plugin doesn&#039;t use this.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEA4 || 0x4 || Set to 0 by default, then if available the emulator sets bit flags here depending on the content of the config for &amp;lt;code&amp;gt;&amp;quot;Cmp&amp;quot;, &amp;quot;g_nN64CpuCmpTLBCheckLevel&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEA8 || 0x4 || Set to 0 by default by the emulator. With config &amp;lt;code&amp;gt;&amp;quot;Cmp&amp;quot;, &amp;quot;CodeMultiAddr&amp;quot;&amp;lt;/code&amp;gt; this is set to 1, and with config &amp;lt;code&amp;gt;&amp;quot;Cmp&amp;quot;, &amp;quot;BlockDynamicPC&amp;quot;&amp;lt;/code&amp;gt; this is set to 2. The plugin only checks whether this ==2 or !=2, so values 0-1 are basically the same.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEAC || 0x4 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= SuperMarioSunshine =&lt;br /&gt;
This is a Nintendo Gamecube emulator. The emulator (which is the main-codebin) name is &amp;quot;Hagi&amp;quot;. This uses an AOT [[NRO]] for running the emulated executable.&lt;br /&gt;
&lt;br /&gt;
Since this uses AOT, attempting to run a different .dol with this emulator is equivalent to attempting to run an emulator with an executable where .text (code) is the from the original executable, while everything else is from the other executable.&lt;br /&gt;
&lt;br /&gt;
This emulator supports arguments with argc/argv, when launched officially zero [[Loader_services#SetProgramArgument|arguments]] are passed for this (unless [[Loader_services#SetProgramArgument|SetProgramArgument]] is used manually prior to launching). The emulator will also load arguments from RomFs &amp;quot;/default_cmd.txt&amp;quot; when argc==1, otherwise it loads arguments from a filepath loaded elsewhere. Hence, when not launched with arguments with an official launch, &amp;quot;/default_cmd.txt&amp;quot; is not used. Some of the supported arguments are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument !! Description&lt;br /&gt;
|-&lt;br /&gt;
| --volume=&amp;amp;lt;0..100&amp;amp;gt; || Set sound volume (default: 100).&lt;br /&gt;
|-&lt;br /&gt;
| --disable-file-cache || Disable file cache if supported by the platform.&lt;br /&gt;
|-&lt;br /&gt;
| --no-dol-hash || Do not calculate DOL hash (unsafe)&lt;br /&gt;
|-&lt;br /&gt;
| --screenshot-period=&amp;amp;lt;value&amp;amp;gt;, -sp || Takes screenshots every n frame&lt;br /&gt;
|-&lt;br /&gt;
| --screenshot-write-queue-thread-count=&amp;amp;lt;0..n&amp;amp;gt; || Change the number of threads allocated to the screenshot write queue, 0 to disable (default: 1).&lt;br /&gt;
|-&lt;br /&gt;
| --delete-after-load || Delete save state after a successful load.&lt;br /&gt;
|-&lt;br /&gt;
| --listen-port=&amp;amp;lt;port&amp;amp;gt; || Specify the service port to listen to (default: 1234).&lt;br /&gt;
|-&lt;br /&gt;
| --card-uncompressed || Do not compress card.&lt;br /&gt;
|-&lt;br /&gt;
| --sync-guest-none || Don&#039;t synchronize emulation, run as fast as possible.&lt;br /&gt;
|-&lt;br /&gt;
| --gecko-patch=&amp;amp;lt;name&amp;amp;gt; || Apply Gecko patch &amp;amp;lt;name&amp;amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| --log=&amp;amp;lt;file&amp;amp;gt; || Log to file instead of stdout. Defaults to stdout&lt;br /&gt;
|-&lt;br /&gt;
| --rootdir=&amp;amp;lt;path&amp;amp;gt;, -r&amp;amp;lt;path&amp;amp;gt; || Set the root directory&lt;br /&gt;
|-&lt;br /&gt;
| --no-patch || Do not apply standard patch&lt;br /&gt;
|-&lt;br /&gt;
| --stop-failed-test[=&amp;amp;lt;number&amp;amp;gt;] || Stop subtests after &amp;amp;lt;number&amp;amp;gt; differences (default 10).&lt;br /&gt;
|-&lt;br /&gt;
| --exit=&amp;amp;lt;value&amp;amp;gt;, -e || Exit after n frames&lt;br /&gt;
|-&lt;br /&gt;
| --help, -h || Print usage and exit.&lt;br /&gt;
|-&lt;br /&gt;
| --mute || Start ROM with mute sound.&lt;br /&gt;
|-&lt;br /&gt;
| --sync-guest-with-wall || Synchronize emulation with wall time.&lt;br /&gt;
|-&lt;br /&gt;
| --sync-guest-with-host || Synchronize emulation with host.&lt;br /&gt;
|-&lt;br /&gt;
| --test=&amp;amp;lt;filename&amp;amp;gt;, -t || Starts emulator in unit test mode.&lt;br /&gt;
|-&lt;br /&gt;
| --no-pip || Don&#039;t use pipeline database.&lt;br /&gt;
|-&lt;br /&gt;
| --play-input || Play previously recorded input&lt;br /&gt;
|-&lt;br /&gt;
| --command=&amp;amp;lt;file&amp;amp;gt; || Use file as the contents of the command line (one arg per line).&lt;br /&gt;
|-&lt;br /&gt;
| --dim-screen-after=&amp;amp;lt;s&amp;amp;gt; || Dim screen after &amp;amp;lt;s&amp;amp;gt; seconds of inactivity.&lt;br /&gt;
|-&lt;br /&gt;
| --random-inputs-period=&amp;amp;lt;0..n&amp;amp;gt; || Change the random inputs period in number of frames (default: 10).&lt;br /&gt;
|-&lt;br /&gt;
| --config=&amp;amp;lt;filename&amp;amp;gt;, -cfg || Gives path to the config file&lt;br /&gt;
|-&lt;br /&gt;
| --ask, -a || Ask for a rom and execute it.&lt;br /&gt;
|-&lt;br /&gt;
| --load-state-slot=&amp;amp;lt;index&amp;amp;gt;, -lss&amp;amp;lt;index&amp;amp;gt; || Load save state by index.&lt;br /&gt;
|-&lt;br /&gt;
| --load-state-file=&amp;amp;lt;filename&amp;amp;gt;, -lsf&amp;amp;lt;filename&amp;amp;gt; || Load save state by filename.&lt;br /&gt;
|-&lt;br /&gt;
| --generatetest=&amp;amp;lt;directory&amp;amp;gt;, -gt || Starts emulator in unit test mode and generate output files inside the given directory.&lt;br /&gt;
|-&lt;br /&gt;
| --waitcontroller, -wc || Stop CPU until controller 0 has been detected&lt;br /&gt;
|-&lt;br /&gt;
| --card-format=&amp;amp;lt;size_in_Mbits&amp;amp;gt; || Format card using given size in MBits (default 4, possible 8, 16, 32, 64, 128).&lt;br /&gt;
|-&lt;br /&gt;
| --card-force-copy || Force card copy from read-only support to read-write support (on supported platforms).&lt;br /&gt;
|-&lt;br /&gt;
| --screenshot-output-format=[png&amp;amp;#x7C;ppm] || Change the format of the screenshots when using the generic screenshot capture code (default: png).&lt;br /&gt;
|-&lt;br /&gt;
| --config-override || Use a specific config override filename.&lt;br /&gt;
|-&lt;br /&gt;
| --random-inputs || Use random inputs instead of values from physical controllers.&lt;br /&gt;
|-&lt;br /&gt;
| --log-unit-test || Enable log in unit test mode.&lt;br /&gt;
|-&lt;br /&gt;
| --break-on-start, -bos || Break at the start of the rom.&lt;br /&gt;
|-&lt;br /&gt;
| --record-input || Record input&lt;br /&gt;
|-&lt;br /&gt;
| --screenshot-write-queue-capacity=&amp;amp;lt;1..n&amp;amp;gt; || Change the capacity of the screenshot queue (default: thread-count * 2 + 1).&lt;br /&gt;
|-&lt;br /&gt;
| --random-inputs-seed=&amp;amp;lt;0..n&amp;amp;gt; || Change the random inputs seed value (default: 0).&lt;br /&gt;
|-&lt;br /&gt;
| --listen-address=&amp;amp;lt;address&amp;amp;gt; || Specify the service address to listen to (default: 0.0.0.0).&lt;br /&gt;
|-&lt;br /&gt;
| --gui, -gui || Use the GUI mode&lt;br /&gt;
|-&lt;br /&gt;
| --break-on-start-dsp, -bosd || Break at the start of the dsp program.&lt;br /&gt;
|-&lt;br /&gt;
| --no-db-config || Do not use the ROM DB config override.&lt;br /&gt;
|-&lt;br /&gt;
| --features || Print features and exit.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This emulator uses various hashes, SHA-1 is used for this.&lt;br /&gt;
&lt;br /&gt;
This supports loading Bios from a file where the path is determined using the specified LanguageCode, when config flags &amp;quot;Emulate&amp;quot; and &amp;quot;LoadBios&amp;quot; are true, however with the MarioSunshine config the latter config flag is false.&lt;br /&gt;
&lt;br /&gt;
RomFs contains the following: &lt;br /&gt;
* &amp;quot;/hagi.config&amp;quot;: Emulator json configuration.&lt;br /&gt;
* &amp;quot;/hagi-override.config&amp;quot;: Emulator json configuration.&lt;br /&gt;
* &amp;quot;/rom.json&amp;quot;: ROM json configuration, contains the following fields:&lt;br /&gt;
** &amp;quot;UID&amp;quot;: Game-name.&lt;br /&gt;
** &amp;quot;DolHash&amp;quot;: Hash.&lt;br /&gt;
** &amp;quot;ROM&amp;quot;: An array of strings for the absolute file path for the ROM. In this case, it only contains the following: &amp;quot;rom:/MarioSunshine/Super_Mario_Sunshine_Stardust-trimmed.gcm&amp;quot;.&lt;br /&gt;
* &amp;quot;/.nrr/Hagi.nrr&amp;quot;: [[NRR]] for the AOT [[NRO]].&lt;br /&gt;
* &amp;quot;/MarioSunshine/&amp;quot;: This contains the following:&lt;br /&gt;
** &amp;quot;Super_Mario_Sunshine_Stardust-trimmed.gcm&amp;quot;: This is the .gcm image mentioned above.&lt;br /&gt;
** &amp;quot;Super_Mario_Sunshine_Stardust-trimmed.hash&amp;quot;: Contains json configuration for various hashes.&lt;br /&gt;
* &amp;quot;/data/&amp;quot;: This contains the following:&lt;br /&gt;
** &amp;quot;database/&amp;quot;: This contains the following:&lt;br /&gt;
*** &amp;quot;config/MarioSunshine.config&amp;quot;: This contains game-specific emulator json configuration.&lt;br /&gt;
*** &amp;quot;hagi/MarioSunshine.json&amp;quot;: This contains ROM json configuration. IDs, names, etc. This also contains various hashes, including a duplicate of the above .hash file.&lt;br /&gt;
*** &amp;quot;pip/MarioSunshine/pipelineDB.pip&amp;quot;&lt;br /&gt;
*** &amp;quot;vulkan/MarioSunshine/B1317A6632265CF763766CF6339AC8D1.cache&amp;quot;: This is the .cache file mentioned in [[#Savedata]].&lt;br /&gt;
** &amp;quot;gekko/MarioSunshine/nx/MarioSunshine.nrolz&amp;quot;: This is the AOT [[NRO]]. LZ4 compressed, first 4-bytes is the big-endian decompressed size, then the compressed data follows.&lt;br /&gt;
** &amp;quot;lazy_texture_replace/MarioSunshine&amp;quot;: Contains PNG textures.&lt;br /&gt;
** &amp;quot;saves/MarioSunshine/A.sav&amp;quot;: Savedata. Presumably used to create the initial savedata file?&lt;br /&gt;
** &amp;quot;texture_replace/&amp;quot;: Contains &amp;quot;MarioSunshine.har&amp;quot; and &amp;quot;MarioSunshine.hix&amp;quot;.&lt;br /&gt;
** &amp;quot;video_replace/MarioSunshine/&amp;quot;: Contains MP4 videos.&lt;br /&gt;
&lt;br /&gt;
== AOT NRO ==&lt;br /&gt;
This section documents the AOT NRO. There are only two symbols from NRO which the main-codebin does lookup for and uses: &amp;quot;SetGekkoMemoryPointer&amp;quot; and &amp;quot;GetStatifierInfo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
During initialization, &amp;lt;code&amp;gt;nn::os::AllocateAddressRegion&amp;lt;/code&amp;gt; is used with size 0x100200000. Then &amp;lt;code&amp;gt;nn::os::AllocateMemoryPages&amp;lt;/code&amp;gt; is used (which uses [[SVC#MapPhysicalMemory|svcMapPhysicalMemory]]):&lt;br /&gt;
* base+0 size 0x1000 is allocated.&lt;br /&gt;
* base+0x80000000 size 0x1800000 is allocated.&lt;br /&gt;
* base+0xE0000000 size 0x4000 is allocated.&lt;br /&gt;
* base+0xFFF00000 size 0x200000 is allocated.&lt;br /&gt;
&lt;br /&gt;
Initially SetGekkoMemoryPointer is called with base+0x80000000, however at some point it&#039;s called (?) with base+0.&lt;br /&gt;
&lt;br /&gt;
The AOT NRO does all main-memory accesses by accessing {global ptr set by SetGekkoMemoryPointer}+{ppc_addr}. Therefore, above base+0 == ppc_addr 0x0. Since svcMapPhysicalMemory is used above, attempting to access any PPC-addrs not in the allocated regions above will result in the emulator crashing due to accessing unmapped memory - accessing non-PPC emulator data with invalid PPC-addrs is not possible. These crashes may happen when attempting to run a different .dol with the emulator as previously mentioned.&lt;br /&gt;
&lt;br /&gt;
GetStatifierInfo takes an input string param and an output u64* param. This returns a bool: 0 = error, 1 = success. The NRO compares the input string with various strings to determine an array index, returning 0 if there&#039;s no match. Otherwise, the u64 data from the located array entry is copied to the output u64.&lt;br /&gt;
* &amp;quot;GET_FUNCTION_INFO&amp;quot;: Ptr to a table, where each entry is 0x18-bytes. Structure: +0x0 = ppc_code_addr, +0x8 = nro_code_addr, +0x10 = string ptr (normally &amp;quot;&amp;quot;).&lt;br /&gt;
* &amp;quot;GET_FUNCTION_INFO_SIZE&amp;quot; Ptr to the size of the FUNCTION_INFO table, in entries.&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
Each func in the NRO listed in the above table (which are the AOT funcs) is called with x0={state ptr}, where state contains:&lt;br /&gt;
* +0x0: u32 array for the PPC GPRs.&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
= SuperMarioGalaxy =&lt;br /&gt;
This appears to use an emulator similar to the one used by [[#SuperMarioSunshine]]. The code/data for the MarioGalaxy executable is included directly in the main-codebin.&lt;br /&gt;
&lt;br /&gt;
RomFs contains the following: &lt;br /&gt;
* &amp;quot;/hagi.config&amp;quot;: This is mostly the same as the &amp;quot;/hagi.config&amp;quot; for [[#SuperMarioSunshine]], except with various config fields adjusted.&lt;br /&gt;
* &amp;quot;/data/&amp;quot;: This contains the following:&lt;br /&gt;
** &amp;quot;database/&amp;quot;: This contains &amp;quot;pip/pipelineDB.pip&amp;quot; and &amp;quot;vulkan/FDBD9F0C3FEA5778E10FFFA74093E0B8.cache&amp;quot;.&lt;br /&gt;
** &amp;quot;dsp/&amp;quot;: This contains &amp;quot;drom.bin&amp;quot; and &amp;quot;irom.bin&amp;quot;.&lt;br /&gt;
** &amp;quot;ondemand_texture_replace/MarioGalaxy/&amp;quot;: This contains PNG textures.&lt;br /&gt;
** &amp;quot;texture_replace/&amp;quot;: This contains &amp;quot;MarioGalaxy.har&amp;quot;, &amp;quot;MarioGalaxy.hix&amp;quot;, &amp;quot;MarioGalaxy_&amp;lt;language&amp;gt;.har&amp;quot;, &amp;quot;MarioGalaxy_&amp;lt;language&amp;gt;.hix&amp;quot;, &amp;quot;MarioGalaxy_Sub.har&amp;quot;, &amp;quot;MarioGalaxy_Sub.hix&amp;quot;.&lt;br /&gt;
** &amp;quot;video_replace/MarioGalaxy/MovieData/&amp;quot;: This contains MP4 videos.&lt;br /&gt;
* The rest is the MarioGalaxy game assets stored directly in RomFs.&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the game-update changes.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
In ExeFs, the only [[NPDM]] change was the usual ACID pubkey/signature update. The only other ExeFs change, was that the main-codebin was updated only for SuperMarioSunshine/SuperMarioGalaxy.&lt;br /&gt;
&lt;br /&gt;
RomFs changes:&lt;br /&gt;
* Launcher: Not updated.&lt;br /&gt;
* SuperMario64: Both [[NRR]]s were updated, pubkey/signature was updated. No other files were updated.&lt;br /&gt;
* SuperMarioSunshine: Only &amp;quot;/.nrr/Hagi.nrr&amp;quot; was updated, same as above.&lt;br /&gt;
* SuperMarioGalaxy:&lt;br /&gt;
** &amp;quot;/data/texture_replace/&amp;quot;: Various files here were updated.&lt;br /&gt;
** &amp;quot;/&amp;lt;language&amp;gt;/LayoutData/Font.arc&amp;quot;: Updated.&lt;br /&gt;
** &amp;quot;/LayoutData/CameraInfo.arc&amp;quot;, &amp;quot;/LayoutData/IconAButton.arc&amp;quot;, &amp;quot;/StationedData/GDDR3.arc&amp;quot;, &amp;quot;/StationedData/GDDR3.zst&amp;quot;: Updated.&lt;br /&gt;
&lt;br /&gt;
== v1.1.0 ==&lt;br /&gt;
ExeFs:&lt;br /&gt;
* Updated for using SDK 10.8.1.0, except for SuperMarioSunshine/SuperMarioGalaxy.&lt;br /&gt;
* NPDMs for all Programs only had the usual update (see [[#v1.0.1]]).&lt;br /&gt;
** Launcher: All files in ExeFs were updated.&lt;br /&gt;
** SuperMario64: All files in ExeFs were updated, except subsdk*.&lt;br /&gt;
** SuperMarioSunshine/SuperMarioGalaxy: Only main-codebin and the NPDM were updated.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
* Launcher: The following was updated:&lt;br /&gt;
** /Layout/CursorArrow.Nin_NX_NVN.blarc.zs&lt;br /&gt;
** /Layout/DialogKeyButton.Nin_NX_NVN.blarc.zs&lt;br /&gt;
** /Layout/DialogTwoButton.Nin_NX_NVN.blarc.zs&lt;br /&gt;
** /Message/Msg_CNzh.d.sarc.zs&lt;br /&gt;
** /Message/Msg_JPja.d.sarc.zs&lt;br /&gt;
* SuperMario64: The following was updated:&lt;br /&gt;
** /nro/05_UNSMJ3.002.nro&lt;br /&gt;
** /nro/EmuSystemJITPlugin.nro&lt;br /&gt;
*** This appears to be just a rebuild. A func called by _fini/etc was updated, nothing else specific to the plugin was changed in .text. The .nrs build filepath was also changed.&lt;br /&gt;
** /nro/NROBuilder.nro&lt;br /&gt;
** /.nrr/04_UNSMJ3.002.nrr&lt;br /&gt;
** /.nrr/EmuAppNX64.nrr&lt;br /&gt;
** /Pipeline.cache&lt;br /&gt;
** &amp;quot;/rom/Stardust_JP/00_UNSMJ3.002.meta&amp;quot; Newlines now use LF instead of CRLF.&lt;br /&gt;
** &amp;quot;/rom/Stardust_JP/02_UNSMJ3.002.cfg&amp;quot; Newlines now use LF instead of CRLF. The content of the &amp;quot;Comment&amp;quot; entries under &amp;quot;SpecialInst&amp;quot; had the string characters replaced with &#039;*&#039; (for redacting the string). The Lua hook entries were updated under &amp;quot;SpecialInst&amp;quot;. The &amp;quot;Comment&amp;quot; entries under &amp;quot;VertexHack&amp;quot; were redacted the same way, nothing else changed under &amp;quot;VertexHack&amp;quot;.&lt;br /&gt;
** /rom/Stardust_JP/04_UNSMJ3.002.nrr&lt;br /&gt;
** /rom/Stardust_JP/05_UNSMJ3.002.nro&lt;br /&gt;
** &amp;quot;/rom/Stardust_JP/06_UNSMJ3.002.lua&amp;quot; Newlines now use LF instead of CRLF. Comments were redacted, see above. HookFunc_AfterInst was updated for handling the updated hooks mentioned above.&lt;br /&gt;
* SuperMarioSunshine:&lt;br /&gt;
** &amp;quot;/data/database/config/MarioSunshine.config&amp;quot; The config entries for &amp;quot;KeyPadAxisTriggerLeft&amp;quot;/&amp;quot;KeyPadAxisTriggerRight&amp;quot; were updated.&lt;br /&gt;
** &amp;quot;/data/gekko/MarioSunshine/nx/MarioSunshine.nrolz&amp;quot; updated&lt;br /&gt;
** The following files were added under &amp;quot;/data/lazy_texture_replace/MarioSunshine/&amp;quot;:&lt;br /&gt;
*** 5323227429978722713_lod1.png&lt;br /&gt;
*** 5323227429978722713_lod2.png&lt;br /&gt;
*** 5323227429978722713_lod3.png&lt;br /&gt;
*** 5323227429978722713.png&lt;br /&gt;
** &amp;quot;/hagi-override.config&amp;quot; Formatting was adjusted.&lt;br /&gt;
** &amp;quot;/MarioSunshine/Super_Mario_Sunshine_Stardust-trimmed.gcm&amp;quot; updated&lt;br /&gt;
** &amp;quot;/.nrr/Hagi.nrr&amp;quot; updated&lt;br /&gt;
** &amp;quot;/rom.json&amp;quot; The DolHash was updated.&lt;br /&gt;
* SuperMarioGalaxy: The only change was removing the following files from &amp;quot;/StationedData/&amp;quot;:&lt;br /&gt;
** DEBUG.arc&lt;br /&gt;
** DEBUG.zst&lt;br /&gt;
** GDDR3.arc&lt;br /&gt;
** NAPA.zst&lt;br /&gt;
&lt;br /&gt;
The Manual RomFs for each game was also updated.&lt;br /&gt;
&lt;br /&gt;
DeltaFragment NCAs were also added.&lt;br /&gt;
&lt;br /&gt;
== v1.1.1 ==&lt;br /&gt;
ExeFs:&lt;br /&gt;
* NPDMs for all Programs only had the usual update (see [[#v1.0.1]]).&lt;br /&gt;
* The only other change was updating the main-codebin for SuperMario64.&lt;br /&gt;
&lt;br /&gt;
RomFs: ...&lt;br /&gt;
&lt;br /&gt;
= Savedata =&lt;br /&gt;
The savedata contains the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;/PlayReport/account.prsav&amp;quot;&lt;br /&gt;
* &amp;quot;/StardustLauncher/game_data.sav&amp;quot;&lt;br /&gt;
* &amp;quot;/Mario64/Mario64.sav&amp;quot;: The raw N64 savedata.&lt;br /&gt;
* &amp;quot;/MarioSunshine/&amp;quot;: This contains the following data, for MarioSunshine:&lt;br /&gt;
** &amp;quot;gekko/log/&amp;quot;, &amp;quot;gekko/trace/&amp;quot;, and &amp;quot;hanafuda/&amp;quot;: Empty directories.&lt;br /&gt;
** &amp;quot;A.sav&amp;quot;: The memory card image. The first 4-bytes are the big-endian decompressed size, followed by the LZ4 compressed data.&lt;br /&gt;
** &amp;quot;B.raw&amp;quot;: Uncompressed raw version of the memory card image. All-zeros, since it doesn&#039;t seem to be used after creation? This normally doesn&#039;t exist: this only exists if the application had argv parameter &amp;quot;--card-uncompressed&amp;quot; passed.&lt;br /&gt;
** &amp;quot;B1317A6632265CF763766CF6339AC8D1.cache&amp;quot;: This is probably graphics pipeline related?(RomFs has an identical file)&lt;br /&gt;
* &amp;quot;/MarioGalaxy/GameData.bin&amp;quot;: The savedata for SuperMarioGalaxy.&lt;/div&gt;</summary>
		<author><name>Liamwhite</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Super_Mario_3D_All-Stars&amp;diff=11663</id>
		<title>Super Mario 3D All-Stars</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Super_Mario_3D_All-Stars&amp;diff=11663"/>
		<updated>2022-04-15T14:46:41Z</updated>

		<summary type="html">&lt;p&gt;Liamwhite: fix wiki syntax&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Super Mario 3D All-Stars (SM3DAS) game.&lt;br /&gt;
&lt;br /&gt;
The initial menu is the Stardust launcher, which has the base [[NCM_services#ProgramId|ProgramId]] 010049900F546000. Each game launched from here has a different [[Applet_Manager_services#ProgramSpecifyKind|ProgramIndex]], therefore each [[NCM_services#ProgramId|ProgramId]] differs: 0x1 (010049900F546001) SuperMario64, 0x2 (010049900F546002) SuperMarioSunshine, 0x3 (010049900F546003) SuperMarioGalaxy.&lt;br /&gt;
&lt;br /&gt;
The launcher launches each game by using [[Applet_Manager_services#ExecuteProgram|ExecuteProgram]] with ProgramIndex={above values}, with 0x10-byte [[Applet_Manager_services#UnpopToUserChannel|parameter-data]]: {+0x0 = [[Settings_services#LanguageCode|LanguageCode]] selected in the launcher for this game, +0x8/+0xC = floats loaded from a fixed-data array specific for each game, which games can use with [[Audio_services#SetAudioDeviceOutputVolumeAuto|SetAudioDeviceOutputVolume]]}. Each game returns to the launcher by using [[Applet_Manager_services#ExecuteProgram|ExecuteProgram]] with ProgramIndex=0, no [[Applet_Manager_services#UnpopToUserChannel|parameter-data]] is passed to the launcher.&lt;br /&gt;
&lt;br /&gt;
Each game uses different methods of emulation.&lt;br /&gt;
&lt;br /&gt;
These games use Vulkan for rendering.&lt;br /&gt;
&lt;br /&gt;
These games save PlayReports with [[BCAT_services|prepo]], the fields include &amp;quot;num_stars&amp;quot; etc.&lt;br /&gt;
&lt;br /&gt;
The pause-menu when pressing the &#039;-&#039; button in each game uses the Offline web-applet with [[Internet_Browser#WebSession|WebSession]].&lt;br /&gt;
&lt;br /&gt;
= NPDM =&lt;br /&gt;
This section documents the [[NPDM]] for the launcher and each game.&lt;br /&gt;
* Launcher: Roughly the same as most Switch games&#039; NPDM.&lt;br /&gt;
* SuperMario64: Locked down since this uses [[JIT_services|JIT]]. Compared to the Launcher NPDM (besides ProgramId):&lt;br /&gt;
** ProgramIdMin/ProgramIdMax is 010049900F546001-010049900F546001, with other NPDMs it&#039;s the normal full Application-range.&lt;br /&gt;
** Access to [[SVC|svcMapPhysicalMemory]]/[[SVC|svcUnmapPhysicalMemory]] was removed, and access to [[SVC|svcCreateCodeMemory]] was added.&lt;br /&gt;
** The only other difference is service-access-control: this was locked down, and only has the following services: [[Account_services|acc:u0]], [[NS_Services|aoc:u]], [[PPC_services#apm|apm]], [[Applet_Manager_services|appletOE]], [[Audio_services|audren:u]], [[Filesystem_services|fsp-srv]], [[HID_services|hid]], [[JIT_services|jit:u]], [[RO_services|ldr:ro]], [[Log_services|lm]], [[NV_services|nvdrv]], [[Parental_Control_services|pctl]], [[BCAT_services|prepo:u]], [[Settings_services|set]], [[PCV_services|time:u]], [[Display_services|vi:u]].&lt;br /&gt;
** Note that aoc:u, pctl, and lm are only accessible since sdknso automatically initializes these during startup, the main-codebin itself doesn&#039;t use these.&lt;br /&gt;
* SuperMarioSunshine: Same as Launcher (besides ProgramId), except [[NPDM#Flags|flag]] OptimizeMemoryAllocation is set.&lt;br /&gt;
* SuperMarioGalaxy: Same as Launcher (besides ProgramId), except [[NPDM#Flags|flags]] is 0x4: Is64BitInstruction=0(AArch32) and ProcessAddressSpace=0x2.&lt;br /&gt;
&lt;br /&gt;
= SuperMario64 =&lt;br /&gt;
This is a Nintendo 64 emulator. This uses [[JIT_services|JIT]] for running the emulated executable. RomFs also contains an AOT [[NRO]]. A NRO does get loaded, however it&#039;s not used other than that (no symbols from the NRO are resolved).&lt;br /&gt;
&lt;br /&gt;
At the time of release, this was the very first title to use [[JIT_services|JIT]] on retail.&lt;br /&gt;
&lt;br /&gt;
The ROMIMAGE .bin in RomFs is identical to the [https://tcrf.net/Super_Mario_64_(Nintendo_64)/Regional_and_Version_Differences#Shindou_Pak_Taiou_Version Shindou] region N64 ROM. Patches are applied at runtime with the config/lua files.&lt;br /&gt;
&lt;br /&gt;
The LanguageCode is loaded from the launch-parameter passed by the launcher, if not available it will fallback to the output from [[Applet_Manager_services#GetDesiredLanguage|GetDesiredLanguage]]. This is used to select the &amp;lt;language&amp;gt; to load from RomFs &amp;quot;/Message/&amp;quot;, the data from there is then used for patching the ROM. Note that the .lua file runs &amp;lt;code&amp;gt;n64InitMessageData();&amp;lt;/code&amp;gt; from the GameBegin() function.&lt;br /&gt;
&lt;br /&gt;
The ROMIMAGE .bin in RomFs can be replaced with other data (an unofficial image for example) when the config files are adjusted, however note that in some cases a hang may occur during the loading screen.&lt;br /&gt;
&lt;br /&gt;
RomFs contains the following:&lt;br /&gt;
* &amp;quot;/Pipeline.cache&amp;quot;, &amp;quot;/shader_p1_frag.spv&amp;quot;, &amp;quot;/shader_p1_vert.spv&amp;quot;, &amp;quot;/shader_vulkan_frag.spv&amp;quot;, &amp;quot;/shader_vulkan_vert.spv&amp;quot;&lt;br /&gt;
* &amp;quot;/Message/&amp;lt;language&amp;gt;/&amp;quot; contains:&lt;br /&gt;
** &amp;quot;Messages.bin&amp;quot;, &amp;quot;UI_Font8.bin&amp;quot;, &amp;quot;UI_Font16.bin&amp;quot;, &amp;quot;UI_Font16_code2.bin&amp;quot;, &amp;quot;UI_FontS88.bin&amp;quot;.&lt;br /&gt;
* &amp;quot;/.nrr/&amp;quot; contains:&lt;br /&gt;
** &amp;quot;EmuAppNX64.nrr&amp;quot;: The [[NRR]] for the [[JIT_services|JitPlugin]].&lt;br /&gt;
** &amp;quot;04_UNSMJ3.002.nrr&amp;quot;: [[NRR]] for the AOT [[NRO]].&lt;br /&gt;
* &amp;quot;/nro/&amp;quot; contains:&lt;br /&gt;
** &amp;quot;EmuSystemJITPlugin.nro&amp;quot;: The [[NRO]] for the [[JIT_services|JitPlugin]].&lt;br /&gt;
** &amp;quot;NROBuilder.nro&amp;quot;: AOT [[NRO]].&lt;br /&gt;
** &amp;quot;05_UNSMJ3.002.nro&amp;quot;: Same as &amp;quot;NROBuilder.nro&amp;quot;.&lt;br /&gt;
** &amp;quot;/rom/&amp;quot;: This contains the ROM sub-directory, in this case that dir-name is &amp;quot;Stardust_JP&amp;quot; which contains the following:&lt;br /&gt;
*** &amp;quot;Textures/texture_pack.cpio&amp;quot;: Standard (?) .cpio archive containing textures.&lt;br /&gt;
*** &amp;quot;00_UNSMJ3.002.meta&amp;quot;: Contains json metadata for the other files in this directory, etc.&lt;br /&gt;
*** &amp;quot;01_UNSMJ3.002.bin&amp;quot;: This is the ROMIMAGE.&lt;br /&gt;
*** &amp;quot;02_UNSMJ3.002.cfg&amp;quot;: Configuration json file, ROMCONFIG.&lt;br /&gt;
*** &amp;quot;03_UNSMJ3.002.pcb&amp;quot;: This is the &amp;quot;PRECMP&amp;quot; file referenced by the .meta. See [[#EmuSystemJITPlugin]]. Using this can be disabled by changing the &amp;quot;PRECMP&amp;quot; string in the .meta to an invalid string, etc.&lt;br /&gt;
*** &amp;quot;04_UNSMJ3.002.nrr&amp;quot;: Unused [[NRR]] which is the same as &amp;quot;/.nrr/04_UNSMJ3.002.nrr&amp;quot;, except the [[NRR#Certification|Certification]] and ApplicationId are all-zero.&lt;br /&gt;
*** &amp;quot;05_UNSMJ3.002.nro&amp;quot;: Identical to &amp;quot;/nro/05_UNSMJ3.002.nro&amp;quot;.&lt;br /&gt;
*** &amp;quot;06_UNSMJ3.002.lua&amp;quot;: This is the &amp;quot;ROMPATCH&amp;quot; Lua file referenced by the .meta.&lt;br /&gt;
*** &amp;quot;07_UNSMJ3.002.ppl&amp;quot;: This is the &amp;quot;PIPELINE&amp;quot; file referenced by the .meta.&lt;br /&gt;
&lt;br /&gt;
== Emulation Notes ==&lt;br /&gt;
The generated-code runs from the main-thread. The following 4 threads are created:&lt;br /&gt;
* Audio thread.&lt;br /&gt;
* &amp;quot;g_trlRenderTaskThread&amp;quot;. Calls funcptr/object-vfunc from a list of tasks (funcptr/object only used if set), where the tasks are sent by the main-thread. These tasks can be triggered by accessing various IO regs with Write32 (see below), etc.&lt;br /&gt;
* A thread which basically does nothing, just uses a Semaphore and sleeps, while checking state.&lt;br /&gt;
* An unknown thread.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;n64MemDefault{Read/Write}{bitsize}(...)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}: implements memory read/write, all read/written data is byte-swapped. First param is the u32 vaddr. For Write, the second param is the value. For Read, the returned u32 is the read value.&lt;br /&gt;
* &amp;lt;code&amp;gt;n64MemDefaultReadSpecial{bitsize}(...)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}: same as &amp;lt;code&amp;gt;n64MemDefaultRead{bitsize}&amp;lt;/code&amp;gt;, except this runs the additional Special functionality when accessing RAM.&lt;br /&gt;
* &amp;lt;code&amp;gt;n64MemDefault{Read/Write}{bitsize}WithDestLog(...)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}: same as &amp;lt;code&amp;gt;n64MemDefault{Read/Write}{bitsize}&amp;lt;/code&amp;gt;, except this calls an additional logging func when accessing RAM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Read8/Write8 only implements access for RAM and SP_DMEM/SP_IMEM. 0 is returned for Read when the address is unrecognized.&lt;br /&gt;
* Read16/Write16 only implements access for RAM. Read16WithDestLog/Write16WithDestLog will additionally call the logging func if the address is in the IO region (high byte is 0x04). 0 is returned for Read when the address is unrecognized.&lt;br /&gt;
* Read32/Write32 implements RAM access and all supported non-RAM IO/memory access. 0 is returned for Read when the address is unrecognized.&lt;br /&gt;
* Read64/Write64 are implemented the same as *16 above, except this is for 64bit.&lt;br /&gt;
&lt;br /&gt;
== EmuSystemJITPlugin ==&lt;br /&gt;
This section documents the [[JIT_services|JIT]] plugin.&lt;br /&gt;
&lt;br /&gt;
First, [[JIT_services#Control|Control]] is used with a 0xEB0-byte struct for the InBuffer, and cmd in_u64=0. The OutBuffer is unused. This does initialization, and copies the input struct to workmem+0x0.&lt;br /&gt;
&lt;br /&gt;
The u64 for [[JIT_services#GenerateCode|GenerateCode]] is the type: 1-4 are valid. Type1 is used first, then type2. Then type3 is used with data loaded from the &amp;quot;PRECMP&amp;quot; file (the passed array data will be empty if the PRECMP file is not available). Type4 is only used when executing an emu_pc_addr which was not previously compiled, with a matching emu_pc_addr.&lt;br /&gt;
&lt;br /&gt;
The u32 for the input Struct32 size is ignored by the plugin.&lt;br /&gt;
&lt;br /&gt;
* Type1: Struct32 and InBuffer are unused. Generates the entry code which can be called for running the rest of the code in the CodeMemory. After the generated code finishes setup, it jumps to x0.&lt;br /&gt;
* Type2: Struct32 and InBuffer are unused. Generates the code for returning from CodeMemory, which is used by the rest of the generated code.&lt;br /&gt;
* Type3: The emulator passes the 0x8-bytes from InBuffer+0 as the input Struct32, however the plugin doesn&#039;t use the Struct32. The emulator passes InBuffer_size=0x8C00048 and OutBuffer_size=0x2900008. This generates code for the MIPS code specified in the InBuffer. The InBuffer contains array data etc. The InBuffer can contain multiple blocks of code, which are generally individual MIPS functions. The MIPS instructions are big-endian.&lt;br /&gt;
* Type4: 0x20-bytes are passed for the input Struct32: u32 +0 = emu_pc_addr, u32 +4 = set by emulator but unused by the plugin, u32 +0x18 = instruction_count (which determines the InBuffer size), the rest is unused / overwritten by the plugin. This generates code for the MIPS code specified in the InBuffer. InBuffer+0 is the u32s for the big-endian MIPS instructions. The OutBuffer is 0x2000C-bytes:&lt;br /&gt;
** +0x0 is an array of u32s with the count from u32 +0x20004. Each entry is the generated-code offset for each compiled MIPS instruction, relative to the CodeRange offset.&lt;br /&gt;
** +0x10000 is an array of u32s with the count from u32 +0x20004. Each entry is flags for each compiled MIPS instruction.&lt;br /&gt;
** The 3 u32s at +0x20000 are the same as OutBuffer+0x0 with type1/type2 (except the last two fields can be non-zero). +0x20004 is the total compiled MIPS instructions. +0x20008 is emu_pc_addr for the first compiled instruction.&lt;br /&gt;
&lt;br /&gt;
0xC-bytes are copied to the OutBuffer with type1/type2, these come from workmem. These 3 u32s are left at all-zero, except for +0 which is the generated_code_size (which is then copied to the output CodeRange size).&lt;br /&gt;
&lt;br /&gt;
The 0xEB0-byte controldata struct has the following structure (all addrs/data are from the emulator user-process):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || Data addr: g_pGPR&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8 || Data addr: g_pFPR&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8 || Data addr: g_pCP0&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x8 || Data addr: g_nRegHi&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x8 || Data addr: g_nRegLo&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x8 || Data addr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x8 || Data addr: g_nFCSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x8 || Data addr: g_bN64CpuCmpEndCheck&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || 0x8 || Data addr: g_nN64CpuPC&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x8 || Data addr: g_nN64CpuJmpPC. s32, normally -1. When not -1 this is a value which can be copied into g_nN64CpuJmpPC by the generated code, with g_nN64CpuJmpPC being reset to -1 afterwards regardless of the original value.&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || 0x8 || Data addr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x58 || 0x8 || Data addr: g_nN64CpuHaveExp&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || 0x658 || Array of funcptrs. Called with w0=instruction_value from generated code for handling instructions&#039; implementation, when the plugin itself doesn&#039;t handle it.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B8 || 0x8 || Funcptr: &amp;lt;code&amp;gt;n64CPUProcInstCOP1Check()&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C0 || 0x8 || Funcptr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C8 || 0x8 || Funcptr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D0 || 0x8 || Funcptr: &amp;lt;code&amp;gt;n64CPUSetRegisterCP0(int, unsigned int)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D8 || 0x8 || Funcptr: &amp;lt;code&amp;gt;n64CPUGetRegisterCP0(int)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x6E0 || 0x20 || Funcptrs for reading data: &amp;lt;code&amp;gt;n64MemDefaultRead{bitsize}(unsigned int)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64} (32 uses &amp;lt;code&amp;gt;n64MemDefaultRead32WithDestLog&amp;lt;/code&amp;gt;). Unused by the plugin.&lt;br /&gt;
|-&lt;br /&gt;
| 0x700 || 0x20 || Funcptrs for reading Special data: &amp;lt;code&amp;gt;n64MemDefaultReadSpecial{bitsize}(unsigned int)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}.&lt;br /&gt;
|-&lt;br /&gt;
| 0x720 || 0x20 || Funcptrs for writing data: &amp;lt;code&amp;gt;n64MemDefaultWrite{bitsize}(unsigned int, ...)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64} (32 uses &amp;lt;code&amp;gt;n64MemDefaultWrite32WithDestLog&amp;lt;/code&amp;gt;). Unused by the plugin.&lt;br /&gt;
|-&lt;br /&gt;
| 0x740 || 0x20 || Funcptrs for reading data via the WithDestLog version: &amp;lt;code&amp;gt;n64MemDefaultRead{bitsize}WithDestLog(unsigned int)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}.&lt;br /&gt;
|-&lt;br /&gt;
| 0x760 || 0x20 || Funcptrs for writing data via the WithDestLog version: &amp;lt;code&amp;gt;n64MemDefaultWrite{bitsize}WithDestLog(unsigned int, ...)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}.&lt;br /&gt;
|-&lt;br /&gt;
| 0x780 || 0x8 || Funcptr: &amp;lt;code&amp;gt;n64CPU_CallLuaAfterInst(unsigned int, unsigned int)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x788 || 0x8 || Funcptr: &amp;lt;code&amp;gt;n64CPU_CallLuaBeforeInst(unsigned int, unsigned int)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x790 || 0x8 || Funcptr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x798 || 0x4 || Array count for the the following array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x79C || 0x180 (0x20*0xC) || Array data with the above count, each entry is 0xC-bytes. The emulator loads this from config array &amp;quot;Idle&amp;quot;. +0 = u32 emu_pc_addr (config &amp;quot;JmpAddr&amp;quot;), +4 = u32 instruction_value (config &amp;quot;JmpInst&amp;quot;), +8 = u32 is_idle (config &amp;quot;IsIdle&amp;quot;, 0x1 = enabled).&lt;br /&gt;
|-&lt;br /&gt;
| 0x91C || 0x4 || Array count for the the following array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x920 || 0x500 (0x40*0x14) || Array data with the above count, each entry is 0x14-bytes. The emulator loads this from config array &amp;quot;SpecialInst&amp;quot;. +0 = u32 emu_pc_addr (config &amp;quot;Addr&amp;quot;), +4 = u32 instruction_value (config &amp;quot;Inst&amp;quot;), +8 = u32 flags. The emulator sets the flags to 0 by default, then compares config &amp;quot;Type&amp;quot; with various strings to determine the value. Flags: bit0 = Type &amp;quot;BreakLoop&amp;quot;, bit5 = Type &amp;quot;LoadFrameBuffer&amp;quot;, bit6 = Type &amp;quot;Lua_BeforeInst&amp;quot;, bit7 = Type &amp;quot;Lua_AfterInst&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When the config for {any of the previously mentioned Type strings} is set to value 1, the emulator will also enable the corresponding flags bit mentioned above. Likewise with config &amp;quot;Return&amp;quot;, which sets flags bit8.&lt;br /&gt;
&lt;br /&gt;
When the plugin loads a funcptr from +0x740, it will load a funcptr from +0x700 instead if there&#039;s a matching entry here which has bit5 set.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE20 || 0x4 || Array count for the the following array. The plugin doesn&#039;t use this.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE24 || 0x80 (0x10*0x8) || Array data with the above count, each entry is 0x8-bytes. The emulator loads this from config array &amp;quot;FrameBuffer&amp;quot;. +0 = u32 (config &amp;quot;Addr&amp;quot;), +4 = u32 (config &amp;quot;Length&amp;quot;). The plugin doesn&#039;t use this.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEA4 || 0x4 || Set to 0 by default, then if available the emulator sets bit flags here depending on the content of the config for &amp;lt;code&amp;gt;&amp;quot;Cmp&amp;quot;, &amp;quot;g_nN64CpuCmpTLBCheckLevel&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEA8 || 0x4 || Set to 0 by default by the emulator. With config &amp;lt;code&amp;gt;&amp;quot;Cmp&amp;quot;, &amp;quot;CodeMultiAddr&amp;quot;&amp;lt;/code&amp;gt; this is set to 1, and with config &amp;lt;code&amp;gt;&amp;quot;Cmp&amp;quot;, &amp;quot;BlockDynamicPC&amp;quot;&amp;lt;/code&amp;gt; this is set to 2. The plugin only checks whether this ==2 or !=2, so values 0-1 are basically the same.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEAC || 0x4 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= SuperMarioSunshine =&lt;br /&gt;
This is a Nintendo Gamecube emulator. The emulator (which is the main-codebin) name is &amp;quot;Hagi&amp;quot;. This uses an AOT [[NRO]] for running the emulated executable.&lt;br /&gt;
&lt;br /&gt;
Since this uses AOT, attempting to run a different .dol with this emulator is equivalent to attempting to run an emulator with an executable where .text (code) is the from the original executable, while everything else is from the other executable.&lt;br /&gt;
&lt;br /&gt;
This emulator supports arguments with argc/argv, when launched officially zero [[Loader_services#SetProgramArgument|arguments]] are passed for this (unless [[Loader_services#SetProgramArgument|SetProgramArgument]] is used manually prior to launching). The emulator will also load arguments from RomFs &amp;quot;/default_cmd.txt&amp;quot; when argc==1, otherwise it loads arguments from a filepath loaded elsewhere. Hence, when not launched with arguments with an official launch, &amp;quot;/default_cmd.txt&amp;quot; is not used. Some of the supported arguments are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument !! Description&lt;br /&gt;
|-&lt;br /&gt;
| --volume=&amp;amp;lt;0..100&amp;amp;gt; || Set sound volume (default: 100).&lt;br /&gt;
|-&lt;br /&gt;
| --disable-file-cache || Disable file cache if supported by the platform.&lt;br /&gt;
|-&lt;br /&gt;
| --no-dol-hash || Do not calculate DOL hash (unsafe)&lt;br /&gt;
|-&lt;br /&gt;
| --screenshot-period=&amp;amp;lt;value&amp;amp;gt;, -sp || Takes screenshots every n frame&lt;br /&gt;
|-&lt;br /&gt;
| --screenshot-write-queue-thread-count=&amp;amp;lt;0..n&amp;amp;gt; || Change the number of threads allocated to the screenshot write queue, 0 to disable (default: 1).&lt;br /&gt;
|-&lt;br /&gt;
| --delete-after-load || Delete save state after a successful load.&lt;br /&gt;
|-&lt;br /&gt;
| --listen-port=&amp;amp;lt;port&amp;amp;gt; || Specify the service port to listen to (default: 1234).&lt;br /&gt;
|-&lt;br /&gt;
| --card-uncompressed || Do not compress card.&lt;br /&gt;
|-&lt;br /&gt;
| --sync-guest-none || Don&#039;t synchronize emulation, run as fast as possible.&lt;br /&gt;
|-&lt;br /&gt;
| --gecko-patch=&amp;amp;lt;name&amp;amp;gt; || Apply Gecko patch &amp;amp;lt;name&amp;amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| --log=&amp;amp;lt;file&amp;amp;gt; || Log to file instead of stdout. Defaults to stdout&lt;br /&gt;
|-&lt;br /&gt;
| --rootdir=&amp;amp;lt;path&amp;amp;gt;, -r&amp;amp;lt;path&amp;amp;gt; || Set the root directory&lt;br /&gt;
|-&lt;br /&gt;
| --no-patch || Do not apply standard patch&lt;br /&gt;
|-&lt;br /&gt;
| --stop-failed-test[=&amp;amp;lt;number&amp;amp;gt;] || Stop subtests after &amp;amp;lt;number&amp;amp;gt; differences (default 10).&lt;br /&gt;
|-&lt;br /&gt;
| --exit=&amp;amp;lt;value&amp;amp;gt;, -e || Exit after n frames&lt;br /&gt;
|-&lt;br /&gt;
| --help, -h || Print usage and exit.&lt;br /&gt;
|-&lt;br /&gt;
| --mute || Start ROM with mute sound.&lt;br /&gt;
|-&lt;br /&gt;
| --sync-guest-with-wall || Synchronize emulation with wall time.&lt;br /&gt;
|-&lt;br /&gt;
| --sync-guest-with-host || Synchronize emulation with host.&lt;br /&gt;
|-&lt;br /&gt;
| --test=&amp;amp;lt;filename&amp;amp;gt;, -t || Starts emulator in unit test mode.&lt;br /&gt;
|-&lt;br /&gt;
| --no-pip || Don&#039;t use pipeline database.&lt;br /&gt;
|-&lt;br /&gt;
| --play-input || Play previously recorded input&lt;br /&gt;
|-&lt;br /&gt;
| --command=&amp;amp;lt;file&amp;amp;gt; || Use file as the contents of the command line (one arg per line).&lt;br /&gt;
|-&lt;br /&gt;
| --dim-screen-after=&amp;amp;lt;s&amp;amp;gt; || Dim screen after &amp;amp;lt;s&amp;amp;gt; seconds of inactivity.&lt;br /&gt;
|-&lt;br /&gt;
| --random-inputs-period=&amp;amp;lt;0..n&amp;amp;gt; || Change the random inputs period in number of frames (default: 10).&lt;br /&gt;
|-&lt;br /&gt;
| --config=&amp;amp;lt;filename&amp;amp;gt;, -cfg || Gives path to the config file&lt;br /&gt;
|-&lt;br /&gt;
| --ask, -a || Ask for a rom and execute it.&lt;br /&gt;
|-&lt;br /&gt;
| --load-state-slot=&amp;amp;lt;index&amp;amp;gt;, -lss&amp;amp;lt;index&amp;amp;gt; || Load save state by index.&lt;br /&gt;
|-&lt;br /&gt;
| --load-state-file=&amp;amp;lt;filename&amp;amp;gt;, -lsf&amp;amp;lt;filename&amp;amp;gt; || Load save state by filename.&lt;br /&gt;
|-&lt;br /&gt;
| --generatetest=&amp;amp;lt;directory&amp;amp;gt;, -gt || Starts emulator in unit test mode and generate output files inside the given directory.&lt;br /&gt;
|-&lt;br /&gt;
| --waitcontroller, -wc || Stop CPU until controller 0 has been detected&lt;br /&gt;
|-&lt;br /&gt;
| --card-format=&amp;amp;lt;size_in_Mbits&amp;amp;gt; || Format card using given size in MBits (default 4, possible 8, 16, 32, 64, 128).&lt;br /&gt;
|-&lt;br /&gt;
| --card-force-copy || Force card copy from read-only support to read-write support (on supported platforms).&lt;br /&gt;
|-&lt;br /&gt;
| --screenshot-output-format=[png|ppm] || Change the format of the screenshots when using the generic screenshot capture code (default: png).&lt;br /&gt;
|-&lt;br /&gt;
| --config-override || Use a specific config override filename.&lt;br /&gt;
|-&lt;br /&gt;
| --random-inputs || Use random inputs instead of values from physical controllers.&lt;br /&gt;
|-&lt;br /&gt;
| --log-unit-test || Enable log in unit test mode.&lt;br /&gt;
|-&lt;br /&gt;
| --break-on-start, -bos || Break at the start of the rom.&lt;br /&gt;
|-&lt;br /&gt;
| --record-input || Record input&lt;br /&gt;
|-&lt;br /&gt;
| --screenshot-write-queue-capacity=&amp;amp;lt;1..n&amp;amp;gt; || Change the capacity of the screenshot queue (default: thread-count * 2 + 1).&lt;br /&gt;
|-&lt;br /&gt;
| --random-inputs-seed=&amp;amp;lt;0..n&amp;amp;gt; || Change the random inputs seed value (default: 0).&lt;br /&gt;
|-&lt;br /&gt;
| --listen-address=&amp;amp;lt;address&amp;amp;gt; || Specify the service address to listen to (default: 0.0.0.0).&lt;br /&gt;
|-&lt;br /&gt;
| --gui, -gui || Use the GUI mode&lt;br /&gt;
|-&lt;br /&gt;
| --break-on-start-dsp, -bosd || Break at the start of the dsp program.&lt;br /&gt;
|-&lt;br /&gt;
| --no-db-config || Do not use the ROM DB config override.&lt;br /&gt;
|-&lt;br /&gt;
| --features || Print features and exit.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This emulator uses various hashes, SHA-1 is used for this.&lt;br /&gt;
&lt;br /&gt;
This supports loading Bios from a file where the path is determined using the specified LanguageCode, when config flags &amp;quot;Emulate&amp;quot; and &amp;quot;LoadBios&amp;quot; are true, however with the MarioSunshine config the latter config flag is false.&lt;br /&gt;
&lt;br /&gt;
RomFs contains the following: &lt;br /&gt;
* &amp;quot;/hagi.config&amp;quot;: Emulator json configuration.&lt;br /&gt;
* &amp;quot;/hagi-override.config&amp;quot;: Emulator json configuration.&lt;br /&gt;
* &amp;quot;/rom.json&amp;quot;: ROM json configuration, contains the following fields:&lt;br /&gt;
** &amp;quot;UID&amp;quot;: Game-name.&lt;br /&gt;
** &amp;quot;DolHash&amp;quot;: Hash.&lt;br /&gt;
** &amp;quot;ROM&amp;quot;: An array of strings for the absolute file path for the ROM. In this case, it only contains the following: &amp;quot;rom:/MarioSunshine/Super_Mario_Sunshine_Stardust-trimmed.gcm&amp;quot;.&lt;br /&gt;
* &amp;quot;/.nrr/Hagi.nrr&amp;quot;: [[NRR]] for the AOT [[NRO]].&lt;br /&gt;
* &amp;quot;/MarioSunshine/&amp;quot;: This contains the following:&lt;br /&gt;
** &amp;quot;Super_Mario_Sunshine_Stardust-trimmed.gcm&amp;quot;: This is the .gcm image mentioned above.&lt;br /&gt;
** &amp;quot;Super_Mario_Sunshine_Stardust-trimmed.hash&amp;quot;: Contains json configuration for various hashes.&lt;br /&gt;
* &amp;quot;/data/&amp;quot;: This contains the following:&lt;br /&gt;
** &amp;quot;database/&amp;quot;: This contains the following:&lt;br /&gt;
*** &amp;quot;config/MarioSunshine.config&amp;quot;: This contains game-specific emulator json configuration.&lt;br /&gt;
*** &amp;quot;hagi/MarioSunshine.json&amp;quot;: This contains ROM json configuration. IDs, names, etc. This also contains various hashes, including a duplicate of the above .hash file.&lt;br /&gt;
*** &amp;quot;pip/MarioSunshine/pipelineDB.pip&amp;quot;&lt;br /&gt;
*** &amp;quot;vulkan/MarioSunshine/B1317A6632265CF763766CF6339AC8D1.cache&amp;quot;: This is the .cache file mentioned in [[#Savedata]].&lt;br /&gt;
** &amp;quot;gekko/MarioSunshine/nx/MarioSunshine.nrolz&amp;quot;: This is the AOT [[NRO]]. LZ4 compressed, first 4-bytes is the big-endian decompressed size, then the compressed data follows.&lt;br /&gt;
** &amp;quot;lazy_texture_replace/MarioSunshine&amp;quot;: Contains PNG textures.&lt;br /&gt;
** &amp;quot;saves/MarioSunshine/A.sav&amp;quot;: Savedata. Presumably used to create the initial savedata file?&lt;br /&gt;
** &amp;quot;texture_replace/&amp;quot;: Contains &amp;quot;MarioSunshine.har&amp;quot; and &amp;quot;MarioSunshine.hix&amp;quot;.&lt;br /&gt;
** &amp;quot;video_replace/MarioSunshine/&amp;quot;: Contains MP4 videos.&lt;br /&gt;
&lt;br /&gt;
== AOT NRO ==&lt;br /&gt;
This section documents the AOT NRO. There are only two symbols from NRO which the main-codebin does lookup for and uses: &amp;quot;SetGekkoMemoryPointer&amp;quot; and &amp;quot;GetStatifierInfo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
During initialization, &amp;lt;code&amp;gt;nn::os::AllocateAddressRegion&amp;lt;/code&amp;gt; is used with size 0x100200000. Then &amp;lt;code&amp;gt;nn::os::AllocateMemoryPages&amp;lt;/code&amp;gt; is used (which uses [[SVC#MapPhysicalMemory|svcMapPhysicalMemory]]):&lt;br /&gt;
* base+0 size 0x1000 is allocated.&lt;br /&gt;
* base+0x80000000 size 0x1800000 is allocated.&lt;br /&gt;
* base+0xE0000000 size 0x4000 is allocated.&lt;br /&gt;
* base+0xFFF00000 size 0x200000 is allocated.&lt;br /&gt;
&lt;br /&gt;
Initially SetGekkoMemoryPointer is called with base+0x80000000, however at some point it&#039;s called (?) with base+0.&lt;br /&gt;
&lt;br /&gt;
The AOT NRO does all main-memory accesses by accessing {global ptr set by SetGekkoMemoryPointer}+{ppc_addr}. Therefore, above base+0 == ppc_addr 0x0. Since svcMapPhysicalMemory is used above, attempting to access any PPC-addrs not in the allocated regions above will result in the emulator crashing due to accessing unmapped memory - accessing non-PPC emulator data with invalid PPC-addrs is not possible. These crashes may happen when attempting to run a different .dol with the emulator as previously mentioned.&lt;br /&gt;
&lt;br /&gt;
GetStatifierInfo takes an input string param and an output u64* param. This returns a bool: 0 = error, 1 = success. The NRO compares the input string with various strings to determine an array index, returning 0 if there&#039;s no match. Otherwise, the u64 data from the located array entry is copied to the output u64.&lt;br /&gt;
* &amp;quot;GET_FUNCTION_INFO&amp;quot;: Ptr to a table, where each entry is 0x18-bytes. Structure: +0x0 = ppc_code_addr, +0x8 = nro_code_addr, +0x10 = string ptr (normally &amp;quot;&amp;quot;).&lt;br /&gt;
* &amp;quot;GET_FUNCTION_INFO_SIZE&amp;quot; Ptr to the size of the FUNCTION_INFO table, in entries.&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
Each func in the NRO listed in the above table (which are the AOT funcs) is called with x0={state ptr}, where state contains:&lt;br /&gt;
* +0x0: u32 array for the PPC GPRs.&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
= SuperMarioGalaxy =&lt;br /&gt;
This appears to use an emulator similar to the one used by [[#SuperMarioSunshine]]. The code/data for the MarioGalaxy executable is included directly in the main-codebin.&lt;br /&gt;
&lt;br /&gt;
RomFs contains the following: &lt;br /&gt;
* &amp;quot;/hagi.config&amp;quot;: This is mostly the same as the &amp;quot;/hagi.config&amp;quot; for [[#SuperMarioSunshine]], except with various config fields adjusted.&lt;br /&gt;
* &amp;quot;/data/&amp;quot;: This contains the following:&lt;br /&gt;
** &amp;quot;database/&amp;quot;: This contains &amp;quot;pip/pipelineDB.pip&amp;quot; and &amp;quot;vulkan/FDBD9F0C3FEA5778E10FFFA74093E0B8.cache&amp;quot;.&lt;br /&gt;
** &amp;quot;dsp/&amp;quot;: This contains &amp;quot;drom.bin&amp;quot; and &amp;quot;irom.bin&amp;quot;.&lt;br /&gt;
** &amp;quot;ondemand_texture_replace/MarioGalaxy/&amp;quot;: This contains PNG textures.&lt;br /&gt;
** &amp;quot;texture_replace/&amp;quot;: This contains &amp;quot;MarioGalaxy.har&amp;quot;, &amp;quot;MarioGalaxy.hix&amp;quot;, &amp;quot;MarioGalaxy_&amp;lt;language&amp;gt;.har&amp;quot;, &amp;quot;MarioGalaxy_&amp;lt;language&amp;gt;.hix&amp;quot;, &amp;quot;MarioGalaxy_Sub.har&amp;quot;, &amp;quot;MarioGalaxy_Sub.hix&amp;quot;.&lt;br /&gt;
** &amp;quot;video_replace/MarioGalaxy/MovieData/&amp;quot;: This contains MP4 videos.&lt;br /&gt;
* The rest is the MarioGalaxy game assets stored directly in RomFs.&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the game-update changes.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
In ExeFs, the only [[NPDM]] change was the usual ACID pubkey/signature update. The only other ExeFs change, was that the main-codebin was updated only for SuperMarioSunshine/SuperMarioGalaxy.&lt;br /&gt;
&lt;br /&gt;
RomFs changes:&lt;br /&gt;
* Launcher: Not updated.&lt;br /&gt;
* SuperMario64: Both [[NRR]]s were updated, pubkey/signature was updated. No other files were updated.&lt;br /&gt;
* SuperMarioSunshine: Only &amp;quot;/.nrr/Hagi.nrr&amp;quot; was updated, same as above.&lt;br /&gt;
* SuperMarioGalaxy:&lt;br /&gt;
** &amp;quot;/data/texture_replace/&amp;quot;: Various files here were updated.&lt;br /&gt;
** &amp;quot;/&amp;lt;language&amp;gt;/LayoutData/Font.arc&amp;quot;: Updated.&lt;br /&gt;
** &amp;quot;/LayoutData/CameraInfo.arc&amp;quot;, &amp;quot;/LayoutData/IconAButton.arc&amp;quot;, &amp;quot;/StationedData/GDDR3.arc&amp;quot;, &amp;quot;/StationedData/GDDR3.zst&amp;quot;: Updated.&lt;br /&gt;
&lt;br /&gt;
== v1.1.0 ==&lt;br /&gt;
ExeFs:&lt;br /&gt;
* Updated for using SDK 10.8.1.0, except for SuperMarioSunshine/SuperMarioGalaxy.&lt;br /&gt;
* NPDMs for all Programs only had the usual update (see [[#v1.0.1]]).&lt;br /&gt;
** Launcher: All files in ExeFs were updated.&lt;br /&gt;
** SuperMario64: All files in ExeFs were updated, except subsdk*.&lt;br /&gt;
** SuperMarioSunshine/SuperMarioGalaxy: Only main-codebin and the NPDM were updated.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
* Launcher: The following was updated:&lt;br /&gt;
** /Layout/CursorArrow.Nin_NX_NVN.blarc.zs&lt;br /&gt;
** /Layout/DialogKeyButton.Nin_NX_NVN.blarc.zs&lt;br /&gt;
** /Layout/DialogTwoButton.Nin_NX_NVN.blarc.zs&lt;br /&gt;
** /Message/Msg_CNzh.d.sarc.zs&lt;br /&gt;
** /Message/Msg_JPja.d.sarc.zs&lt;br /&gt;
* SuperMario64: The following was updated:&lt;br /&gt;
** /nro/05_UNSMJ3.002.nro&lt;br /&gt;
** /nro/EmuSystemJITPlugin.nro&lt;br /&gt;
*** This appears to be just a rebuild. A func called by _fini/etc was updated, nothing else specific to the plugin was changed in .text. The .nrs build filepath was also changed.&lt;br /&gt;
** /nro/NROBuilder.nro&lt;br /&gt;
** /.nrr/04_UNSMJ3.002.nrr&lt;br /&gt;
** /.nrr/EmuAppNX64.nrr&lt;br /&gt;
** /Pipeline.cache&lt;br /&gt;
** &amp;quot;/rom/Stardust_JP/00_UNSMJ3.002.meta&amp;quot; Newlines now use LF instead of CRLF.&lt;br /&gt;
** &amp;quot;/rom/Stardust_JP/02_UNSMJ3.002.cfg&amp;quot; Newlines now use LF instead of CRLF. The content of the &amp;quot;Comment&amp;quot; entries under &amp;quot;SpecialInst&amp;quot; had the string characters replaced with &#039;*&#039; (for redacting the string). The Lua hook entries were updated under &amp;quot;SpecialInst&amp;quot;. The &amp;quot;Comment&amp;quot; entries under &amp;quot;VertexHack&amp;quot; were redacted the same way, nothing else changed under &amp;quot;VertexHack&amp;quot;.&lt;br /&gt;
** /rom/Stardust_JP/04_UNSMJ3.002.nrr&lt;br /&gt;
** /rom/Stardust_JP/05_UNSMJ3.002.nro&lt;br /&gt;
** &amp;quot;/rom/Stardust_JP/06_UNSMJ3.002.lua&amp;quot; Newlines now use LF instead of CRLF. Comments were redacted, see above. HookFunc_AfterInst was updated for handling the updated hooks mentioned above.&lt;br /&gt;
* SuperMarioSunshine:&lt;br /&gt;
** &amp;quot;/data/database/config/MarioSunshine.config&amp;quot; The config entries for &amp;quot;KeyPadAxisTriggerLeft&amp;quot;/&amp;quot;KeyPadAxisTriggerRight&amp;quot; were updated.&lt;br /&gt;
** &amp;quot;/data/gekko/MarioSunshine/nx/MarioSunshine.nrolz&amp;quot; updated&lt;br /&gt;
** The following files were added under &amp;quot;/data/lazy_texture_replace/MarioSunshine/&amp;quot;:&lt;br /&gt;
*** 5323227429978722713_lod1.png&lt;br /&gt;
*** 5323227429978722713_lod2.png&lt;br /&gt;
*** 5323227429978722713_lod3.png&lt;br /&gt;
*** 5323227429978722713.png&lt;br /&gt;
** &amp;quot;/hagi-override.config&amp;quot; Formatting was adjusted.&lt;br /&gt;
** &amp;quot;/MarioSunshine/Super_Mario_Sunshine_Stardust-trimmed.gcm&amp;quot; updated&lt;br /&gt;
** &amp;quot;/.nrr/Hagi.nrr&amp;quot; updated&lt;br /&gt;
** &amp;quot;/rom.json&amp;quot; The DolHash was updated.&lt;br /&gt;
* SuperMarioGalaxy: The only change was removing the following files from &amp;quot;/StationedData/&amp;quot;:&lt;br /&gt;
** DEBUG.arc&lt;br /&gt;
** DEBUG.zst&lt;br /&gt;
** GDDR3.arc&lt;br /&gt;
** NAPA.zst&lt;br /&gt;
&lt;br /&gt;
The Manual RomFs for each game was also updated.&lt;br /&gt;
&lt;br /&gt;
DeltaFragment NCAs were also added.&lt;br /&gt;
&lt;br /&gt;
== v1.1.1 ==&lt;br /&gt;
ExeFs:&lt;br /&gt;
* NPDMs for all Programs only had the usual update (see [[#v1.0.1]]).&lt;br /&gt;
* The only other change was updating the main-codebin for SuperMario64.&lt;br /&gt;
&lt;br /&gt;
RomFs: ...&lt;br /&gt;
&lt;br /&gt;
= Savedata =&lt;br /&gt;
The savedata contains the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;/PlayReport/account.prsav&amp;quot;&lt;br /&gt;
* &amp;quot;/StardustLauncher/game_data.sav&amp;quot;&lt;br /&gt;
* &amp;quot;/Mario64/Mario64.sav&amp;quot;: The raw N64 savedata.&lt;br /&gt;
* &amp;quot;/MarioSunshine/&amp;quot;: This contains the following data, for MarioSunshine:&lt;br /&gt;
** &amp;quot;gekko/log/&amp;quot;, &amp;quot;gekko/trace/&amp;quot;, and &amp;quot;hanafuda/&amp;quot;: Empty directories.&lt;br /&gt;
** &amp;quot;A.sav&amp;quot;: The memory card image. The first 4-bytes are the big-endian decompressed size, followed by the LZ4 compressed data.&lt;br /&gt;
** &amp;quot;B.raw&amp;quot;: Uncompressed raw version of the memory card image. All-zeros, since it doesn&#039;t seem to be used after creation? This normally doesn&#039;t exist: this only exists if the application had argv parameter &amp;quot;--card-uncompressed&amp;quot; passed.&lt;br /&gt;
** &amp;quot;B1317A6632265CF763766CF6339AC8D1.cache&amp;quot;: This is probably graphics pipeline related?(RomFs has an identical file)&lt;br /&gt;
* &amp;quot;/MarioGalaxy/GameData.bin&amp;quot;: The savedata for SuperMarioGalaxy.&lt;/div&gt;</summary>
		<author><name>Liamwhite</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Super_Mario_3D_All-Stars&amp;diff=11662</id>
		<title>Super Mario 3D All-Stars</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Super_Mario_3D_All-Stars&amp;diff=11662"/>
		<updated>2022-04-15T14:35:44Z</updated>

		<summary type="html">&lt;p&gt;Liamwhite: Add argument table for Sunshine Hagi&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Super Mario 3D All-Stars (SM3DAS) game.&lt;br /&gt;
&lt;br /&gt;
The initial menu is the Stardust launcher, which has the base [[NCM_services#ProgramId|ProgramId]] 010049900F546000. Each game launched from here has a different [[Applet_Manager_services#ProgramSpecifyKind|ProgramIndex]], therefore each [[NCM_services#ProgramId|ProgramId]] differs: 0x1 (010049900F546001) SuperMario64, 0x2 (010049900F546002) SuperMarioSunshine, 0x3 (010049900F546003) SuperMarioGalaxy.&lt;br /&gt;
&lt;br /&gt;
The launcher launches each game by using [[Applet_Manager_services#ExecuteProgram|ExecuteProgram]] with ProgramIndex={above values}, with 0x10-byte [[Applet_Manager_services#UnpopToUserChannel|parameter-data]]: {+0x0 = [[Settings_services#LanguageCode|LanguageCode]] selected in the launcher for this game, +0x8/+0xC = floats loaded from a fixed-data array specific for each game, which games can use with [[Audio_services#SetAudioDeviceOutputVolumeAuto|SetAudioDeviceOutputVolume]]}. Each game returns to the launcher by using [[Applet_Manager_services#ExecuteProgram|ExecuteProgram]] with ProgramIndex=0, no [[Applet_Manager_services#UnpopToUserChannel|parameter-data]] is passed to the launcher.&lt;br /&gt;
&lt;br /&gt;
Each game uses different methods of emulation.&lt;br /&gt;
&lt;br /&gt;
These games use Vulkan for rendering.&lt;br /&gt;
&lt;br /&gt;
These games save PlayReports with [[BCAT_services|prepo]], the fields include &amp;quot;num_stars&amp;quot; etc.&lt;br /&gt;
&lt;br /&gt;
The pause-menu when pressing the &#039;-&#039; button in each game uses the Offline web-applet with [[Internet_Browser#WebSession|WebSession]].&lt;br /&gt;
&lt;br /&gt;
= NPDM =&lt;br /&gt;
This section documents the [[NPDM]] for the launcher and each game.&lt;br /&gt;
* Launcher: Roughly the same as most Switch games&#039; NPDM.&lt;br /&gt;
* SuperMario64: Locked down since this uses [[JIT_services|JIT]]. Compared to the Launcher NPDM (besides ProgramId):&lt;br /&gt;
** ProgramIdMin/ProgramIdMax is 010049900F546001-010049900F546001, with other NPDMs it&#039;s the normal full Application-range.&lt;br /&gt;
** Access to [[SVC|svcMapPhysicalMemory]]/[[SVC|svcUnmapPhysicalMemory]] was removed, and access to [[SVC|svcCreateCodeMemory]] was added.&lt;br /&gt;
** The only other difference is service-access-control: this was locked down, and only has the following services: [[Account_services|acc:u0]], [[NS_Services|aoc:u]], [[PPC_services#apm|apm]], [[Applet_Manager_services|appletOE]], [[Audio_services|audren:u]], [[Filesystem_services|fsp-srv]], [[HID_services|hid]], [[JIT_services|jit:u]], [[RO_services|ldr:ro]], [[Log_services|lm]], [[NV_services|nvdrv]], [[Parental_Control_services|pctl]], [[BCAT_services|prepo:u]], [[Settings_services|set]], [[PCV_services|time:u]], [[Display_services|vi:u]].&lt;br /&gt;
** Note that aoc:u, pctl, and lm are only accessible since sdknso automatically initializes these during startup, the main-codebin itself doesn&#039;t use these.&lt;br /&gt;
* SuperMarioSunshine: Same as Launcher (besides ProgramId), except [[NPDM#Flags|flag]] OptimizeMemoryAllocation is set.&lt;br /&gt;
* SuperMarioGalaxy: Same as Launcher (besides ProgramId), except [[NPDM#Flags|flags]] is 0x4: Is64BitInstruction=0(AArch32) and ProcessAddressSpace=0x2.&lt;br /&gt;
&lt;br /&gt;
= SuperMario64 =&lt;br /&gt;
This is a Nintendo 64 emulator. This uses [[JIT_services|JIT]] for running the emulated executable. RomFs also contains an AOT [[NRO]]. A NRO does get loaded, however it&#039;s not used other than that (no symbols from the NRO are resolved).&lt;br /&gt;
&lt;br /&gt;
At the time of release, this was the very first title to use [[JIT_services|JIT]] on retail.&lt;br /&gt;
&lt;br /&gt;
The ROMIMAGE .bin in RomFs is identical to the [https://tcrf.net/Super_Mario_64_(Nintendo_64)/Regional_and_Version_Differences#Shindou_Pak_Taiou_Version Shindou] region N64 ROM. Patches are applied at runtime with the config/lua files.&lt;br /&gt;
&lt;br /&gt;
The LanguageCode is loaded from the launch-parameter passed by the launcher, if not available it will fallback to the output from [[Applet_Manager_services#GetDesiredLanguage|GetDesiredLanguage]]. This is used to select the &amp;lt;language&amp;gt; to load from RomFs &amp;quot;/Message/&amp;quot;, the data from there is then used for patching the ROM. Note that the .lua file runs &amp;lt;code&amp;gt;n64InitMessageData();&amp;lt;/code&amp;gt; from the GameBegin() function.&lt;br /&gt;
&lt;br /&gt;
The ROMIMAGE .bin in RomFs can be replaced with other data (an unofficial image for example) when the config files are adjusted, however note that in some cases a hang may occur during the loading screen.&lt;br /&gt;
&lt;br /&gt;
RomFs contains the following:&lt;br /&gt;
* &amp;quot;/Pipeline.cache&amp;quot;, &amp;quot;/shader_p1_frag.spv&amp;quot;, &amp;quot;/shader_p1_vert.spv&amp;quot;, &amp;quot;/shader_vulkan_frag.spv&amp;quot;, &amp;quot;/shader_vulkan_vert.spv&amp;quot;&lt;br /&gt;
* &amp;quot;/Message/&amp;lt;language&amp;gt;/&amp;quot; contains:&lt;br /&gt;
** &amp;quot;Messages.bin&amp;quot;, &amp;quot;UI_Font8.bin&amp;quot;, &amp;quot;UI_Font16.bin&amp;quot;, &amp;quot;UI_Font16_code2.bin&amp;quot;, &amp;quot;UI_FontS88.bin&amp;quot;.&lt;br /&gt;
* &amp;quot;/.nrr/&amp;quot; contains:&lt;br /&gt;
** &amp;quot;EmuAppNX64.nrr&amp;quot;: The [[NRR]] for the [[JIT_services|JitPlugin]].&lt;br /&gt;
** &amp;quot;04_UNSMJ3.002.nrr&amp;quot;: [[NRR]] for the AOT [[NRO]].&lt;br /&gt;
* &amp;quot;/nro/&amp;quot; contains:&lt;br /&gt;
** &amp;quot;EmuSystemJITPlugin.nro&amp;quot;: The [[NRO]] for the [[JIT_services|JitPlugin]].&lt;br /&gt;
** &amp;quot;NROBuilder.nro&amp;quot;: AOT [[NRO]].&lt;br /&gt;
** &amp;quot;05_UNSMJ3.002.nro&amp;quot;: Same as &amp;quot;NROBuilder.nro&amp;quot;.&lt;br /&gt;
** &amp;quot;/rom/&amp;quot;: This contains the ROM sub-directory, in this case that dir-name is &amp;quot;Stardust_JP&amp;quot; which contains the following:&lt;br /&gt;
*** &amp;quot;Textures/texture_pack.cpio&amp;quot;: Standard (?) .cpio archive containing textures.&lt;br /&gt;
*** &amp;quot;00_UNSMJ3.002.meta&amp;quot;: Contains json metadata for the other files in this directory, etc.&lt;br /&gt;
*** &amp;quot;01_UNSMJ3.002.bin&amp;quot;: This is the ROMIMAGE.&lt;br /&gt;
*** &amp;quot;02_UNSMJ3.002.cfg&amp;quot;: Configuration json file, ROMCONFIG.&lt;br /&gt;
*** &amp;quot;03_UNSMJ3.002.pcb&amp;quot;: This is the &amp;quot;PRECMP&amp;quot; file referenced by the .meta. See [[#EmuSystemJITPlugin]]. Using this can be disabled by changing the &amp;quot;PRECMP&amp;quot; string in the .meta to an invalid string, etc.&lt;br /&gt;
*** &amp;quot;04_UNSMJ3.002.nrr&amp;quot;: Unused [[NRR]] which is the same as &amp;quot;/.nrr/04_UNSMJ3.002.nrr&amp;quot;, except the [[NRR#Certification|Certification]] and ApplicationId are all-zero.&lt;br /&gt;
*** &amp;quot;05_UNSMJ3.002.nro&amp;quot;: Identical to &amp;quot;/nro/05_UNSMJ3.002.nro&amp;quot;.&lt;br /&gt;
*** &amp;quot;06_UNSMJ3.002.lua&amp;quot;: This is the &amp;quot;ROMPATCH&amp;quot; Lua file referenced by the .meta.&lt;br /&gt;
*** &amp;quot;07_UNSMJ3.002.ppl&amp;quot;: This is the &amp;quot;PIPELINE&amp;quot; file referenced by the .meta.&lt;br /&gt;
&lt;br /&gt;
== Emulation Notes ==&lt;br /&gt;
The generated-code runs from the main-thread. The following 4 threads are created:&lt;br /&gt;
* Audio thread.&lt;br /&gt;
* &amp;quot;g_trlRenderTaskThread&amp;quot;. Calls funcptr/object-vfunc from a list of tasks (funcptr/object only used if set), where the tasks are sent by the main-thread. These tasks can be triggered by accessing various IO regs with Write32 (see below), etc.&lt;br /&gt;
* A thread which basically does nothing, just uses a Semaphore and sleeps, while checking state.&lt;br /&gt;
* An unknown thread.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;n64MemDefault{Read/Write}{bitsize}(...)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}: implements memory read/write, all read/written data is byte-swapped. First param is the u32 vaddr. For Write, the second param is the value. For Read, the returned u32 is the read value.&lt;br /&gt;
* &amp;lt;code&amp;gt;n64MemDefaultReadSpecial{bitsize}(...)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}: same as &amp;lt;code&amp;gt;n64MemDefaultRead{bitsize}&amp;lt;/code&amp;gt;, except this runs the additional Special functionality when accessing RAM.&lt;br /&gt;
* &amp;lt;code&amp;gt;n64MemDefault{Read/Write}{bitsize}WithDestLog(...)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}: same as &amp;lt;code&amp;gt;n64MemDefault{Read/Write}{bitsize}&amp;lt;/code&amp;gt;, except this calls an additional logging func when accessing RAM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Read8/Write8 only implements access for RAM and SP_DMEM/SP_IMEM. 0 is returned for Read when the address is unrecognized.&lt;br /&gt;
* Read16/Write16 only implements access for RAM. Read16WithDestLog/Write16WithDestLog will additionally call the logging func if the address is in the IO region (high byte is 0x04). 0 is returned for Read when the address is unrecognized.&lt;br /&gt;
* Read32/Write32 implements RAM access and all supported non-RAM IO/memory access. 0 is returned for Read when the address is unrecognized.&lt;br /&gt;
* Read64/Write64 are implemented the same as *16 above, except this is for 64bit.&lt;br /&gt;
&lt;br /&gt;
== EmuSystemJITPlugin ==&lt;br /&gt;
This section documents the [[JIT_services|JIT]] plugin.&lt;br /&gt;
&lt;br /&gt;
First, [[JIT_services#Control|Control]] is used with a 0xEB0-byte struct for the InBuffer, and cmd in_u64=0. The OutBuffer is unused. This does initialization, and copies the input struct to workmem+0x0.&lt;br /&gt;
&lt;br /&gt;
The u64 for [[JIT_services#GenerateCode|GenerateCode]] is the type: 1-4 are valid. Type1 is used first, then type2. Then type3 is used with data loaded from the &amp;quot;PRECMP&amp;quot; file (the passed array data will be empty if the PRECMP file is not available). Type4 is only used when executing an emu_pc_addr which was not previously compiled, with a matching emu_pc_addr.&lt;br /&gt;
&lt;br /&gt;
The u32 for the input Struct32 size is ignored by the plugin.&lt;br /&gt;
&lt;br /&gt;
* Type1: Struct32 and InBuffer are unused. Generates the entry code which can be called for running the rest of the code in the CodeMemory. After the generated code finishes setup, it jumps to x0.&lt;br /&gt;
* Type2: Struct32 and InBuffer are unused. Generates the code for returning from CodeMemory, which is used by the rest of the generated code.&lt;br /&gt;
* Type3: The emulator passes the 0x8-bytes from InBuffer+0 as the input Struct32, however the plugin doesn&#039;t use the Struct32. The emulator passes InBuffer_size=0x8C00048 and OutBuffer_size=0x2900008. This generates code for the MIPS code specified in the InBuffer. The InBuffer contains array data etc. The InBuffer can contain multiple blocks of code, which are generally individual MIPS functions. The MIPS instructions are big-endian.&lt;br /&gt;
* Type4: 0x20-bytes are passed for the input Struct32: u32 +0 = emu_pc_addr, u32 +4 = set by emulator but unused by the plugin, u32 +0x18 = instruction_count (which determines the InBuffer size), the rest is unused / overwritten by the plugin. This generates code for the MIPS code specified in the InBuffer. InBuffer+0 is the u32s for the big-endian MIPS instructions. The OutBuffer is 0x2000C-bytes:&lt;br /&gt;
** +0x0 is an array of u32s with the count from u32 +0x20004. Each entry is the generated-code offset for each compiled MIPS instruction, relative to the CodeRange offset.&lt;br /&gt;
** +0x10000 is an array of u32s with the count from u32 +0x20004. Each entry is flags for each compiled MIPS instruction.&lt;br /&gt;
** The 3 u32s at +0x20000 are the same as OutBuffer+0x0 with type1/type2 (except the last two fields can be non-zero). +0x20004 is the total compiled MIPS instructions. +0x20008 is emu_pc_addr for the first compiled instruction.&lt;br /&gt;
&lt;br /&gt;
0xC-bytes are copied to the OutBuffer with type1/type2, these come from workmem. These 3 u32s are left at all-zero, except for +0 which is the generated_code_size (which is then copied to the output CodeRange size).&lt;br /&gt;
&lt;br /&gt;
The 0xEB0-byte controldata struct has the following structure (all addrs/data are from the emulator user-process):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || Data addr: g_pGPR&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8 || Data addr: g_pFPR&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8 || Data addr: g_pCP0&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x8 || Data addr: g_nRegHi&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x8 || Data addr: g_nRegLo&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x8 || Data addr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x8 || Data addr: g_nFCSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x8 || Data addr: g_bN64CpuCmpEndCheck&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || 0x8 || Data addr: g_nN64CpuPC&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x8 || Data addr: g_nN64CpuJmpPC. s32, normally -1. When not -1 this is a value which can be copied into g_nN64CpuJmpPC by the generated code, with g_nN64CpuJmpPC being reset to -1 afterwards regardless of the original value.&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || 0x8 || Data addr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x58 || 0x8 || Data addr: g_nN64CpuHaveExp&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || 0x658 || Array of funcptrs. Called with w0=instruction_value from generated code for handling instructions&#039; implementation, when the plugin itself doesn&#039;t handle it.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B8 || 0x8 || Funcptr: &amp;lt;code&amp;gt;n64CPUProcInstCOP1Check()&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C0 || 0x8 || Funcptr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C8 || 0x8 || Funcptr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D0 || 0x8 || Funcptr: &amp;lt;code&amp;gt;n64CPUSetRegisterCP0(int, unsigned int)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D8 || 0x8 || Funcptr: &amp;lt;code&amp;gt;n64CPUGetRegisterCP0(int)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x6E0 || 0x20 || Funcptrs for reading data: &amp;lt;code&amp;gt;n64MemDefaultRead{bitsize}(unsigned int)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64} (32 uses &amp;lt;code&amp;gt;n64MemDefaultRead32WithDestLog&amp;lt;/code&amp;gt;). Unused by the plugin.&lt;br /&gt;
|-&lt;br /&gt;
| 0x700 || 0x20 || Funcptrs for reading Special data: &amp;lt;code&amp;gt;n64MemDefaultReadSpecial{bitsize}(unsigned int)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}.&lt;br /&gt;
|-&lt;br /&gt;
| 0x720 || 0x20 || Funcptrs for writing data: &amp;lt;code&amp;gt;n64MemDefaultWrite{bitsize}(unsigned int, ...)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64} (32 uses &amp;lt;code&amp;gt;n64MemDefaultWrite32WithDestLog&amp;lt;/code&amp;gt;). Unused by the plugin.&lt;br /&gt;
|-&lt;br /&gt;
| 0x740 || 0x20 || Funcptrs for reading data via the WithDestLog version: &amp;lt;code&amp;gt;n64MemDefaultRead{bitsize}WithDestLog(unsigned int)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}.&lt;br /&gt;
|-&lt;br /&gt;
| 0x760 || 0x20 || Funcptrs for writing data via the WithDestLog version: &amp;lt;code&amp;gt;n64MemDefaultWrite{bitsize}WithDestLog(unsigned int, ...)&amp;lt;/code&amp;gt;, where bitsize is {8, 16, 32, 64}.&lt;br /&gt;
|-&lt;br /&gt;
| 0x780 || 0x8 || Funcptr: &amp;lt;code&amp;gt;n64CPU_CallLuaAfterInst(unsigned int, unsigned int)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x788 || 0x8 || Funcptr: &amp;lt;code&amp;gt;n64CPU_CallLuaBeforeInst(unsigned int, unsigned int)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x790 || 0x8 || Funcptr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x798 || 0x4 || Array count for the the following array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x79C || 0x180 (0x20*0xC) || Array data with the above count, each entry is 0xC-bytes. The emulator loads this from config array &amp;quot;Idle&amp;quot;. +0 = u32 emu_pc_addr (config &amp;quot;JmpAddr&amp;quot;), +4 = u32 instruction_value (config &amp;quot;JmpInst&amp;quot;), +8 = u32 is_idle (config &amp;quot;IsIdle&amp;quot;, 0x1 = enabled).&lt;br /&gt;
|-&lt;br /&gt;
| 0x91C || 0x4 || Array count for the the following array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x920 || 0x500 (0x40*0x14) || Array data with the above count, each entry is 0x14-bytes. The emulator loads this from config array &amp;quot;SpecialInst&amp;quot;. +0 = u32 emu_pc_addr (config &amp;quot;Addr&amp;quot;), +4 = u32 instruction_value (config &amp;quot;Inst&amp;quot;), +8 = u32 flags. The emulator sets the flags to 0 by default, then compares config &amp;quot;Type&amp;quot; with various strings to determine the value. Flags: bit0 = Type &amp;quot;BreakLoop&amp;quot;, bit5 = Type &amp;quot;LoadFrameBuffer&amp;quot;, bit6 = Type &amp;quot;Lua_BeforeInst&amp;quot;, bit7 = Type &amp;quot;Lua_AfterInst&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When the config for {any of the previously mentioned Type strings} is set to value 1, the emulator will also enable the corresponding flags bit mentioned above. Likewise with config &amp;quot;Return&amp;quot;, which sets flags bit8.&lt;br /&gt;
&lt;br /&gt;
When the plugin loads a funcptr from +0x740, it will load a funcptr from +0x700 instead if there&#039;s a matching entry here which has bit5 set.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE20 || 0x4 || Array count for the the following array. The plugin doesn&#039;t use this.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE24 || 0x80 (0x10*0x8) || Array data with the above count, each entry is 0x8-bytes. The emulator loads this from config array &amp;quot;FrameBuffer&amp;quot;. +0 = u32 (config &amp;quot;Addr&amp;quot;), +4 = u32 (config &amp;quot;Length&amp;quot;). The plugin doesn&#039;t use this.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEA4 || 0x4 || Set to 0 by default, then if available the emulator sets bit flags here depending on the content of the config for &amp;lt;code&amp;gt;&amp;quot;Cmp&amp;quot;, &amp;quot;g_nN64CpuCmpTLBCheckLevel&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEA8 || 0x4 || Set to 0 by default by the emulator. With config &amp;lt;code&amp;gt;&amp;quot;Cmp&amp;quot;, &amp;quot;CodeMultiAddr&amp;quot;&amp;lt;/code&amp;gt; this is set to 1, and with config &amp;lt;code&amp;gt;&amp;quot;Cmp&amp;quot;, &amp;quot;BlockDynamicPC&amp;quot;&amp;lt;/code&amp;gt; this is set to 2. The plugin only checks whether this ==2 or !=2, so values 0-1 are basically the same.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEAC || 0x4 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= SuperMarioSunshine =&lt;br /&gt;
This is a Nintendo Gamecube emulator. The emulator (which is the main-codebin) name is &amp;quot;Hagi&amp;quot;. This uses an AOT [[NRO]] for running the emulated executable.&lt;br /&gt;
&lt;br /&gt;
Since this uses AOT, attempting to run a different .dol with this emulator is equivalent to attempting to run an emulator with an executable where .text (code) is the from the original executable, while everything else is from the other executable.&lt;br /&gt;
&lt;br /&gt;
This emulator supports arguments with argc/argv, when launched officially zero [[Loader_services#SetProgramArgument|arguments]] are passed for this (unless [[Loader_services#SetProgramArgument|SetProgramArgument]] is used manually prior to launching). The emulator will also load arguments from RomFs &amp;quot;/default_cmd.txt&amp;quot; when argc==1, otherwise it loads arguments from a filepath loaded elsewhere. Hence, when not launched with arguments with an official launch, &amp;quot;/default_cmd.txt&amp;quot; is not used. Some of the supported arguments are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument !! Description&lt;br /&gt;
|-&lt;br /&gt;
| --volume=&amp;lt;0..100&amp;gt; || Set sound volume (default: 100).&lt;br /&gt;
|-&lt;br /&gt;
| --disable-file-cache || Disable file cache if supported by the platform.&lt;br /&gt;
|-&lt;br /&gt;
| --no-dol-hash || Do not calculate DOL hash (unsafe)&lt;br /&gt;
|-&lt;br /&gt;
| --screenshot-period=&amp;lt;value&amp;gt;, -sp || Takes screenshots every n frame&lt;br /&gt;
|-&lt;br /&gt;
| --screenshot-write-queue-thread-count=&amp;lt;0..n&amp;gt; || Change the number of threads allocated to the screenshot write queue, 0 to disable (default: 1).&lt;br /&gt;
|-&lt;br /&gt;
| --delete-after-load || Delete save state after a successful load.&lt;br /&gt;
|-&lt;br /&gt;
| --listen-port=&amp;lt;port&amp;gt; || Specify the service port to listen to (default: 1234).&lt;br /&gt;
|-&lt;br /&gt;
| --card-uncompressed || Do not compress card.&lt;br /&gt;
|-&lt;br /&gt;
| --sync-guest-none || Don&#039;t synchronize emulation, run as fast as possible.&lt;br /&gt;
|-&lt;br /&gt;
| --gecko-patch=&amp;lt;name&amp;gt; || Apply Gecko patch &amp;lt;name&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| --log=&amp;lt;file&amp;gt; || Log to file instead of stdout. Defaults to stdout&lt;br /&gt;
|-&lt;br /&gt;
| --rootdir=&amp;lt;path&amp;gt;, -r&amp;lt;path&amp;gt; || Set the root directory&lt;br /&gt;
|-&lt;br /&gt;
| --no-patch || Do not apply standard patch&lt;br /&gt;
|-&lt;br /&gt;
| --stop-failed-test[=&amp;lt;number&amp;gt;] || Stop subtests after &amp;lt;number&amp;gt; differences (default 10).&lt;br /&gt;
|-&lt;br /&gt;
| --exit=&amp;lt;value&amp;gt;, -e || Exit after n frames&lt;br /&gt;
|-&lt;br /&gt;
| --help, -h || Print usage and exit.&lt;br /&gt;
|-&lt;br /&gt;
| --mute || Start ROM with mute sound.&lt;br /&gt;
|-&lt;br /&gt;
| --sync-guest-with-wall || Synchronize emulation with wall time.&lt;br /&gt;
|-&lt;br /&gt;
| --sync-guest-with-host || Synchronize emulation with host.&lt;br /&gt;
|-&lt;br /&gt;
| --test=&amp;lt;filename&amp;gt;, -t || Starts emulator in unit test mode.&lt;br /&gt;
|-&lt;br /&gt;
| --no-pip || Don&#039;t use pipeline database.&lt;br /&gt;
|-&lt;br /&gt;
| --play-input || Play previously recorded input&lt;br /&gt;
|-&lt;br /&gt;
| --command=&amp;lt;file&amp;gt; || Use file as the contents of the command line (one arg per line).&lt;br /&gt;
|-&lt;br /&gt;
| --dim-screen-after=&amp;lt;s&amp;gt; || Dim screen after &amp;lt;s&amp;gt; seconds of inactivity.&lt;br /&gt;
|-&lt;br /&gt;
| --random-inputs-period=&amp;lt;0..n&amp;gt; || Change the random inputs period in number of frames (default: 10).&lt;br /&gt;
|-&lt;br /&gt;
| --config=&amp;lt;filename&amp;gt;, -cfg || Gives path to the config file&lt;br /&gt;
|-&lt;br /&gt;
| --ask, -a || Ask for a rom and execute it.&lt;br /&gt;
|-&lt;br /&gt;
| --load-state-slot=&amp;lt;index&amp;gt;, -lss&amp;lt;index&amp;gt; || Load save state by index.&lt;br /&gt;
|-&lt;br /&gt;
| --load-state-file=&amp;lt;filename&amp;gt;, -lsf&amp;lt;filename&amp;gt; || Load save state by filename.&lt;br /&gt;
|-&lt;br /&gt;
| --generatetest=&amp;lt;directory&amp;gt;, -gt || Starts emulator in unit test mode and generate output files inside the given directory.&lt;br /&gt;
|-&lt;br /&gt;
| --waitcontroller, -wc || Stop CPU until controller 0 has been detected&lt;br /&gt;
|-&lt;br /&gt;
| --card-format=&amp;lt;size_in_Mbits&amp;gt; || Format card using given size in MBits (default 4, possible 8, 16, 32, 64, 128).&lt;br /&gt;
|-&lt;br /&gt;
| --card-force-copy || Force card copy from read-only support to read-write support (on supported platforms).&lt;br /&gt;
|-&lt;br /&gt;
| --screenshot-output-format=[png|ppm] || Change the format of the screenshots when using the generic screenshot capture code (default: png).&lt;br /&gt;
|-&lt;br /&gt;
| --config-override || Use a specific config override filename.&lt;br /&gt;
|-&lt;br /&gt;
| --random-inputs || Use random inputs instead of values from physical controllers.&lt;br /&gt;
|-&lt;br /&gt;
| --log-unit-test || Enable log in unit test mode.&lt;br /&gt;
|-&lt;br /&gt;
| --break-on-start, -bos || Break at the start of the rom.&lt;br /&gt;
|-&lt;br /&gt;
| --record-input || Record input&lt;br /&gt;
|-&lt;br /&gt;
| --screenshot-write-queue-capacity=&amp;lt;1..n&amp;gt; || Change the capacity of the screenshot queue (default: thread-count * 2 + 1).&lt;br /&gt;
|-&lt;br /&gt;
| --random-inputs-seed=&amp;lt;0..n&amp;gt; || Change the random inputs seed value (default: 0).&lt;br /&gt;
|-&lt;br /&gt;
| --listen-address=&amp;lt;address&amp;gt; || Specify the service address to listen to (default: 0.0.0.0).&lt;br /&gt;
|-&lt;br /&gt;
| --gui, -gui || Use the GUI mode&lt;br /&gt;
|-&lt;br /&gt;
| --break-on-start-dsp, -bosd || Break at the start of the dsp program.&lt;br /&gt;
|-&lt;br /&gt;
| --no-db-config || Do not use the ROM DB config override.&lt;br /&gt;
|-&lt;br /&gt;
| --features || Print features and exit.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This emulator uses various hashes, SHA-1 is used for this.&lt;br /&gt;
&lt;br /&gt;
This supports loading Bios from a file where the path is determined using the specified LanguageCode, when config flags &amp;quot;Emulate&amp;quot; and &amp;quot;LoadBios&amp;quot; are true, however with the MarioSunshine config the latter config flag is false.&lt;br /&gt;
&lt;br /&gt;
RomFs contains the following: &lt;br /&gt;
* &amp;quot;/hagi.config&amp;quot;: Emulator json configuration.&lt;br /&gt;
* &amp;quot;/hagi-override.config&amp;quot;: Emulator json configuration.&lt;br /&gt;
* &amp;quot;/rom.json&amp;quot;: ROM json configuration, contains the following fields:&lt;br /&gt;
** &amp;quot;UID&amp;quot;: Game-name.&lt;br /&gt;
** &amp;quot;DolHash&amp;quot;: Hash.&lt;br /&gt;
** &amp;quot;ROM&amp;quot;: An array of strings for the absolute file path for the ROM. In this case, it only contains the following: &amp;quot;rom:/MarioSunshine/Super_Mario_Sunshine_Stardust-trimmed.gcm&amp;quot;.&lt;br /&gt;
* &amp;quot;/.nrr/Hagi.nrr&amp;quot;: [[NRR]] for the AOT [[NRO]].&lt;br /&gt;
* &amp;quot;/MarioSunshine/&amp;quot;: This contains the following:&lt;br /&gt;
** &amp;quot;Super_Mario_Sunshine_Stardust-trimmed.gcm&amp;quot;: This is the .gcm image mentioned above.&lt;br /&gt;
** &amp;quot;Super_Mario_Sunshine_Stardust-trimmed.hash&amp;quot;: Contains json configuration for various hashes.&lt;br /&gt;
* &amp;quot;/data/&amp;quot;: This contains the following:&lt;br /&gt;
** &amp;quot;database/&amp;quot;: This contains the following:&lt;br /&gt;
*** &amp;quot;config/MarioSunshine.config&amp;quot;: This contains game-specific emulator json configuration.&lt;br /&gt;
*** &amp;quot;hagi/MarioSunshine.json&amp;quot;: This contains ROM json configuration. IDs, names, etc. This also contains various hashes, including a duplicate of the above .hash file.&lt;br /&gt;
*** &amp;quot;pip/MarioSunshine/pipelineDB.pip&amp;quot;&lt;br /&gt;
*** &amp;quot;vulkan/MarioSunshine/B1317A6632265CF763766CF6339AC8D1.cache&amp;quot;: This is the .cache file mentioned in [[#Savedata]].&lt;br /&gt;
** &amp;quot;gekko/MarioSunshine/nx/MarioSunshine.nrolz&amp;quot;: This is the AOT [[NRO]]. LZ4 compressed, first 4-bytes is the big-endian decompressed size, then the compressed data follows.&lt;br /&gt;
** &amp;quot;lazy_texture_replace/MarioSunshine&amp;quot;: Contains PNG textures.&lt;br /&gt;
** &amp;quot;saves/MarioSunshine/A.sav&amp;quot;: Savedata. Presumably used to create the initial savedata file?&lt;br /&gt;
** &amp;quot;texture_replace/&amp;quot;: Contains &amp;quot;MarioSunshine.har&amp;quot; and &amp;quot;MarioSunshine.hix&amp;quot;.&lt;br /&gt;
** &amp;quot;video_replace/MarioSunshine/&amp;quot;: Contains MP4 videos.&lt;br /&gt;
&lt;br /&gt;
== AOT NRO ==&lt;br /&gt;
This section documents the AOT NRO. There are only two symbols from NRO which the main-codebin does lookup for and uses: &amp;quot;SetGekkoMemoryPointer&amp;quot; and &amp;quot;GetStatifierInfo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
During initialization, &amp;lt;code&amp;gt;nn::os::AllocateAddressRegion&amp;lt;/code&amp;gt; is used with size 0x100200000. Then &amp;lt;code&amp;gt;nn::os::AllocateMemoryPages&amp;lt;/code&amp;gt; is used (which uses [[SVC#MapPhysicalMemory|svcMapPhysicalMemory]]):&lt;br /&gt;
* base+0 size 0x1000 is allocated.&lt;br /&gt;
* base+0x80000000 size 0x1800000 is allocated.&lt;br /&gt;
* base+0xE0000000 size 0x4000 is allocated.&lt;br /&gt;
* base+0xFFF00000 size 0x200000 is allocated.&lt;br /&gt;
&lt;br /&gt;
Initially SetGekkoMemoryPointer is called with base+0x80000000, however at some point it&#039;s called (?) with base+0.&lt;br /&gt;
&lt;br /&gt;
The AOT NRO does all main-memory accesses by accessing {global ptr set by SetGekkoMemoryPointer}+{ppc_addr}. Therefore, above base+0 == ppc_addr 0x0. Since svcMapPhysicalMemory is used above, attempting to access any PPC-addrs not in the allocated regions above will result in the emulator crashing due to accessing unmapped memory - accessing non-PPC emulator data with invalid PPC-addrs is not possible. These crashes may happen when attempting to run a different .dol with the emulator as previously mentioned.&lt;br /&gt;
&lt;br /&gt;
GetStatifierInfo takes an input string param and an output u64* param. This returns a bool: 0 = error, 1 = success. The NRO compares the input string with various strings to determine an array index, returning 0 if there&#039;s no match. Otherwise, the u64 data from the located array entry is copied to the output u64.&lt;br /&gt;
* &amp;quot;GET_FUNCTION_INFO&amp;quot;: Ptr to a table, where each entry is 0x18-bytes. Structure: +0x0 = ppc_code_addr, +0x8 = nro_code_addr, +0x10 = string ptr (normally &amp;quot;&amp;quot;).&lt;br /&gt;
* &amp;quot;GET_FUNCTION_INFO_SIZE&amp;quot; Ptr to the size of the FUNCTION_INFO table, in entries.&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
Each func in the NRO listed in the above table (which are the AOT funcs) is called with x0={state ptr}, where state contains:&lt;br /&gt;
* +0x0: u32 array for the PPC GPRs.&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
= SuperMarioGalaxy =&lt;br /&gt;
This appears to use an emulator similar to the one used by [[#SuperMarioSunshine]]. The code/data for the MarioGalaxy executable is included directly in the main-codebin.&lt;br /&gt;
&lt;br /&gt;
RomFs contains the following: &lt;br /&gt;
* &amp;quot;/hagi.config&amp;quot;: This is mostly the same as the &amp;quot;/hagi.config&amp;quot; for [[#SuperMarioSunshine]], except with various config fields adjusted.&lt;br /&gt;
* &amp;quot;/data/&amp;quot;: This contains the following:&lt;br /&gt;
** &amp;quot;database/&amp;quot;: This contains &amp;quot;pip/pipelineDB.pip&amp;quot; and &amp;quot;vulkan/FDBD9F0C3FEA5778E10FFFA74093E0B8.cache&amp;quot;.&lt;br /&gt;
** &amp;quot;dsp/&amp;quot;: This contains &amp;quot;drom.bin&amp;quot; and &amp;quot;irom.bin&amp;quot;.&lt;br /&gt;
** &amp;quot;ondemand_texture_replace/MarioGalaxy/&amp;quot;: This contains PNG textures.&lt;br /&gt;
** &amp;quot;texture_replace/&amp;quot;: This contains &amp;quot;MarioGalaxy.har&amp;quot;, &amp;quot;MarioGalaxy.hix&amp;quot;, &amp;quot;MarioGalaxy_&amp;lt;language&amp;gt;.har&amp;quot;, &amp;quot;MarioGalaxy_&amp;lt;language&amp;gt;.hix&amp;quot;, &amp;quot;MarioGalaxy_Sub.har&amp;quot;, &amp;quot;MarioGalaxy_Sub.hix&amp;quot;.&lt;br /&gt;
** &amp;quot;video_replace/MarioGalaxy/MovieData/&amp;quot;: This contains MP4 videos.&lt;br /&gt;
* The rest is the MarioGalaxy game assets stored directly in RomFs.&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the game-update changes.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
In ExeFs, the only [[NPDM]] change was the usual ACID pubkey/signature update. The only other ExeFs change, was that the main-codebin was updated only for SuperMarioSunshine/SuperMarioGalaxy.&lt;br /&gt;
&lt;br /&gt;
RomFs changes:&lt;br /&gt;
* Launcher: Not updated.&lt;br /&gt;
* SuperMario64: Both [[NRR]]s were updated, pubkey/signature was updated. No other files were updated.&lt;br /&gt;
* SuperMarioSunshine: Only &amp;quot;/.nrr/Hagi.nrr&amp;quot; was updated, same as above.&lt;br /&gt;
* SuperMarioGalaxy:&lt;br /&gt;
** &amp;quot;/data/texture_replace/&amp;quot;: Various files here were updated.&lt;br /&gt;
** &amp;quot;/&amp;lt;language&amp;gt;/LayoutData/Font.arc&amp;quot;: Updated.&lt;br /&gt;
** &amp;quot;/LayoutData/CameraInfo.arc&amp;quot;, &amp;quot;/LayoutData/IconAButton.arc&amp;quot;, &amp;quot;/StationedData/GDDR3.arc&amp;quot;, &amp;quot;/StationedData/GDDR3.zst&amp;quot;: Updated.&lt;br /&gt;
&lt;br /&gt;
== v1.1.0 ==&lt;br /&gt;
ExeFs:&lt;br /&gt;
* Updated for using SDK 10.8.1.0, except for SuperMarioSunshine/SuperMarioGalaxy.&lt;br /&gt;
* NPDMs for all Programs only had the usual update (see [[#v1.0.1]]).&lt;br /&gt;
** Launcher: All files in ExeFs were updated.&lt;br /&gt;
** SuperMario64: All files in ExeFs were updated, except subsdk*.&lt;br /&gt;
** SuperMarioSunshine/SuperMarioGalaxy: Only main-codebin and the NPDM were updated.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
* Launcher: The following was updated:&lt;br /&gt;
** /Layout/CursorArrow.Nin_NX_NVN.blarc.zs&lt;br /&gt;
** /Layout/DialogKeyButton.Nin_NX_NVN.blarc.zs&lt;br /&gt;
** /Layout/DialogTwoButton.Nin_NX_NVN.blarc.zs&lt;br /&gt;
** /Message/Msg_CNzh.d.sarc.zs&lt;br /&gt;
** /Message/Msg_JPja.d.sarc.zs&lt;br /&gt;
* SuperMario64: The following was updated:&lt;br /&gt;
** /nro/05_UNSMJ3.002.nro&lt;br /&gt;
** /nro/EmuSystemJITPlugin.nro&lt;br /&gt;
*** This appears to be just a rebuild. A func called by _fini/etc was updated, nothing else specific to the plugin was changed in .text. The .nrs build filepath was also changed.&lt;br /&gt;
** /nro/NROBuilder.nro&lt;br /&gt;
** /.nrr/04_UNSMJ3.002.nrr&lt;br /&gt;
** /.nrr/EmuAppNX64.nrr&lt;br /&gt;
** /Pipeline.cache&lt;br /&gt;
** &amp;quot;/rom/Stardust_JP/00_UNSMJ3.002.meta&amp;quot; Newlines now use LF instead of CRLF.&lt;br /&gt;
** &amp;quot;/rom/Stardust_JP/02_UNSMJ3.002.cfg&amp;quot; Newlines now use LF instead of CRLF. The content of the &amp;quot;Comment&amp;quot; entries under &amp;quot;SpecialInst&amp;quot; had the string characters replaced with &#039;*&#039; (for redacting the string). The Lua hook entries were updated under &amp;quot;SpecialInst&amp;quot;. The &amp;quot;Comment&amp;quot; entries under &amp;quot;VertexHack&amp;quot; were redacted the same way, nothing else changed under &amp;quot;VertexHack&amp;quot;.&lt;br /&gt;
** /rom/Stardust_JP/04_UNSMJ3.002.nrr&lt;br /&gt;
** /rom/Stardust_JP/05_UNSMJ3.002.nro&lt;br /&gt;
** &amp;quot;/rom/Stardust_JP/06_UNSMJ3.002.lua&amp;quot; Newlines now use LF instead of CRLF. Comments were redacted, see above. HookFunc_AfterInst was updated for handling the updated hooks mentioned above.&lt;br /&gt;
* SuperMarioSunshine:&lt;br /&gt;
** &amp;quot;/data/database/config/MarioSunshine.config&amp;quot; The config entries for &amp;quot;KeyPadAxisTriggerLeft&amp;quot;/&amp;quot;KeyPadAxisTriggerRight&amp;quot; were updated.&lt;br /&gt;
** &amp;quot;/data/gekko/MarioSunshine/nx/MarioSunshine.nrolz&amp;quot; updated&lt;br /&gt;
** The following files were added under &amp;quot;/data/lazy_texture_replace/MarioSunshine/&amp;quot;:&lt;br /&gt;
*** 5323227429978722713_lod1.png&lt;br /&gt;
*** 5323227429978722713_lod2.png&lt;br /&gt;
*** 5323227429978722713_lod3.png&lt;br /&gt;
*** 5323227429978722713.png&lt;br /&gt;
** &amp;quot;/hagi-override.config&amp;quot; Formatting was adjusted.&lt;br /&gt;
** &amp;quot;/MarioSunshine/Super_Mario_Sunshine_Stardust-trimmed.gcm&amp;quot; updated&lt;br /&gt;
** &amp;quot;/.nrr/Hagi.nrr&amp;quot; updated&lt;br /&gt;
** &amp;quot;/rom.json&amp;quot; The DolHash was updated.&lt;br /&gt;
* SuperMarioGalaxy: The only change was removing the following files from &amp;quot;/StationedData/&amp;quot;:&lt;br /&gt;
** DEBUG.arc&lt;br /&gt;
** DEBUG.zst&lt;br /&gt;
** GDDR3.arc&lt;br /&gt;
** NAPA.zst&lt;br /&gt;
&lt;br /&gt;
The Manual RomFs for each game was also updated.&lt;br /&gt;
&lt;br /&gt;
DeltaFragment NCAs were also added.&lt;br /&gt;
&lt;br /&gt;
== v1.1.1 ==&lt;br /&gt;
ExeFs:&lt;br /&gt;
* NPDMs for all Programs only had the usual update (see [[#v1.0.1]]).&lt;br /&gt;
* The only other change was updating the main-codebin for SuperMario64.&lt;br /&gt;
&lt;br /&gt;
RomFs: ...&lt;br /&gt;
&lt;br /&gt;
= Savedata =&lt;br /&gt;
The savedata contains the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;/PlayReport/account.prsav&amp;quot;&lt;br /&gt;
* &amp;quot;/StardustLauncher/game_data.sav&amp;quot;&lt;br /&gt;
* &amp;quot;/Mario64/Mario64.sav&amp;quot;: The raw N64 savedata.&lt;br /&gt;
* &amp;quot;/MarioSunshine/&amp;quot;: This contains the following data, for MarioSunshine:&lt;br /&gt;
** &amp;quot;gekko/log/&amp;quot;, &amp;quot;gekko/trace/&amp;quot;, and &amp;quot;hanafuda/&amp;quot;: Empty directories.&lt;br /&gt;
** &amp;quot;A.sav&amp;quot;: The memory card image. The first 4-bytes are the big-endian decompressed size, followed by the LZ4 compressed data.&lt;br /&gt;
** &amp;quot;B.raw&amp;quot;: Uncompressed raw version of the memory card image. All-zeros, since it doesn&#039;t seem to be used after creation? This normally doesn&#039;t exist: this only exists if the application had argv parameter &amp;quot;--card-uncompressed&amp;quot; passed.&lt;br /&gt;
** &amp;quot;B1317A6632265CF763766CF6339AC8D1.cache&amp;quot;: This is probably graphics pipeline related?(RomFs has an identical file)&lt;br /&gt;
* &amp;quot;/MarioGalaxy/GameData.bin&amp;quot;: The savedata for SuperMarioGalaxy.&lt;/div&gt;</summary>
		<author><name>Liamwhite</name></author>
	</entry>
</feed>