<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.3dbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Qyriad</id>
	<title>3dbrew - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.3dbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Qyriad"/>
	<link rel="alternate" type="text/html" href="https://www.3dbrew.org/wiki/Special:Contributions/Qyriad"/>
	<updated>2026-04-16T01:26:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Mysteries&amp;diff=20687</id>
		<title>Mysteries</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Mysteries&amp;diff=20687"/>
		<updated>2018-05-03T15:43:17Z</updated>

		<summary type="html">&lt;p&gt;Qyriad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following is a list of mysteries.&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
* What is the CTR abbreviation?&lt;br /&gt;
: C may stand for Chiheisen (&amp;quot;horizon&amp;quot; in Japanese, the O3DS&#039;s codename being &amp;quot;Project Horizon&amp;quot;).&lt;br /&gt;
:: Not true, Horizon refers to the OS.&lt;br /&gt;
: CTR stands for Citrus.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
=== Why are there two CTRCARD controllers? ===&lt;br /&gt;
&#039;&#039;&#039;Background:&#039;&#039;&#039; Also [http://problemkaputt.de/twl-core.jpg DSi SoC pinout] shows evidence of dual NTRCARD controllers on the final DSi SoC. (This was a [http://i.imgur.com/0kJlbEw.png planned feature] of the DSi before being axed later in development)&lt;br /&gt;
&lt;br /&gt;
=== Why are there two EMMC controllers? ===&lt;br /&gt;
&#039;&#039;&#039;Theory:&#039;&#039;&#039; At some point during 3DS hardware development there was an idea to split up CTR and TWL nand into two different chips.&lt;br /&gt;
=== Is there a JTAG? ===&lt;br /&gt;
=== Is there more than one revision of the bootrom? ===&lt;br /&gt;
&#039;&#039;&#039;Background:&#039;&#039;&#039; Bootrom visible portion has been dumped on the entire 3DS Family (3DS, 3DSXL, 2DS, New3DS, New3DSXL, New2DSXL), and even a prototype board from April(?) 2010. All matching exactly.&lt;br /&gt;
&lt;br /&gt;
=== What is the EMMC controller @ 0x10100000 doing? ===&lt;br /&gt;
&#039;&#039;&#039;Background:&#039;&#039;&#039; There&#039;s dead code in NWM referencing it.&lt;br /&gt;
=== Why did they put NTRCARD accessible from ARM11? ===&lt;br /&gt;
&#039;&#039;&#039;Theory:&#039;&#039;&#039; At some point during 3DS hardware development there was a concept where ARM11 ran a menu with DS(i) icons while ARM9 was in TWL mode.&lt;br /&gt;
&lt;br /&gt;
=== Is there a secret message embedded in the 3DS keyscrambler constant? ===&lt;br /&gt;
&#039;&#039;&#039;Background:&#039;&#039;&#039; TWL key scrambler constant was &amp;quot;Nintendo Co., Ltd&amp;quot; in Japanese (&amp;quot;任天堂株式会社&amp;quot;), UTF-16LE encoded, with byte order mark.  The 3DS key scrambler constant, by comparison, is random-looking.&lt;br /&gt;
&lt;br /&gt;
=== What is the PDN abbreviation? ===&lt;br /&gt;
: Power distribution network&lt;br /&gt;
&lt;br /&gt;
=== How does Nintendo reflash bricked systems? ===&lt;br /&gt;
Before trying to boot from NAND, the bootrom checks to see if a key combination (Start + Select + X) is being held, and whether the shell is closed. If so, it tries to boot from an inserted NTR (Nintendo DS) cartridge.&lt;br /&gt;
This allows to execute a FIRM that is probably used by Nintendo to reflash the system.&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
=== What was the problem in &amp;quot;initial program loader&amp;quot; that was mentioned in an FCC filing by Nintendo for 2DS? ===&lt;br /&gt;
&#039;&#039;&#039;Background:&#039;&#039;&#039; http://www.neogaf.com/forum/showthread.php?t=814624&amp;amp;page=1&lt;br /&gt;
=== What did SVC 0x74 in the ARM11 kernel do before it got stubbed? ===&lt;br /&gt;
=== What is the PTM abbreviation? ===&lt;br /&gt;
: Power/time management&lt;br /&gt;
&lt;br /&gt;
=== Why is the DTCM not used anywhere except bootrom? ===&lt;br /&gt;
&#039;&#039;&#039;Background:&#039;&#039;&#039; Bootrom is known to use part of DTCM as state, memsetting it to 0 when it&#039;s done. After that, it is never used again.&lt;br /&gt;
=== How is CTRAging launched during factory setup? ===&lt;br /&gt;
&#039;&#039;&#039;Background:&#039;&#039;&#039; No TestMenu version is capable of launching CTRAging directly: O3DS factory TestMenu can only launch DevMenu installed on NAND, the inserted cartridge and the TWL/AGB test apps; N3DS factory TestMenu can only launch DevMenu installed on NAND, the inserted cartridge and System Settings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Theory:&#039;&#039;&#039; NtrBoot another time &lt;br /&gt;
=== Why are there 4 stubbed syscalls named SendSyncRequest1-4? ===&lt;br /&gt;
=== Is there a deterministic formula for calculating the Movable.sed KeyY high u64? ===&lt;br /&gt;
&#039;&#039;&#039;Background:&#039;&#039;&#039; We know now that the high 4 bytes of KeyY can be reliably estimated to be 1/5th of the LocalFriendCodeSeed (low 8 bytes of KeyY), which is close enough to brute force. However, the actual value is usually about 0-4000 units off the actual high u32 of the KeyY (called msed3 in the seedminer implementation). Could there possibly be a deterministic formula given this 1/5 ratio is so close to the correct value? It&#039;s difficult to imagine this is just a coincidence.&lt;/div&gt;</summary>
		<author><name>Qyriad</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=NCCH&amp;diff=20611</id>
		<title>NCCH</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=NCCH&amp;diff=20611"/>
		<updated>2018-02-21T21:55:56Z</updated>

		<summary type="html">&lt;p&gt;Qyriad: Clarify what NCCH stands for&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:File formats]]&lt;br /&gt;
The following text tries to document the structure of the NCCH (Nintendo Content Container Header) container format. This format is used to store the content of any installed [[Titles|title]].&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
There are two known NCCH container specializations used on the 3DS, &amp;quot;executable&amp;quot; and &amp;quot;non-executable&amp;quot;, officially known as CXI and CFA, respectively.&lt;br /&gt;
&lt;br /&gt;
=== CXI ===&lt;br /&gt;
&lt;br /&gt;
The CXI (CTR Executable Image) specialization of the NCCH container contains executable code, which runs on a single ARM11 core.&lt;br /&gt;
&lt;br /&gt;
The CXI format is structured in the following order:&lt;br /&gt;
* first a NCCH header,&lt;br /&gt;
* followed by an [[NCCH/Extended Header|extended header]],&lt;br /&gt;
* followed by an access descriptor,&lt;br /&gt;
* followed by an &#039;&#039;&#039;optional&#039;&#039;&#039; plain binary region,&lt;br /&gt;
* followed by an &#039;&#039;&#039;optional&#039;&#039;&#039; executable filesystem ([[ExeFS]]) - (contains ARM11 code, Home menu [[SMDH|icn]]/bnr and [[Logo|logo]]),&lt;br /&gt;
* and finally followed by an &#039;&#039;&#039;optional&#039;&#039;&#039; read-only filesystem ([[RomFS]]) - (Used for external file storage).&lt;br /&gt;
&lt;br /&gt;
The extended header contains additional information regarding access control. &lt;br /&gt;
The plain binary region is an area specifically stored in plaintext, mostly containing SDK library strings for identification.&lt;br /&gt;
&lt;br /&gt;
=== CFA ===&lt;br /&gt;
&lt;br /&gt;
The CFA (CTR File Archive) specialization of the NCCH container is not executable, but is used in conjunction with CXI files, e.g. the DLP Child Container and the Electronic Manual. (There is a system update NCCH which follows this format, but is used by the 3DS rather than the Application NCCH, and only works when embedded in the [[CCI]] format because the nVer is kept in the header of retail [[CCI]] files instead of the application NCCH). There are CFA files which exist alone in a title, but these are just [[Title list|System Data Archive]] titles and are found only in the [[Flash Filesystem#CTR partition|NAND]].&lt;br /&gt;
&lt;br /&gt;
CFA files are structured in the following order:&lt;br /&gt;
* first a NCCH header,&lt;br /&gt;
* followed by an &#039;&#039;&#039;optional&#039;&#039;&#039; executable filesystem ([[ExeFS]]) (same as in CXI, except no ARM11 code)&lt;br /&gt;
* followed by an &#039;&#039;&#039;optional&#039;&#039;&#039; read-only filesystem ([[RomFS]])&lt;br /&gt;
&lt;br /&gt;
== Container File Format ==&lt;br /&gt;
&lt;br /&gt;
=== Encryption ===&lt;br /&gt;
The extended header, the [[ExeFS]], and the [[RomFS]] are encrypted using [https://github.com/3dshax/ctr/blob/master/ctrtool/ncch.c 128-bit AES CTR] unless the NoCrypto flag is set in ncchflag[7]. There are different sets of encryption parameters in use, as over the time new system updates introduced more sophisticated means of encryption. Generally, the decryption key is generated using the [[AES|AES Engine]] key generator by selecting a particular key slot (see below), the keyX of which is usually set by the bootrom and keyY of which was originally set to the first 0x10 bytes of the NCCH signature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: For a full understanding of the steps involved in decryption, consult the [https://github.com/Relys/Project_CTR ctrtool] and [https://github.com/archshift/Decrypt9 Decrypt9] source code instead.&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Starting with [[9.6.0-24|9.6.0-X]] Process9, there is a different method of generating the NCCH keyY which is enabled by setting the bitmask 0x20 in ncchflag[7]: The keyY will be set to a SHA256 hash generated with the 0x20 bytes of data constituted by the old-method-keyY and a unique content lock seed (each of which are 0x10 bytes wide), where seeds for downloaded titles that use the new crypto are stored in [[Filesystem_services#SEEDDB|SEEDDB]] (nand:/data/&amp;lt;console-unique&amp;gt;/sysdata/0001000f/00000000). The decryption is transparent to ARM11 userland: When FSUSER OpenFile is used with a NCCH archive which uses this crypto, the FS-module will add the seed-data from SEEDDB to the end of the file lowpath used for [[FSPXI:OpenFile]], using which Process9 then gets the hash for calculating the NCCH keyY. It has been observed that this new keyY generation is only used for [[RomFS]] and for [[ExeFS]] sections other than &amp;quot;icon&amp;quot; and &amp;quot;banner&amp;quot; (the same sections which would be used for the additional NCCH keyslots, however this keyY generation can be used without any additional NCCH keyslot). Not applying the encryption to &amp;quot;icon&amp;quot; and &amp;quot;banner&amp;quot; was presumably done to support pre-loading of games from the eShop (i.e. being able to download and install titles without being able to start them until official release).&lt;br /&gt;
&lt;br /&gt;
If a certain NCCH flag is set, a fixed AES key is used. There are two fixed keys, one for titles which have the system category bit set (SystemFixedKey), and one for the rest (&amp;quot;zeros&amp;quot; key). These are debug keys, as they aren&#039;t nomally supported on retail systems.&lt;br /&gt;
&lt;br /&gt;
As of [[7.0.0-13|7.0.0-X]] the system supports a new encryption method for secure-crypto (when ncchflag[3] != 0). Where a second key is generated using the same keyY but with another [[AES|keyslot]]. The second key is used to crypt the [[RomFS]] and [[ExeFS]] files which don&#039;t have filenames &amp;quot;icon&amp;quot; or &amp;quot;banner&amp;quot; (i.e. &amp;quot;.code&amp;quot; and &amp;quot;.firm&amp;quot;). While everything else is crypted with the original key. Note the CTR used is the same for both keys. This makes titles &amp;quot;recognizable&amp;quot; but not &amp;quot;launchable&amp;quot; on systems which don&#039;t support this method or the keyslot used.&lt;br /&gt;
&lt;br /&gt;
See below for the secondary keyslots used in NCCH crypto(as mentioned above). As of [[9.6.0-24|9.6.0-X]], Old3DS Process9 will *only* use secondary-keyslot 0x25 when ncchflag[3] is non-zero.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  ncchflag[3]&lt;br /&gt;
!  FW Introduced&lt;br /&gt;
!  Old3DS&lt;br /&gt;
!  [[AES#Keyslot|AES Keyslots]]&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  0x01&lt;br /&gt;
|  [[7.0.0-13|7.0.0-X]]&lt;br /&gt;
|  style=&amp;quot;background: #ccffbb&amp;quot; | Yes&lt;br /&gt;
|  0x25&lt;br /&gt;
|  This keyslot is [[Savegames|initialized]] by the 6.0 gamecard savegame keyY init function during boot, using a different portion of the [[Savegames|final]] hash (this keyslot is separate from the one used for the 6.0 save crypto).&lt;br /&gt;
|-&lt;br /&gt;
|  0x0A&lt;br /&gt;
|  [[9.3.0-21|9.3.0-X]]&lt;br /&gt;
|  style=&amp;quot;background: #ffccbb&amp;quot; | No&lt;br /&gt;
|  0x18&lt;br /&gt;
|  This keyslot is initialized by [[FIRM#New_3DS_FIRM|arm9loader]] on New3DS starting with [[8.1.0-0_New3DS]], but only [[9.3.0-21|9.3.0-X]] and later know how to use it with ncchflag[3].&lt;br /&gt;
|-&lt;br /&gt;
|  0x0B&lt;br /&gt;
|  [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
|  style=&amp;quot;background: #ffccbb&amp;quot; | No&lt;br /&gt;
|  0x1B&lt;br /&gt;
|  [[9.6.0-24|9.6.0-X]]&#039;s [[FIRM#New_3DS_FIRM|arm9loader]] changed the contents of keyslots 0x19-0x1F; 9.6.0-X was the first time they were officially used, so this is not a breaking change (there is no content that would use the old versions of those keys).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&lt;br /&gt;
Currently, only [[ExeFS]]:/.code can be compressed (with a LZ77 variant). A flag in the [[NCCH/Extended Header#System Info|exheader]] determines if this is the case.&lt;br /&gt;
&lt;br /&gt;
On retail for SD applications, exheader_systeminfoflags.flag bit1 must be set.&lt;br /&gt;
&lt;br /&gt;
Retail CFAs use the default NCCH product code &amp;quot;CTR-P-CTAP&amp;quot;, while retail title/gamecard CXIs use NCCH product code &amp;quot;CTR-X-XXXX&amp;quot;. This product code is the NCCH [[Serials|serial code]]. The region-locking info checked by home menu is stored in the [[SMDH#BNR Region|icon]].&lt;br /&gt;
&lt;br /&gt;
All of the hashes stored in this NCCH header are over the cleartext data. The ExeFS/RomFS superblock starts at offset 0x0 in the ExeFS/RomFS, and the size is specified by the hash region fields. Nintendo&#039;s NCCH validation code seems to have the size of this region fixed to 0x200 bytes (for ExeFS at least). &lt;br /&gt;
&lt;br /&gt;
As of [[5.0.0-11]] the application [[ExeFS]]:/logo can be loaded from the plaintext region between the access descriptor and the plain region, all applications built since [[5.0.0-11]] store the logo here. The size of this logo is always 0x2000-bytes.&lt;br /&gt;
&lt;br /&gt;
The plain region mainly contains tags for each SDK library used when building the CXI. The version used for the &amp;quot;FIRMWARE&amp;quot; tag is the kernel/FIRM [[Configuration_Memory|version]], this version can also be stored in the exheader &amp;quot;kernel release version&amp;quot; ARM11 kernel descriptor field. As of [[2.2.0-X]] the NATIVE_FIRM kernels check the CXI exheader &amp;quot;kernel release version&amp;quot; field, if it is stored in the CXI exheader. If the kernel/FIRM version specified by this field is higher than the version of the running NATIVE_FIRM, the kernel will return error-code 0xD9001413.&lt;br /&gt;
&lt;br /&gt;
=== NCCH Header ===&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;
|  0x000&lt;br /&gt;
|  0x100&lt;br /&gt;
|  RSA-2048 signature of the NCCH header, using SHA-256.&lt;br /&gt;
|-&lt;br /&gt;
|  0x100&lt;br /&gt;
|  4&lt;br /&gt;
|  Magic ID, always &#039;NCCH&#039;&lt;br /&gt;
|-&lt;br /&gt;
|  0x104&lt;br /&gt;
|  4&lt;br /&gt;
|  Content size, in media units (1 media unit = 0x200 bytes)&lt;br /&gt;
|-&lt;br /&gt;
|  0x108&lt;br /&gt;
|  8&lt;br /&gt;
|  Partition ID&lt;br /&gt;
|-&lt;br /&gt;
|  0x110&lt;br /&gt;
|  2&lt;br /&gt;
|  Maker code&lt;br /&gt;
|-&lt;br /&gt;
|  0x112&lt;br /&gt;
|  2&lt;br /&gt;
|  Version&lt;br /&gt;
|-&lt;br /&gt;
|  0x114&lt;br /&gt;
|  4&lt;br /&gt;
|  When ncchflag[7] = 0x20 starting with FIRM [[9.6.0-24|9.6.0-X]], this is compared with the first output u32 from a SHA256 hash. The data used for that hash is 0x18-bytes: &amp;lt;0x10-long title-unique content lock seed&amp;gt; &amp;lt;programID from NCCH+0x118&amp;gt;. This hash is only used for verification of the content lock seed, and is not the actual keyY.&lt;br /&gt;
|-&lt;br /&gt;
|  0x118&lt;br /&gt;
|  8&lt;br /&gt;
|  Program ID&lt;br /&gt;
|-&lt;br /&gt;
|  0x120&lt;br /&gt;
|  0x10&lt;br /&gt;
|  Reserved&lt;br /&gt;
|-&lt;br /&gt;
|  0x130&lt;br /&gt;
|  0x20&lt;br /&gt;
|  Logo Region SHA-256 hash. (For applications built with SDK 5+) (Supported from firmware: [[5.0.0-11]])&lt;br /&gt;
|-&lt;br /&gt;
|  0x150&lt;br /&gt;
|  0x10&lt;br /&gt;
|  Product code&lt;br /&gt;
|-&lt;br /&gt;
|  0x160&lt;br /&gt;
|  0x20&lt;br /&gt;
|  Extended header SHA-256 hash (SHA256 of 2x Alignment Size, beginning at 0x0 of ExHeader)&lt;br /&gt;
|-&lt;br /&gt;
|  0x180&lt;br /&gt;
|  4&lt;br /&gt;
|  Extended header size, in bytes&lt;br /&gt;
|-&lt;br /&gt;
|  0x184&lt;br /&gt;
|  4&lt;br /&gt;
|  Reserved&lt;br /&gt;
|-&lt;br /&gt;
|  0x188&lt;br /&gt;
|  8&lt;br /&gt;
|  Flags (See Below)&lt;br /&gt;
|-&lt;br /&gt;
|  0x190&lt;br /&gt;
|  4&lt;br /&gt;
|  Plain region offset, in media units&lt;br /&gt;
|-&lt;br /&gt;
|  0x194&lt;br /&gt;
|  4&lt;br /&gt;
|  Plain region size, in media units&lt;br /&gt;
|-&lt;br /&gt;
|  0x198&lt;br /&gt;
|  4&lt;br /&gt;
|  Logo Region offset, in media units (For applications built with SDK 5+) (Supported from firmware: [[5.0.0-11]])&lt;br /&gt;
|-&lt;br /&gt;
|  0x19c&lt;br /&gt;
|  4&lt;br /&gt;
|  Logo Region size, in media units (For applications built with SDK 5+) (Supported from firmware: [[5.0.0-11]])&lt;br /&gt;
|-&lt;br /&gt;
|  0x1A0&lt;br /&gt;
|  4&lt;br /&gt;
|  ExeFS offset, in media units&lt;br /&gt;
|-&lt;br /&gt;
|  0x1A4&lt;br /&gt;
|  4&lt;br /&gt;
|  ExeFS size, in media units&lt;br /&gt;
|-&lt;br /&gt;
|  0x1A8&lt;br /&gt;
|  4&lt;br /&gt;
|  ExeFS hash region size, in media units&lt;br /&gt;
|-&lt;br /&gt;
|  0x1AC&lt;br /&gt;
|  4&lt;br /&gt;
|  Reserved&lt;br /&gt;
|-&lt;br /&gt;
|  0x1B0&lt;br /&gt;
|  4&lt;br /&gt;
|  RomFS offset, in media units&lt;br /&gt;
|-&lt;br /&gt;
|  0x1B4&lt;br /&gt;
|  4&lt;br /&gt;
|  RomFS size, in media units&lt;br /&gt;
|-&lt;br /&gt;
|  0x1B8&lt;br /&gt;
|  4&lt;br /&gt;
|  RomFS hash region size, in media units&lt;br /&gt;
|-&lt;br /&gt;
|  0x1BC&lt;br /&gt;
|  4&lt;br /&gt;
|  Reserved&lt;br /&gt;
|-&lt;br /&gt;
|  0x1C0&lt;br /&gt;
|  0x20&lt;br /&gt;
|  ExeFS superblock SHA-256 hash - (SHA-256 hash, starting at 0x0 of the ExeFS over the number of media units specified in the ExeFS hash region size)&lt;br /&gt;
|-&lt;br /&gt;
|  0x1E0&lt;br /&gt;
|  0x20&lt;br /&gt;
|  RomFS superblock SHA-256 hash - (SHA-256 hash, starting at 0x0 of the RomFS over the number of media units specified in the RomFS hash region size)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Given offsets are based on the start of the file.&lt;br /&gt;
&lt;br /&gt;
=== NCCH Flags ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  INDEX&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  3&lt;br /&gt;
|  Crypto Method: When this is non-zero, a NCCH crypto method using two keyslots is used(see above).&lt;br /&gt;
|-&lt;br /&gt;
|  4&lt;br /&gt;
|  Content Platform: 1 = CTR, 2 = snake (New 3DS).&lt;br /&gt;
|-&lt;br /&gt;
|  5&lt;br /&gt;
|  Content Type Bit-masks: Data = 0x1, Executable = 0x2, SystemUpdate = 0x4, Manual = 0x8, Child = (0x4&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;0x8), Trial = 0x10. When &#039;Data&#039; is set, but not &#039;Executable&#039;, NCCH is a CFA. Otherwise when &#039;Executable&#039; is set, NCCH is a CXI.&lt;br /&gt;
|-&lt;br /&gt;
|  6&lt;br /&gt;
|  Content Unit Size i.e. u32 ContentUnitSize = 0x200*2^flags[6]; &lt;br /&gt;
|-&lt;br /&gt;
|  7&lt;br /&gt;
|  Bit-masks: FixedCryptoKey = 0x1, NoMountRomFs = 0x2, NoCrypto = 0x4, using a new keyY generator = 0x20(starting with FIRM [[9.6.0-24|9.6.0-X]]).&lt;br /&gt;
|}&lt;br /&gt;
CXIs NCCH header signature is verified using the RSA public key stored in the accessdesc,(which follows the exheader) while CFAs NCCH header is verified with a fixed RSA public key.&lt;br /&gt;
&lt;br /&gt;
==== NCCH header example for Lego Starwars III ====&lt;br /&gt;
 Signature:              720FF8F83F2A1E998322A026D1434165&lt;br /&gt;
                         ED19642ABC1CB2722135AA202BEAD60A&lt;br /&gt;
                         80BCD21C768C597B8268FEF2C64EA710&lt;br /&gt;
                         4C9BA5E12CFFBD1D0C619F4EF7B42CA7&lt;br /&gt;
                         DD8482CB4EB26720AD66CDA57ABCBCFB&lt;br /&gt;
                         D63268A6E2896A59B3B744E39E45B88A&lt;br /&gt;
                         ABB4C0980ACC6210818DCE6DAC838A10&lt;br /&gt;
                         95D0F66B352474D4B3DA4B333F49912D&lt;br /&gt;
                         29AF7EA58BC8C890B18C70B7D540A9FB&lt;br /&gt;
                         EBE24A5312055617D3353B28C3EB1D17&lt;br /&gt;
                         61021BEFF6AD22C384835B40BD44DFAD&lt;br /&gt;
                         981F6350F9458B17BCB5F768C92ABC93&lt;br /&gt;
                         2BCE9888855A8998F4CDE40C9543514A&lt;br /&gt;
                         C57B84EB75A680E7C742632614620D1D&lt;br /&gt;
                         A253284DF3DC01091EB3800C36FD62EE&lt;br /&gt;
                         BA15340F1FD498FAB67C0302E9CDA397&lt;br /&gt;
 Magic:                  NCCH&lt;br /&gt;
 Content size:           0x1cfef400&lt;br /&gt;
 Partition id:           0004000000038c00&lt;br /&gt;
 Maker code:             3436 (&amp;quot;46&amp;quot;)&lt;br /&gt;
 Version:                0002&lt;br /&gt;
 Program id:             0004000000038c00&lt;br /&gt;
 Temp flag:              00&lt;br /&gt;
 Product code:           CTR-P-ALGP&lt;br /&gt;
 Extended header hash:   0C27E3C1DE7B2AE2D3114F32A4EEBF46&lt;br /&gt;
                         9AFD0CF352C11D4984C2A9F1D2144C63&lt;br /&gt;
 Extended header size:   00000400&lt;br /&gt;
 Flags:                  0000030100000000&lt;br /&gt;
 Plain region offset:    0x00004a00&lt;br /&gt;
 Plain region size:      0x00000200&lt;br /&gt;
 ExeFS offset:           0x00004c00&lt;br /&gt;
 ExeFS size:             0x00143800&lt;br /&gt;
 ExeFS hash region size: 0x00000200&lt;br /&gt;
 RomFS offset:           0x00148400&lt;br /&gt;
 RomFS size:             0x1ceab000&lt;br /&gt;
 RomFS hash region size: 0x00000200&lt;br /&gt;
 ExeFS Superblock Hash:  130C042615F647C4C63225EA9E67F8A2&lt;br /&gt;
                         7B15246B88FBC7A927257B84977B787B&lt;br /&gt;
 RomFS Superblock Hash:  A65BEE1060BB6A6821BBCEC600035B7E&lt;br /&gt;
                         64FB6EACA7F0960CFB1F5A37087728F7&lt;br /&gt;
 Note: Offsets and sizes in media units have been converted to byte sizes.&lt;br /&gt;
&lt;br /&gt;
==== Plain region example for Lego Starwars III ====&lt;br /&gt;
 0004a00: 5b 53 44 4b 2b 4e 49 4e 54 45 4e 44 4f 3a 43 54  [SDK+NINTENDO:CT    [SDK+NINTENDO:CTR_SDK-0_14_23_200_none]&lt;br /&gt;
 0004a10: 52 5f 53 44 4b 2d 30 5f 31 34 5f 32 33 5f 32 30  R_SDK-0_14_23_20&lt;br /&gt;
 0004a20: 30 5f 6e 6f 6e 65 5d 00 5b 53 44 4b 2b 4e 49 4e  0_none].[SDK+NIN    [SDK+NINTENDO:Firmware-02_27]&lt;br /&gt;
 0004a30: 54 45 4e 44 4f 3a 46 69 72 6d 77 61 72 65 2d 30  TENDO:Firmware-0&lt;br /&gt;
 0004a40: 32 5f 32 37 5d 00 5b 53 44 4b 2b 4d 6f 62 69 63  2_27].[SDK+Mobic    [SDK+Mobiclip:Deblocker_1_0_2]&lt;br /&gt;
 0004a50: 6c 69 70 3a 44 65 62 6c 6f 63 6b 65 72 5f 31 5f  lip:Deblocker_1_&lt;br /&gt;
 0004a60: 30 5f 32 5d 00 5b 53 44 4b 2b 4d 6f 62 69 63 6c  0_2].[SDK+Mobicl    [SDK+Mobiclip:ImaAdpcmDec_1_0_0]&lt;br /&gt;
 0004a70: 69 70 3a 49 6d 61 41 64 70 63 6d 44 65 63 5f 31  ip:ImaAdpcmDec_1&lt;br /&gt;
 0004a80: 5f 30 5f 30 5d 00 5b 53 44 4b 2b 4d 6f 62 69 63  _0_0].[SDK+Mobic    [SDK+Mobiclip:MobiclipDec_1_0_1]&lt;br /&gt;
 0004a90: 6c 69 70 3a 4d 6f 62 69 63 6c 69 70 44 65 63 5f  lip:MobiclipDec_&lt;br /&gt;
 0004aa0: 31 5f 30 5f 31 5d 00 5b 53 44 4b 2b 4d 6f 62 69  1_0_1].[SDK+Mobi    [SDK+Mobiclip:MoflexDemuxer_1_0_2]&lt;br /&gt;
 0004ab0: 63 6c 69 70 3a 4d 6f 66 6c 65 78 44 65 6d 75 78  clip:MoflexDemux&lt;br /&gt;
 0004ac0: 65 72 5f 31 5f 30 5f 32 5d 00 00 00 00 00 00 00  er_1_0_2].......&lt;br /&gt;
 0004ad0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................&lt;br /&gt;
 0004ae0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................&lt;br /&gt;
&lt;br /&gt;
==== Example dependency list from the extended header ====&lt;br /&gt;
 00850 41 50 54 3A 55 00 00 00 24 68 69 6F 46 49 4F 00 APT:U...$hioFIO.&lt;br /&gt;
 00860 24 68 6F 73 74 69 6F 30 24 68 6F 73 74 69 6F 31 $hostio0$hostio1&lt;br /&gt;
 00870 61 63 3A 75 00 00 00 00 62 6F 73 73 3A 55 00 00 ac:u....boss:U..&lt;br /&gt;
 00880 63 61 6D 3A 75 00 00 00 63 65 63 64 3A 75 00 00 cam:u...cecd:u..&lt;br /&gt;
 00890 63 66 67 3A 75 00 00 00 64 6C 70 3A 46 4B 43 4C cfg:u...dlp:FKCL&lt;br /&gt;
 008A0 64 6C 70 3A 53 52 56 52 64 73 70 3A 3A 44 53 50 dlp:SRVRdsp::DSP&lt;br /&gt;
 008B0 66 72 64 3A 75 00 00 00 66 73 3A 55 53 45 52 00 frd:u...fs:USER.&lt;br /&gt;
 008C0 67 73 70 3A 3A 47 70 75 68 69 64 3A 55 53 45 52 gsp::Gpuhid:USER&lt;br /&gt;
 008D0 68 74 74 70 3A 43 00 00 6D 69 63 3A 75 00 00 00 http:C..mic:u...&lt;br /&gt;
 008E0 6E 64 6D 3A 75 00 00 00 6E 65 77 73 3A 75 00 00 ndm:u...&amp;lt;nowiki&amp;gt;news:u..&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 008F0 6E 77 6D 3A 3A 55 44 53 70 74 6D 3A 75 00 00 00 nwm::UDSptm:u...&lt;br /&gt;
 00900 70 78 69 3A 64 65 76 00 73 6F 63 3A 55 00 00 00 pxi:dev.soc:U...&lt;br /&gt;
 00910 73 73 6C 3A 43 00 00 00 79 32 72 3A 75 00 00 00 ssl:C...y2r:u...&lt;br /&gt;
 00920 69 72 3A 55 53 45 52 00 6C 64 72 3A 72 6F 00 00 ir:USER.ldr:ro..&lt;br /&gt;
 00930 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................&lt;br /&gt;
 00940 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................&lt;br /&gt;
 00950 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................&lt;br /&gt;
 00960 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................&lt;br /&gt;
 ... ...&lt;br /&gt;
 009D0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF                 &lt;br /&gt;
 009E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................&lt;br /&gt;
 009F0 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 02 . .............&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/profi200/Project_CTR/tree/master/ctrtool ctrtool] - (CMD)(Windows/Linux) Parsing and decrypting (debug only) NCCH files&lt;/div&gt;</summary>
		<author><name>Qyriad</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=GPU/External_Registers&amp;diff=20565</id>
		<title>GPU/External Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=GPU/External_Registers&amp;diff=20565"/>
		<updated>2018-01-12T06:49:09Z</updated>

		<summary type="html">&lt;p&gt;Qyriad: /* Map */ Clarify address mappings&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the address range accessible from the ARM11, used to configure the basic GPU functionality. For information about the internal registers used for 3D rendering, see [[GPU/Internal Registers]].&lt;br /&gt;
&lt;br /&gt;
== Map ==&lt;br /&gt;
Address mappings for the external registers. GSPGPU:WriteHWRegs takes these addresses relative to 0x1EB00000. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! User VA&lt;br /&gt;
! PA&lt;br /&gt;
! Length&lt;br /&gt;
! Name&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00004&lt;br /&gt;
| 0x10400004&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00010&lt;br /&gt;
| 0x10400010&lt;br /&gt;
| 16&lt;br /&gt;
| [[#Memory Fill|Memory Fill1]] &amp;quot;PSC0&amp;quot;&lt;br /&gt;
| GX command 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00020&lt;br /&gt;
| 0x10400020&lt;br /&gt;
| 16&lt;br /&gt;
| [[#Memory Fill|Memory Fill2]] &amp;quot;PSC1&amp;quot;&lt;br /&gt;
| GX command 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00030&lt;br /&gt;
| 0x10400030&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00034&lt;br /&gt;
| 0x10400034&lt;br /&gt;
| 4&lt;br /&gt;
| GPU Busy&lt;br /&gt;
| Bit31 = cmd-list busy, bit27 = PSC0 busy, bit26 = PSC1 busy.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00050&lt;br /&gt;
| 0x10400050&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
| Writes 0x22221200 on GPU init.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00054&lt;br /&gt;
| 0x10400054&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
| Writes 0xFF2 on GPU init.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF000C0&lt;br /&gt;
| 0x104000C0&lt;br /&gt;
| 4&lt;br /&gt;
| Backlight control&lt;br /&gt;
| Writes 0x0 to allow backlights to turn off, 0x20000000 to force them always on.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00400&lt;br /&gt;
| 0x10400400&lt;br /&gt;
| 0x100&lt;br /&gt;
| [[#LCD Source Framebuffer Setup|Framebuffer Setup]] &amp;quot;PDC0&amp;quot; (top screen)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00500&lt;br /&gt;
| 0x10400500&lt;br /&gt;
| 0x100&lt;br /&gt;
| [[#LCD Source Framebuffer Setup|Framebuffer Setup]] &amp;quot;PDC1&amp;quot; (bottom)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00C00&lt;br /&gt;
| 0x10400C00&lt;br /&gt;
| ?&lt;br /&gt;
| [[#Transfer_Engine|Transfer Engine]] &amp;quot;DMA&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF01000&lt;br /&gt;
| 0x10401000&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
| Writes 0 on GPU init and before the Command List is used&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF01080&lt;br /&gt;
| 0x10401080&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
| Writes 0x12345678 on GPU init.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF010C0&lt;br /&gt;
| 0x104010C0&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
| Writes 0xFFFFFFF0 on GPU init.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF010D0&lt;br /&gt;
| 0x104010D0&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
| Writes 1 on GPU init.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF014??&lt;br /&gt;
| 0x104014??&lt;br /&gt;
| 0x14&lt;br /&gt;
| &amp;quot;PPF&amp;quot; ?&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF018E0&lt;br /&gt;
| 0x104018E0&lt;br /&gt;
| 0x14&lt;br /&gt;
| [[#Command_List|Command List]] &amp;quot;P3D&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Memory Fill ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  User VA&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF000X0&lt;br /&gt;
| Buffer start physaddr &amp;gt;&amp;gt; 3&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF000X4&lt;br /&gt;
| Buffer end physaddr &amp;gt;&amp;gt; 3&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF000X8&lt;br /&gt;
| Fill value&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF000XC&lt;br /&gt;
| Control. bit0: start/busy, bit1: finished, bit8-9: fill-width (0=16bit, 1=3=24bit, 2=32bit)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Memory fills are used to initialize buffers in memory with a given value, similar to memset. A memory fill is triggered by setting bit0 in the control register. Doing so aborts any running memory fills on that filling unit. Upon completion, the hardware unsets bit0 and sets bit1 and fires interrupt PSC0.&lt;br /&gt;
&lt;br /&gt;
These registers are used by [[GSP Shared Memory#GX SetMemoryFill|GX SetMemoryFill]].&lt;br /&gt;
&lt;br /&gt;
== LCD Source Framebuffer Setup ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Name&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4&lt;br /&gt;
| Pixel timer (not pixel clock)&lt;br /&gt;
| Higher values are slower, min. 0x1C1, bitmask 0xFFF&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4&lt;br /&gt;
| HDispStart(?)&lt;br /&gt;
| Values 0xD1-0x1C1 inclusive are valid (except 2DS bottom screen)&lt;br /&gt;
min. 0xD1, bitmask 0xFFF&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
| must be &amp;gt;= REG#0x00&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
| must be &amp;gt;= REG#0x08&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 4&lt;br /&gt;
| VAdjustGranule(?) or VBackPorch(?)&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
VAdjust(2DS bottom screen)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Seems to offset pixels relative to someting&lt;br /&gt;
&lt;br /&gt;
(last row of pixels blitted increases by this amount;&lt;br /&gt;
&lt;br /&gt;
setting this to lower than 2 will kill the screen timing)&lt;br /&gt;
| Finetune vertical pixel offset(blur screen), 0x1C2 max = half pixel&lt;br /&gt;
&lt;br /&gt;
or (2DS)&lt;br /&gt;
offset the bottom screen (0 to kill top screen, 0x1C2 max on bottom screen)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 4&lt;br /&gt;
| HStartMin(?) (poor 2DS emulation)&lt;br /&gt;
| if this value is bigger than some value then it&#039;ll trim the first (value - this value) pixels from every line&lt;br /&gt;
&lt;br /&gt;
default value is 0xCF&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 4&lt;br /&gt;
| ???&lt;br /&gt;
| should be &amp;lt; REG#0x10&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 4&lt;br /&gt;
| HFrontPorch(?)&lt;br /&gt;
| ??? the screen gets vertically offset with wrap-around&lt;br /&gt;
horizontal timing gets messed up&lt;br /&gt;
|-&lt;br /&gt;
| 0x24&lt;br /&gt;
| 4&lt;br /&gt;
| HSync timer?&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x28&lt;br /&gt;
| 4&lt;br /&gt;
| VDispStart(?) or VFrontPorch&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 4&lt;br /&gt;
| VTotal&lt;br /&gt;
| Total amount of vertical scanlines&lt;br /&gt;
|-&lt;br /&gt;
| 0x34&lt;br /&gt;
| 4&lt;br /&gt;
| VDisp(?)&lt;br /&gt;
| Total amonut of vertical scanlines displayed (only for top screen it seems like)&lt;br /&gt;
|-&lt;br /&gt;
| 0x44&lt;br /&gt;
| 4&lt;br /&gt;
| ???&lt;br /&gt;
| similar functionality to 0x10&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C&lt;br /&gt;
| 4&lt;br /&gt;
| Overscan filler color&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x50&lt;br /&gt;
| 4&lt;br /&gt;
| Horizontal position counter&lt;br /&gt;
| read-only&lt;br /&gt;
|-&lt;br /&gt;
| 0x54&lt;br /&gt;
| 4&lt;br /&gt;
| Horizontal scanline (HBlank) counter&lt;br /&gt;
| read-only&lt;br /&gt;
|-&lt;br /&gt;
| 0x5C&lt;br /&gt;
| 4&lt;br /&gt;
| ???&lt;br /&gt;
| low u16: framebuffer width&lt;br /&gt;
high u16: framebuffer height??? (seems to be unused)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60&lt;br /&gt;
| 4&lt;br /&gt;
| ???&lt;br /&gt;
| low u16: timing data(?)&lt;br /&gt;
high u16: framebuffer total width (amount of pixels blitted regardless of framebuffer width)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64&lt;br /&gt;
| 4&lt;br /&gt;
| ???&lt;br /&gt;
| low u16: unknown&lt;br /&gt;
high u16: framebuffer total height (amount of scanlines blitted regardless of framebuffer height)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68&lt;br /&gt;
| 4&lt;br /&gt;
| Framebuffer A first address&lt;br /&gt;
| For top screen, this is the left eye 3D framebuffer.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C&lt;br /&gt;
| 4&lt;br /&gt;
| Framebuffer A second address&lt;br /&gt;
| For top screen, this is the left eye 3D framebuffer.&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| 4&lt;br /&gt;
| Framebuffer format&lt;br /&gt;
| Bit0-15: framebuffer format, bit16-31: unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| 4&lt;br /&gt;
| Framebuffer select&lt;br /&gt;
| Bit0: which framebuffer to display, bit1-7: unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| 4&lt;br /&gt;
| Color lookup table index select&lt;br /&gt;
| 8bits, write-only&lt;br /&gt;
|-&lt;br /&gt;
| 0x84&lt;br /&gt;
| 4&lt;br /&gt;
| Color lookup table indexed element&lt;br /&gt;
| Contains the value of the color lookup table indexed by the above register, 24bits, RGB8 (0x00BBGGRR)  &lt;br /&gt;
Accessing this register will increase the index register by one&lt;br /&gt;
|-&lt;br /&gt;
| 0x90&lt;br /&gt;
| 4&lt;br /&gt;
| Framebuffer stride&lt;br /&gt;
| Distance in bytes between the start of two framebuffer rows (must be a multiple of 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x94&lt;br /&gt;
| 4&lt;br /&gt;
| Framebuffer B first address&lt;br /&gt;
| For top screen, this is the right eye 3D framebuffer. Unused for bottom screen.&lt;br /&gt;
|-&lt;br /&gt;
| 0x98&lt;br /&gt;
| 4&lt;br /&gt;
| Framebuffer B second address&lt;br /&gt;
| For top screen, this is the right eye 3D framebuffer. Unused for bottom screen.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Framebuffer format ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 2-0&lt;br /&gt;
| Color format&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Unused?&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Enable parallax barrier (i.e. 3D).&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 1 = main screen, 0 = sub screen. However if bit5 is set, this bit is cleared.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 9-8&lt;br /&gt;
| Value 1 = unknown: get rid of rainbow strip on top of screen, 3 = unknown: black screen.&lt;br /&gt;
|-&lt;br /&gt;
| 15-10&lt;br /&gt;
| Unused?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
GSP module only allows the LCD stereoscopy to be enabled when bit5=1 and bit6=0 here. When GSP module updates this register, GSP module will automatically disable the stereoscopy if those bits are not set for enabling stereoscopy.&lt;br /&gt;
&lt;br /&gt;
=== Framebuffer color formats ===&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&lt;br /&gt;
| GL_RGBA8_OES&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| GL_RGB8_OES&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| GL_RGB565_OES&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| GL_RGB5_A1_OES&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| GL_RGBA4_OES&lt;br /&gt;
|}&lt;br /&gt;
Color components are laid out in reverse byte order, with the most significant bits used first (i.e. non-24-bit pixels are stored as a little-endian values). For instance, a raw data stream of two GL_RGB565_OES pixels looks like GGGBBBBB RRRRRGGG GGGBBBBB RRRRRGGG.&lt;br /&gt;
&lt;br /&gt;
== Transfer Engine ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Register address&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00C00&lt;br /&gt;
| Input physical address &amp;gt;&amp;gt; 3&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00C04&lt;br /&gt;
| Output physical address &amp;gt;&amp;gt; 3&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00C08&lt;br /&gt;
| DisplayTransfer output width (bits 0-15) and height (bits 16-31).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00C0C&lt;br /&gt;
| DisplayTransfer input width and height.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00C10&lt;br /&gt;
| Transfer flags. (See below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00C14&lt;br /&gt;
| GSP module writes value 0 here prior to writing to 0x1EF00C18, for cmd3.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00C18&lt;br /&gt;
|  Setting bit0 starts the transfer. Upon completion, bit0 is unset and bit8 is set.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00C1C&lt;br /&gt;
|  ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00C20&lt;br /&gt;
| TextureCopy total amount of data to copy, in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00C24&lt;br /&gt;
| TextureCopy input line width (bits 0-15) and gap (bits 16-31), in 16 byte units.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF00C28&lt;br /&gt;
| TextureCopy output line width and gap.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These registers are used by [[GSP_Shared_Memory|GX command]] 3 and 4. For cmd4, *0x1EF00C18 |= 1 is used instead of just writing value 1. The DisplayTransfer registers are only used if bit 3 of the flags is unset and ignored otherwise. The TextureCopy registers are likewise only used if bit 3 is set, and ignored otherwise.&lt;br /&gt;
&lt;br /&gt;
==== Flags Register - 0x1EF00C10 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| When set, the framebuffer data is flipped vertically.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| When set, the input framebuffer is treated as linear and converted to tiled in the output, converts tiled-&amp;gt;linear when unset.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| This bit is required when the output width is less than the input width for the hardware to properly crop the lines, otherwise the output will be mis-aligned.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Uses a TextureCopy mode transfer. See below for details.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Not writable&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Don&#039;t perform tiled-linear conversion. Incompatible with bit 1, so only tiled-tiled transfers can be done, not linear-linear.&lt;br /&gt;
|-&lt;br /&gt;
| 7-6&lt;br /&gt;
| Not writable&lt;br /&gt;
|-&lt;br /&gt;
| 10-8&lt;br /&gt;
| Input framebuffer color format, value0 and value1 are the same as the [[GPU Registers#Framebuffer_color_formats|LCD Source Framebuffer Formats]] (usually zero)&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Not writable&lt;br /&gt;
|-&lt;br /&gt;
| 14-12&lt;br /&gt;
| Output framebuffer color format&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| Not writable&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| Use 32x32 block tiling mode, instead of the usual 8x8 one. Output dimensions must be multiples of 32, even if cropping with bit 2 set above.&lt;br /&gt;
|-&lt;br /&gt;
| 17-23&lt;br /&gt;
| Not writable&lt;br /&gt;
|-&lt;br /&gt;
| 24-25&lt;br /&gt;
| Scale down the input image using a box filter. 0 = No downscale, 1 = 2x1 downscale. 2 = 2x2 downscale, 3 = invalid&lt;br /&gt;
|-&lt;br /&gt;
| 31-26&lt;br /&gt;
| Not writable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== TextureCopy ===&lt;br /&gt;
&lt;br /&gt;
When bit 3 of the control register is set, the hardware performs a TextureCopy-mode transfer. In this mode, all other bits of the control register (except for bit 2, which still needs to be set correctly) and the regular dimension registers are ignored, and no format conversions are done. Instead, it performs a raw data copy from the source to the destination, but with a configurable gap between lines. The total amount of bytes to copy is specified in the size register, and the hardware loops reading lines from the input and writing them to the output until this amount is copied. The &amp;quot;gap&amp;quot; specified in the input/output dimension register is the number of chunks to skip after each &amp;quot;width&amp;quot; chunks of the input/output, and is NOT counted towards the total size of the transfer.&lt;br /&gt;
&lt;br /&gt;
By correctly calculating the input and output gap sizes it is possible to use this functionality to copy arbitrary sub-rectangles between differently-sized framebuffers or textures, which is one of its main uses over a regular no-conversion DisplayTransfer. When copying tiled textures/framebuffers it&#039;s important to remember that the contents of a tile are laid out sequentially in memory, and so this should be taken into account when calculating the transfer parameters.&lt;br /&gt;
&lt;br /&gt;
Specifying invalid/junk values for the TextureCopy dimensions can result in the GPU hanging while attempting to process this TextureCopy.&lt;br /&gt;
&lt;br /&gt;
== Command List ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Register address&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF018E0&lt;br /&gt;
| Buffer size in bytes &amp;gt;&amp;gt; 3&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF018E8&lt;br /&gt;
| Buffer physical address &amp;gt;&amp;gt; 3&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EF018F0&lt;br /&gt;
| Setting bit0 to 1 enables processing GPU command execution. Upon completion, bit0 seems to be reset to 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These 3 registers are used by [[GSP_Shared_Memory|GX command]] 1. This is used for [[GPU/Internal_Registers|GPU commands]].&lt;br /&gt;
&lt;br /&gt;
== Framebuffers ==&lt;br /&gt;
These LCD framebuffers normally contain the last rendered frames from the GPU. The framebuffers are drawn from left-to-right, instead of top-to-bottom.(Thus the beginning of the framebuffer is drawn starting at the left side of the screen)&lt;br /&gt;
&lt;br /&gt;
Both of the 3D screen left/right framebuffers are displayed regardless of the 3D slider&#039;s state, however when the 3D slider is set to &amp;quot;off&amp;quot; the 3D effect is disabled. Normally when the 3D slider&#039;s state is set to &amp;quot;off&amp;quot; the left/right framebuffer addresses are set to the same physical address. When the 3D effect is disabled and the left/right framebuffers are set to separate addresses, the LCD seems to alternate between displaying the left/right framebuffer each frame.&lt;br /&gt;
&lt;br /&gt;
==== Init Values from nngxInitialize for Top Screen ====&lt;br /&gt;
* 0x1EF00400 = 0x1C2&lt;br /&gt;
* 0x1EF00404 = 0xD1&lt;br /&gt;
* 0x1EF00408 = 0x1C1&lt;br /&gt;
* 0x1EF0040C = 0x1C1&lt;br /&gt;
* 0x1EF00410 = 0&lt;br /&gt;
* 0x1EF00414 = 0xCF&lt;br /&gt;
* 0x1EF00418 = 0xD1&lt;br /&gt;
* 0x1EF0041C = 0x1C501C1&lt;br /&gt;
* 0x1EF00420 = 0x10000&lt;br /&gt;
* 0x1EF00424 = 0x19D&lt;br /&gt;
* 0x1EF00428 = 2&lt;br /&gt;
* 0x1EF0042C = 0x1C2&lt;br /&gt;
* 0x1EF00430 = 0x1C2&lt;br /&gt;
* 0x1EF00434 = 0x1C2&lt;br /&gt;
* 0x1EF00438 = 1&lt;br /&gt;
* 0x1EF0043C = 2&lt;br /&gt;
* 0x1EF00440 = 0x1960192&lt;br /&gt;
* 0x1EF00444 = 0&lt;br /&gt;
* 0x1EF00448 = 0&lt;br /&gt;
* 0x1EF0045C = 0x19000F0&lt;br /&gt;
* 0x1EF00460 = 0x1c100d1&lt;br /&gt;
* 0x1EF00464 = 0x1920002&lt;br /&gt;
* 0x1EF00470 = 0x80340&lt;br /&gt;
* 0x1EF0049C = 0&lt;br /&gt;
&lt;br /&gt;
==== More Init Values from nngxInitialize for Top Screen ====&lt;br /&gt;
* 0x1EF00468 = 0x18300000, later changed by GSP module when updating state, framebuffer&lt;br /&gt;
* 0x1EF0046C = 0x18300000, later changed by GSP module when updating state, framebuffer&lt;br /&gt;
* 0x1EF00494 = 0x18300000&lt;br /&gt;
* 0x1EF00498 = 0x18300000&lt;br /&gt;
* 0x1EF00478 = 1, doesn&#039;t stay 1, read as 0&lt;br /&gt;
* 0x1EF00474 = 0x10501&lt;br /&gt;
&lt;br /&gt;
[[Category:GPU]]&lt;/div&gt;</summary>
		<author><name>Qyriad</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SMDH&amp;diff=20093</id>
		<title>SMDH</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SMDH&amp;diff=20093"/>
		<updated>2017-06-19T13:35:39Z</updated>

		<summary type="html">&lt;p&gt;Qyriad: /* Icon graphics */ Notes that Nintendo stores pixel data in word-order&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the format of the icon stored at [[NCCH#CXI|CXI]] ExeFS:/icon and [[CIA]] icons.&lt;br /&gt;
The size of icons is 0x36c0 bytes. The CXI icon is displayed by [[Home Menu]] and [[System Settings]](3DS Software Management), while [[CIA#Meta|CIA icons]] are dummies and not yet utilised by Dev 3DS&#039; (as of rev 47586).&lt;br /&gt;
&lt;br /&gt;
== Format ==&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;
|  0x00&lt;br /&gt;
|  0x04 &lt;br /&gt;
|  Magic &#039;SMDH&#039;&lt;br /&gt;
|- &lt;br /&gt;
|  0x04&lt;br /&gt;
|  0x02 &lt;br /&gt;
|  Version&lt;br /&gt;
|- &lt;br /&gt;
|  0x06&lt;br /&gt;
|  0x02 &lt;br /&gt;
|  Reserved&lt;br /&gt;
|-&lt;br /&gt;
|  0x8&lt;br /&gt;
|  0x2000&lt;br /&gt;
|  16 application titles structs, each 0x200 bytes&lt;br /&gt;
|-&lt;br /&gt;
| 0x2008&lt;br /&gt;
| 0x30&lt;br /&gt;
| Application Settings&lt;br /&gt;
|-&lt;br /&gt;
| 0x2038&lt;br /&gt;
| 0x8&lt;br /&gt;
| Reserved &lt;br /&gt;
|-&lt;br /&gt;
| 0x2040&lt;br /&gt;
| 0x1680&lt;br /&gt;
| Icon graphics&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Application Titles ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  START&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x00&lt;br /&gt;
|  0x80&lt;br /&gt;
|  Short Description&lt;br /&gt;
|- &lt;br /&gt;
|  0x80&lt;br /&gt;
|  0x100 &lt;br /&gt;
|  Long Description&lt;br /&gt;
|- &lt;br /&gt;
|  0x180&lt;br /&gt;
|  0x80 &lt;br /&gt;
|  Publisher&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All encoded in UTF-16.&lt;br /&gt;
There are 16 app title structs(currently only 12 are used), each one for separate languages.&lt;br /&gt;
&lt;br /&gt;
The languages by order of appearance:&lt;br /&gt;
&lt;br /&gt;
* 1st: Japanese title name&lt;br /&gt;
* 2nd: English title name&lt;br /&gt;
* 3rd: French title name&lt;br /&gt;
* 4th: German title name&lt;br /&gt;
* 5th: Italian title name&lt;br /&gt;
* 6th: Spanish title name&lt;br /&gt;
* 7th: Simplified Chinese title name&lt;br /&gt;
* 8th: Korean title name&lt;br /&gt;
* 9th: Dutch title name&lt;br /&gt;
* 10th: Portuguese title name&lt;br /&gt;
* 11th: Russian title name&lt;br /&gt;
* 12th: Traditional Chinese title name&lt;br /&gt;
&lt;br /&gt;
== Application Settings ==&lt;br /&gt;
&lt;br /&gt;
Most of these flags are only used by the [[Home Menu]]. All of these are represented in SMDH files in little endian. But when documented below, the tables represent values in big endian.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  START&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x2008&lt;br /&gt;
|  0x10&lt;br /&gt;
|  Region Specific Game Ratings (For use with Parental Controls)&lt;br /&gt;
|-&lt;br /&gt;
|  0x2018&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Region Lockout&lt;br /&gt;
|-  &lt;br /&gt;
|  0x201C&lt;br /&gt;
|  0xC &lt;br /&gt;
|  Match Maker IDs (Online Play)&lt;br /&gt;
|-    &lt;br /&gt;
|  0x2028&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Flags&lt;br /&gt;
|-    &lt;br /&gt;
|  0x202C&lt;br /&gt;
|  0x2 &lt;br /&gt;
|  EULA Version&lt;br /&gt;
|-    &lt;br /&gt;
|  0x202E&lt;br /&gt;
|  0x2 &lt;br /&gt;
|  Reserved&lt;br /&gt;
|-  &lt;br /&gt;
|  0x2030&lt;br /&gt;
|  0x4 &lt;br /&gt;
|  &#039;Optimal Animation Default Frame&#039; (for BNR)&lt;br /&gt;
|-    &lt;br /&gt;
|  0x2034&lt;br /&gt;
|  0x4 &lt;br /&gt;
|  CEC (StreetPass) ID (So the Home Menu knows which application icon to show the &#039;Green&#039; CEC notification for)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Region Specific Game Age Ratings ===&lt;br /&gt;
&lt;br /&gt;
These flags tell the 3DS the &#039;Age Rating&#039; of the software for the below regions:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  START&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x2008&lt;br /&gt;
|  0x1&lt;br /&gt;
|  CERO (Japan)&lt;br /&gt;
|-&lt;br /&gt;
|  0x2009&lt;br /&gt;
|  0x1&lt;br /&gt;
|  ESRB (USA)&lt;br /&gt;
|-&lt;br /&gt;
|  0x200A&lt;br /&gt;
|  0x1&lt;br /&gt;
|  Reserved&lt;br /&gt;
|-&lt;br /&gt;
|  0x200B&lt;br /&gt;
|  0x1&lt;br /&gt;
|  USK (German)&lt;br /&gt;
|-&lt;br /&gt;
|  0x200C&lt;br /&gt;
|  0x1&lt;br /&gt;
|  PEGI GEN (Europe)&lt;br /&gt;
|-&lt;br /&gt;
|  0x200D&lt;br /&gt;
|  0x1&lt;br /&gt;
|  Reserved&lt;br /&gt;
|-&lt;br /&gt;
|  0x200E&lt;br /&gt;
|  0x1&lt;br /&gt;
|  PEGI PRT (Portugal)&lt;br /&gt;
|-&lt;br /&gt;
|  0x200F&lt;br /&gt;
|  0x1&lt;br /&gt;
|  PEGI BBFC (England)&lt;br /&gt;
|-&lt;br /&gt;
|  0x2010&lt;br /&gt;
|  0x1&lt;br /&gt;
|  COB (Australia)&lt;br /&gt;
|-&lt;br /&gt;
|  0x2011&lt;br /&gt;
|  0x1&lt;br /&gt;
|  GRB (South Korea)&lt;br /&gt;
|-&lt;br /&gt;
|  0x2012&lt;br /&gt;
|  0x1&lt;br /&gt;
|  CGSRR (Taiwan)&lt;br /&gt;
|-&lt;br /&gt;
|  0x2013&lt;br /&gt;
|  0x1&lt;br /&gt;
|  Reserved&lt;br /&gt;
|-&lt;br /&gt;
|  0x2014&lt;br /&gt;
|  0x1&lt;br /&gt;
|  Reserved&lt;br /&gt;
|-&lt;br /&gt;
|  0x2015&lt;br /&gt;
|  0x1&lt;br /&gt;
|  Reserved&lt;br /&gt;
|-&lt;br /&gt;
|  0x2016&lt;br /&gt;
|  0x1&lt;br /&gt;
|  Reserved&lt;br /&gt;
|-&lt;br /&gt;
|  0x2017&lt;br /&gt;
|  0x1&lt;br /&gt;
|  Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Active ratings have a bitmask of 0x80, and inactive ratings have no bitmask at all. Ratings without the 0x80 bitmask are ignored. 0x40 bitmask indicates Rating Pending. 0x20 bitmask indicates No Age Restriction.&lt;br /&gt;
Age limits are set by adding the minimal age to 0x80 (for example, limiting to 12 years and up would give a bitmask of 0x8C)&lt;br /&gt;
&lt;br /&gt;
=== Region Lockout ===&lt;br /&gt;
&lt;br /&gt;
This u32 flag is what the Home Menu uses to determine the [[Home Menu#Region Lockout|Region Lockout]] of a title.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  REGION&lt;br /&gt;
!  BITMASK&lt;br /&gt;
|-&lt;br /&gt;
|  Japan&lt;br /&gt;
|  0x01&lt;br /&gt;
|-&lt;br /&gt;
|  North America&lt;br /&gt;
|  0x02 &lt;br /&gt;
|-&lt;br /&gt;
|  Europe&lt;br /&gt;
|  0x04 &lt;br /&gt;
|-&lt;br /&gt;
|  Australia&lt;br /&gt;
|  0x08 &lt;br /&gt;
|-&lt;br /&gt;
|  China&lt;br /&gt;
|  0x10 &lt;br /&gt;
|-&lt;br /&gt;
|  Korea&lt;br /&gt;
|  0x20 &lt;br /&gt;
|-&lt;br /&gt;
|  Taiwan &lt;br /&gt;
|  0x40 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Regions are &#039;included&#039; in region lock by setting their bitmask value. Nintendo defines region free as 0x7fffffff. Early in the 3DS&#039; development, Nintendo grouped the Australian and Europe markets together. Nintendo defines market Europe as having the combined bitmasks of Europe and Australia. No 3DS&#039; which check the Australia bitmask have been seen (Australia uses the European 3DS model).&lt;br /&gt;
&lt;br /&gt;
=== Match Maker IDs ===&lt;br /&gt;
&lt;br /&gt;
These IDs are an application&#039;s online gaming IDs.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  START&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x201C&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Match Maker ID&lt;br /&gt;
|- &lt;br /&gt;
|  0x2020&lt;br /&gt;
|  0x8&lt;br /&gt;
|  Match Maker BIT ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Flags ===&lt;br /&gt;
The u32 is used for storing flags as bit-masks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  FLAG&lt;br /&gt;
!  BITMASK VALUE&lt;br /&gt;
|-&lt;br /&gt;
|  Visibility Flag (Required for visibility on the Home Menu)&lt;br /&gt;
|  0x0001&lt;br /&gt;
|-&lt;br /&gt;
|  [[Home Menu#Auto-Boot_Function|Auto-boot]] this gamecard title&lt;br /&gt;
|  0x0002&lt;br /&gt;
|-&lt;br /&gt;
|  Allow use of 3D? (For use with parental Controls. An application can use the 3D affect, even when this flag isn&#039;t set)&lt;br /&gt;
|  0x0004&lt;br /&gt;
|-&lt;br /&gt;
|  Require accepting CTR EULA before being launched by Home (see below)&lt;br /&gt;
|  0x0008&lt;br /&gt;
|-&lt;br /&gt;
|  Autosave on exit? (see below)&lt;br /&gt;
|  0x0010&lt;br /&gt;
|-&lt;br /&gt;
|  Uses an [[Extended Banner]]?&lt;br /&gt;
|  0x0020&lt;br /&gt;
|-&lt;br /&gt;
|  [[SMDH#Region Specific Game Age Ratings|Region game rating]] required&lt;br /&gt;
|  0x0040&lt;br /&gt;
|-&lt;br /&gt;
|  Uses save data? (see below)&lt;br /&gt;
|  0x0080&lt;br /&gt;
|-&lt;br /&gt;
|  Application usage is to be recorded. If this is not set, it causes the application&#039;s usage to be omitted from the Home Menu&#039;s [[Home_Menu#Cache.dat &amp;amp; CacheD.dat|icon cache]], as well as in [[????????|other places]].&lt;br /&gt;
|  0x0100&lt;br /&gt;
|-&lt;br /&gt;
|  Disables [[SD Savedata Backups]] for this title. This is in addition to [[NS CFA|the blacklist]].&lt;br /&gt;
|  0x0400&lt;br /&gt;
|-&lt;br /&gt;
|  New 3DS exclusive title. Shows an error if used on Old 3DS.&lt;br /&gt;
|  0x1000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Effect of SaveData and AutoSave====&lt;br /&gt;
&lt;br /&gt;
These options have no effect on the performance of the application itself: they&#039;re used to select an appropriate warning when closing an application from [[Home Menu|Home]].&lt;br /&gt;
&lt;br /&gt;
* Both off: &amp;quot;Closing software&amp;quot; (no warning if quitting directly with X)&lt;br /&gt;
* SaveData: &amp;quot;Do you want to close [...]? (Unsaved data will be lost.)&amp;quot;&lt;br /&gt;
* AutoSave: ?&lt;br /&gt;
* Both on:  &amp;quot;Saving data and closing software...&amp;quot; (no warning if quitting directly with X)&lt;br /&gt;
&lt;br /&gt;
=== EULA Version ===&lt;br /&gt;
This is the EULA version which is checked when the Accept EULA flag is set, the version is compared to one stored in the 3DS. If the SMDH version is greater, then the user will be prompted to accept the EULA.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  START&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x202C&lt;br /&gt;
|  0x01&lt;br /&gt;
|  EULA Version Minor&lt;br /&gt;
|-&lt;br /&gt;
|  0x202D&lt;br /&gt;
|  0x01&lt;br /&gt;
|  EULA Version Major&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== &#039;Optimal Animation Default Frame&#039; (for BNR) ===&lt;br /&gt;
&lt;br /&gt;
This is a float, indicating the preferred (or &#039;most representative&#039;) frame for the banner animation.&lt;br /&gt;
&lt;br /&gt;
=== CEC (StreetPass) ID ===&lt;br /&gt;
&lt;br /&gt;
This u32 represents the application CEC ID. This is likely loaded by applications for use with the CEC services as well.&lt;br /&gt;
&lt;br /&gt;
== Icon graphics ==&lt;br /&gt;
&lt;br /&gt;
At offset 0x2040, there are two icons:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  START&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x2040&lt;br /&gt;
|  0x480&lt;br /&gt;
|  Small - 24x24 (shown on top screen when pausing the app)&lt;br /&gt;
|- &lt;br /&gt;
|  0x24C0&lt;br /&gt;
|  0x1200 &lt;br /&gt;
|  Large - 48x48 icon (the general icon)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Both of the icons are encoded in RGB565 meaning 16bpp. Although both icons are known to be RGB565, developers have the option of encoding icons (and banners) with the following encodings :&lt;br /&gt;
&lt;br /&gt;
* RGBA8&lt;br /&gt;
* RGB8&lt;br /&gt;
* RGBA5551&lt;br /&gt;
* RGB565&lt;br /&gt;
* RGBA4&lt;br /&gt;
* LA8&lt;br /&gt;
* HILO8&lt;br /&gt;
* L8&lt;br /&gt;
* A8&lt;br /&gt;
* LA4&lt;br /&gt;
* L4&lt;br /&gt;
* ETC1&lt;br /&gt;
* ETC1A4&lt;br /&gt;
&lt;br /&gt;
This does not necessarily mean the other encodings will be used, it is just that those are the options when compiling. Like we&#039;ve seen with Super Mario 3D Land Nintendo has changed save file encryption, and likewise they can encode icons and banners differently &#039;&#039;should they choose to&#039;&#039;. Currently we&#039;ve seen just RGB565 so don&#039;t be fooled if an icon doesn&#039;t show up right! It is probably one of these formats above. Although we will probably not see other formats used for a while it&#039;s nice to know they have an opportunity to change. Also note that it seems Nintendo stores each pixel in [https://en.wikipedia.org/wiki/RGBA_color_space word-order], so the actual order of order of each color channel in memory will depend on the endianness. &lt;br /&gt;
&lt;br /&gt;
The data is encoded in tiles (starting from size 8x8, continuing recursively).&lt;br /&gt;
&lt;br /&gt;
If the buffer is like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  0&lt;br /&gt;
!  1&lt;br /&gt;
!  2&lt;br /&gt;
!  3&lt;br /&gt;
!  4&lt;br /&gt;
!  5&lt;br /&gt;
!  6&lt;br /&gt;
!  7&lt;br /&gt;
!  8&lt;br /&gt;
!  9&lt;br /&gt;
!  10&lt;br /&gt;
!  11&lt;br /&gt;
!  12&lt;br /&gt;
!  13&lt;br /&gt;
!  14&lt;br /&gt;
!  15&lt;br /&gt;
!  16&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then the image would look like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  x=0&lt;br /&gt;
!  x=1&lt;br /&gt;
!  x=2&lt;br /&gt;
!  x=3&lt;br /&gt;
!  x=4&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 4&lt;br /&gt;
| 5&lt;br /&gt;
| 16&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 3&lt;br /&gt;
| 6&lt;br /&gt;
| 7&lt;br /&gt;
| ...&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 9&lt;br /&gt;
| 12&lt;br /&gt;
| 13&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 11&lt;br /&gt;
| 14&lt;br /&gt;
| 15&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
[[CiTRUS]] - (GUI)(Windows Only) Generating ICN files&lt;br /&gt;
&lt;br /&gt;
[[3DSExplorer]] - (GUI)(Windows Only) Parsing ICN files&lt;/div&gt;</summary>
		<author><name>Qyriad</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=CGFX&amp;diff=20052</id>
		<title>CGFX</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=CGFX&amp;diff=20052"/>
		<updated>2017-05-30T02:09:41Z</updated>

		<summary type="html">&lt;p&gt;Qyriad: /* Links */ Fixed broken link with Wayback Machine&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CGFX is a container format used to store graphics resources. It can contain 3D models, textures and animation data.&lt;br /&gt;
&lt;br /&gt;
== CGFX ==&lt;br /&gt;
&lt;br /&gt;
CGFX header :&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &amp;quot;CGFX&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| Byte order mark: FFFE (little endian) or FEFF (big endian)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| CGFX header size&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Version ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| File size (bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of entries&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A typical CGFX file contains two main entries, beginning directly after the CGFX header: DATA and IMAG.&lt;br /&gt;
&lt;br /&gt;
== DATA ==&lt;br /&gt;
&lt;br /&gt;
DATA contains a list of DICT references.&lt;br /&gt;
&lt;br /&gt;
DATA header (for N = 0..15) :&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &amp;quot;DATA&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| DATA Size (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 +(N*8)&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of entries in DICT N&lt;br /&gt;
|-&lt;br /&gt;
| 0xC +(N*8)&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to DICT N&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The DATA header contains the entry counts and offsets for each DICT entry. The number of entries can vary (probably based on the version?), but are always in the following order. Any unused entries are zeroed.&lt;br /&gt;
&lt;br /&gt;
Typical entries:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! N&lt;br /&gt;
! Type&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Models&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Textures&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| LUTS (Material/Color/Shader look-up tables?)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Cameras&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Lights&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Fog&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Environments&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| Skeleton animations&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Texture animations&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Unknown animations&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| Unknown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DICT ==&lt;br /&gt;
&lt;br /&gt;
DICTs are generic structures used to store values (and associate them to a key ?). A DICT header is 0x1C bytes long.&lt;br /&gt;
&lt;br /&gt;
DICT header :&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &amp;quot;DICT&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| DICT size (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of entries&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x10&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
DICT entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to symbol&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CMDL ==&lt;br /&gt;
&lt;br /&gt;
CMDL is used to describe a 3D model.&lt;br /&gt;
&lt;br /&gt;
CMDL Header :&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Flags (bit 7: hasSkeletonSobj)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &amp;quot;CMDL&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to model name&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x18&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x28&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of entries in Animation Types DICT&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to Animation Types DICT&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0xC&lt;br /&gt;
| Global scale vector (3 floats : x, y, z)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C&lt;br /&gt;
| 0x18&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x54&lt;br /&gt;
| 0x30&lt;br /&gt;
| Matrix 1&lt;br /&gt;
|-&lt;br /&gt;
| 0x84&lt;br /&gt;
| 0x30&lt;br /&gt;
| Matrix 2&lt;br /&gt;
|-&lt;br /&gt;
| 0xB4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of Vertex Info SOBJ entries&lt;br /&gt;
|-&lt;br /&gt;
| 0xB8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to Vertex Info SOBJ list&lt;br /&gt;
|-&lt;br /&gt;
| 0xBC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of MTOB DICT entries&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to MTOB DICT&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of Vertex Info SOBJ entries&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to Vertex Info SOBJ list&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of Unknown DICT entries&lt;br /&gt;
|-&lt;br /&gt;
| 0xD0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to Unknown DICT&lt;br /&gt;
|-&lt;br /&gt;
| 0xD4&lt;br /&gt;
| 0xC&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xE0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Skeleton Info SOBJ offset (self-relative) [only present if flag bit 7 is set]&lt;br /&gt;
|-&lt;br /&gt;
| 0xB8+[0xB8]&lt;br /&gt;
| 0x4*N&lt;br /&gt;
| Vertex Info SOBJ self-relative offset list&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A CMDL section refers to outside data; it can not be considered separately from the rest of the CGFX file.&lt;br /&gt;
The second DICT in the CMDL section contains offsets to MTOB objects.&lt;br /&gt;
&lt;br /&gt;
== SOBJ ==&lt;br /&gt;
&lt;br /&gt;
SOBJ structures can be used to describe 3D objects that are part of the model. If such is the case then they will follow this structure :&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Flags (bit 4: model; bit 1: skeleton)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &amp;quot;SOBJ&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown symbol offset (self-relative)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0xC&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to Unknown1 (appears to hold array of floats) ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0xC&lt;br /&gt;
| Mesh position offset (X/Y/Z floats)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Face groups count&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to face groups offset array&lt;br /&gt;
|-&lt;br /&gt;
| 0x34&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0x4&lt;br /&gt;
| Vertex groups count&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to vertex groups offset array&lt;br /&gt;
|-&lt;br /&gt;
| 0x40&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown offset (self-relative) ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Face groups:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Bone groups count&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to UInt32 bone group IDs array&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown2 count&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to Unknown2 offset array&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unknown2:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Face group descriptor count&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to face array descriptors offset array&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown3 count&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to UInt32 Unknown3 array&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x8&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Face array descriptor:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Flags (bit 1: vertex index format: 0=byte, 1=short)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Vertex index array size (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to vertex index array&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Vertex groups come in a number of different formats. Typically the first vertex group entry is of format 0x40000002 and contains the actual vertex array.&lt;br /&gt;
&lt;br /&gt;
Vertex group format 0x40000002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Flags (0x40000002)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| Vertex array size (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to vertex array&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x24&lt;br /&gt;
| 0x4&lt;br /&gt;
| Vertex stride/size in bytes (see below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x28&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown3 count&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to component declaration offset array&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each mesh&#039;s primary vertex group contains an array of vertex component declaration objects, defining the order and parameters for each of a vertex&#039;s components.&lt;br /&gt;
&lt;br /&gt;
Vertex component declaration:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Flags (0x40000001)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Vertex component type (see below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x24&lt;br /&gt;
| 0x1&lt;br /&gt;
| Component data type (see below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x25&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x26&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x27&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x28&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of values in this component (e.g. XYZ-&amp;gt;3, UV-&amp;gt;2)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Multiplier for this component&#039;s values (float)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0x4&lt;br /&gt;
| Position of this component within vertex stride&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Vertex formats with bone data support multiple bone assignment. In this case, the sum of all bone weights is 0x64.&lt;br /&gt;
&lt;br /&gt;
Vertex component types:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Type&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| Position&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| Normal&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| ? (unobserved)&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Color&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| UV0&lt;br /&gt;
|-&lt;br /&gt;
| 0x05&lt;br /&gt;
| UV1&lt;br /&gt;
|-&lt;br /&gt;
| 0x06&lt;br /&gt;
| ? (unobserved, possibly UV2)&lt;br /&gt;
|-&lt;br /&gt;
| 0x07&lt;br /&gt;
| Weight&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Vertex component data types:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Type&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| sbyte&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| byte&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| short&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| ? (unobserved, possibly ushort)&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| ? (unobserved, possibly int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x05&lt;br /&gt;
| ? (unobserved, possibly uint)&lt;br /&gt;
|-&lt;br /&gt;
| 0x06&lt;br /&gt;
| float&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Vertex components are stored as one of the above data types, and the vertex component declaration contains a multiplier that adapts the values to the float version which the game will use.&lt;br /&gt;
For example, color RGBA values are stored as bytes, and the multiplier converts them from 0-255 to 0-1.0, and position components using short values are normalized via the multiplier to take advantage of the entire short value range.&lt;br /&gt;
&lt;br /&gt;
== TXOB ==&lt;br /&gt;
&lt;br /&gt;
TXOBs are contained within MTOBs. They can describe textures; if such is the case, then their structure is as follows :&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Flags&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &amp;quot;TXOB&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to symbol&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture height&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture width&lt;br /&gt;
|-&lt;br /&gt;
| 0x28&lt;br /&gt;
| 0x4&lt;br /&gt;
| Mipmap levels&lt;br /&gt;
|-&lt;br /&gt;
| 0x34&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture format ID (see table below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture height (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x40&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture width (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x44&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture data size&lt;br /&gt;
|-&lt;br /&gt;
| 0x48&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture data offset (self-relative)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Texture format ID&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|RGBA8&lt;br /&gt;
|-&lt;br /&gt;
|0x1&lt;br /&gt;
|RGB8&lt;br /&gt;
|-&lt;br /&gt;
|0x2&lt;br /&gt;
|RGBA5551&lt;br /&gt;
|-&lt;br /&gt;
|0x3&lt;br /&gt;
|RGB565&lt;br /&gt;
|-&lt;br /&gt;
|0x4&lt;br /&gt;
|RGBA4&lt;br /&gt;
|-&lt;br /&gt;
|0x5&lt;br /&gt;
|LA8&lt;br /&gt;
|-&lt;br /&gt;
|0x6&lt;br /&gt;
|HILO8&lt;br /&gt;
|-&lt;br /&gt;
|0x7&lt;br /&gt;
|L8&lt;br /&gt;
|-&lt;br /&gt;
|0x8&lt;br /&gt;
|A8&lt;br /&gt;
|-&lt;br /&gt;
|0x9&lt;br /&gt;
|LA4&lt;br /&gt;
|-&lt;br /&gt;
|0xA&lt;br /&gt;
|L4&lt;br /&gt;
|-&lt;br /&gt;
|0xB&lt;br /&gt;
|A4 ?&lt;br /&gt;
|-&lt;br /&gt;
|0xC&lt;br /&gt;
|ETC1 (see notes below)&lt;br /&gt;
|-&lt;br /&gt;
|0xD&lt;br /&gt;
|ETC1A4 ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Every texture format has its texture data divided into 8x8 tiles. See [[SMDH#Icon_graphics|SMDH]] for more information.&lt;br /&gt;
ETC1 is a compressed texture format which compresses blocks of 4x4 pixels into u64s. These u64 are traditionally stored in big endian; however, nintendo&#039;s implementation stores them in little endian. ETC1 textures are stored in 8x8 tiles; decompressed 4x4 therefore have to be organized accordingly. See [https://gist.github.com/smealum/8897237] for implementation example.&lt;br /&gt;
&lt;br /&gt;
== LUTS ==&lt;br /&gt;
&lt;br /&gt;
Appears to contain color lookup tables possibly for use with shaders.&lt;br /&gt;
&lt;br /&gt;
LUTS Header:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &amp;quot;LUTS&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| Seems to adhere to powers of 2 (width/height/flags?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| Seems to adhere to powers of 2 (width/height/flags?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x8&lt;br /&gt;
| all zeroes ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset to DICT (self-relative) ?&lt;br /&gt;
|}&lt;br /&gt;
All observed instances have an otherwise unreferenced DICT section immediately afterward (the last LUTS value being a 0x4, which may describe the relative position of that DICT), which appears to describe material specularity.&lt;br /&gt;
&lt;br /&gt;
== Skeleton data ==&lt;br /&gt;
&lt;br /&gt;
Skeleton data is stored in an array. Each entry is 0xE0 bytes in length and organized this way :&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self relative) to name symbol&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Joint ID&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Parent joint ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Signed offset (self-relative) to parent joint&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C&lt;br /&gt;
| 0xC&lt;br /&gt;
| Angle vector (floats, x, y, z)&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0xC&lt;br /&gt;
| Position vector (floats, x, y, z)&lt;br /&gt;
|-&lt;br /&gt;
| 0x44&lt;br /&gt;
| 0x30&lt;br /&gt;
| Transformation matrix (4x3)&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| 0x30&lt;br /&gt;
| Identity matrix ? (4x3)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each entry stores the joint transformation data twice; once as angle/position vectors and once as a transformation matrix. Each entry also stores a second matrix which appears to always be identity. (?)&lt;br /&gt;
&lt;br /&gt;
== CANM ==&lt;br /&gt;
&lt;br /&gt;
CANMs are used to store skeletal animation data.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* Another CGFX Format Description (Archived Page): [https://web.archive.org/web/20150511211029/http://florian.nouwt.com/wiki/index.php/CGFX_(File_Format) http://florian.nouwt.com/wiki/index.php/CGFX_(File_Format)]&lt;br /&gt;
&lt;br /&gt;
[[Category:File formats]]&lt;/div&gt;</summary>
		<author><name>Qyriad</name></author>
	</entry>
</feed>