NCCH and SMDH: Difference between pages

From 3dbrew
(Difference between pages)
Jump to navigation Jump to search
Xcution (talk | contribs)
 
Xcution (talk | contribs)
 
Line 1: Line 1:
[[Category:File formats]]
This page describes the format of the icon stored at [[NCCH#CXI|CXI]] ExeFS:/icon and [[CIA]] icons.
The following text tries to document the structure of the NCCH container format.
The size of icons is 0x36c0 bytes. The CXI icon is displayed by [[Home Menu]] and [[System Settings]](3DS Software Management), while CIA icons are dummies and not yet utilised by Dev 3DS' (at rev 40909).


== Overview ==
== Format ==
There are two known NCCH container specialisations used on the 3DS, "executable" and "non-executable", officially known as CXI and CFA respectively.


== CXI ==
{| class="wikitable" border="1"
|-
!  OFFSET
!  SIZE
!  DESCRIPTION
|-
|  0x00
|  0x04
|  Magic 'SMDH'
|-
|  0x04
|  0x04
|  Reserved
|-
|  0x8
|  0x1600
|  11 application titles structs, each 0x200 bytes
|-
| 0x1608
| 0xA00
| Reserved
|-
| 0x2008
| 0x30
| Flags
|-
| 0x2038
| 0x8
| Reserved
|-
| 0x2040
| 0x1680
| Icon graphics
|}


The CXI (CTR Executable Image) specialisation of the NCCH container, contains executable code, which runs on a single ARM11 core. It can communicate through SVC calls with the other ARM11 core running the 'system' program code. For reasons of clarity, the ARM11 cores will sometimes be called the 'appcore' and 'syscore' respectively.
== Application Titles ==


The CXI format is structured in the following order:
{| class="wikitable" border="1"
* first a NCCH header,
|-
* followed by an extended header,
!  START
* followed by an access descriptor,
!  SIZE
* followed by a plain binary region,
!  DESCRIPTION
* followed by an embedded executable filesystem ([[ExeFS]]) - (contains ARM11 code, Home menu [[SMDH|icn]]/bnr and [[Logo|logo]]),
|-
* and finally followed by a read-only filesystem ([[RomFS]]) - (Used for external file storage).
| 0x00
| 0x80
|  Short Description
|-  
|  0x80
|  0x100
|  Long Description
|-  
|  0x180
|  0x80
|  Publisher
|}


The extended header contains additional information regarding access control.  
All encoded in UTF-16.
The plain binary region is an area specifically stored in plaintext, mostly containing SDK library strings for identification.
There are 11 app title structs, each one for separate languages.


== CFA ==
The languages by order of appearance:


The CFA (CTR File Archive) specialisation of the NCCH container, is not executable, but are used in conjunction with CXI files. For instance 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 on the NAND.
* 1st: Japanese title name
* 2nd: English title name
* 3rd: French title name
* 4th: German title name
* 5th: Italian title name
* 6th: Spanish title name
* 7th: Chinese title name
* 8th: Korean title name
* 9th: Dutch title name
* 10th: Portuguese title name
* 11th: Russian title name


CFA files are structured in the following order:
== Flags ==
* first a NCCH header,
* followed by a read-only filesystem ([[RomFS]])


Non-Executable NCCH file examples(Includes Decrypted [[RomFS]]):
This is where the application [[Home Menu]] flags exist. It is important to note, only the Home Menu uses these flags


[http://depositfiles.com/files/n476if4gj DLPChild Container]
{| class="wikitable" border="1"
[http://depositfiles.com/files/gnrihkeec Electronic Manual]
|-
!  START
!  SIZE
!  DESCRIPTION
|-
|  0x2008
|  0xA
|  Region Specific Game Ratings (For use with Parental Controls)
|-
|  0x2018
|  0x4
|  BNR Region (Used For Region Locking)
|- 
|  0x201C
|  0xC
|  Match Maker IDs (Online Play)
|-   
|  0x2028
|  0x1
|  Combined Flag (Various Flags)
|- 
|  0x2032
|  0x2
|  'Optimal Animation Default Frame' (for BNR)
|-   
|  0x2034
|  0x4
|  CEC (StreetPass) ID (So the Home Menu knows which application icon to show the 'Green' CEC notification for)
|}


== NCCH Specs ==
=== Region Specific Game Age Ratings ===


The extended header, the [[ExeFS]] and the [[RomFS]] are encrypted using 128-bit AES CTR.
These flags tell the 3DS the 'Age Rating' of the software for the below regions:


By default encrypted regions are compressed with an LZ77 variant, then encrypted. The spec allows for both unencrypted and uncompressed regions to exist. Retail SD card CXIs must have the [[ExeFS|ExeFS:/.code]] compressed. Development units use a fixed system key for system titles. On retail part of the input [[AES]] engine key is unique per NCCH, the AES engine internally generates the final-normal key.
Retail CFAs use NCCH product code "CTR-P-CTAP", while retail title/gamecard CXIs use NCCH product code "CTR-P-XXXX". This product code is the NCCH [[Serials|serial code]]. The region-locking info checked by home menu is stored in the [[SMDH#Flags|icon]].
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.
=== NCCH Header ===
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
OFFSET
START
!  SIZE
!  SIZE
!  DESCRIPTION
!  DESCRIPTION
|-
|-
0x000
0x2008
0x100
0x1
RSA-2048 signature of the NCCH header, using SHA-256.
CERO (Japan)
|-
|  0x2009
|  0x1
|  ESRB (USA)
|-
|  0x200B
|  0x1
|  USK (German)
|-
|  0x200C
|  0x1
|  PEGI GEN (Europe)
|-
|  0x200E
|  0x1
|  PEGI PRT (Portugal)
|-
|  0x200F
|  0x1
|  PEGI BBFC (England)
|-
|  0x2010
|  0x1
|  COB (Australia)
|-
|-
0x100
0x2011
4
0x1
Magic ID, always 'NCCH'
Unknown/Unused
|}
 
These flags are generated by converting the age rating to a hex value and then adding it to '80'. For example if '7 years' was the rating, then the flag would be '87'(this is a hex value). The unknown/unused rating is only has a value when the BNR is for 'All Regions'. Also if Game Ratings are not used, when selecting a region for the BNR, it generates random Game Age Ratings for all regions.
 
=== BNR Region ===
 
This flag is what the Home Menu uses in order to determine the [[Home Menu#Region Lockout|Region Lockout]] of a title.
 
{| class="wikitable" border="1"
|-
!  REGION
!  VALUE
|-
|-
0x104
All Regions (No region restrictions)
4
7F FF FF FF
|  Content size, in media units (1 media unit = 0x200 bytes)
|-
|-
0x108
Japan
8
00 00 00 01
|  Partition ID
|-
|-
0x110
North America
2
00 00 00 02
|  Maker code
|-
|-
0x112
Europe
2
00 00 00 0C
|  Version
|-
|-
0x114
Korea
4
00 00 00 20
|  Reserved
|-
|-
0x118
Taiwan
8
00 00 00 40
|  Program ID
|-
|-
0x120
China
1
00 00 00 50
| Temp flag
|}
 
=== Match Maker IDs ===
 
These IDs are an application's online gaming IDs.
 
{| class="wikitable" border="1"
|-
|-
| 0x121
! START
| 0x2F
! SIZE
| Reserved
! DESCRIPTION
|-
|-
0x150
0x201C
0x10
0x4
Product code
Match Maker ID
|-
|  0x2020
|  0x8
|  Match Maker BIT ID
|}
 
For example, if the Match Maker ID was '12345678' and the Match Maker BIT ID was '1234567891234567', the flags would be '78 56 34 12' and '67 45 23 91 78 56 34 12' respectively
 
=== Bit Flags ===
 
This flag has multiple flags, packed into one byte. By use of addition the flags are combined:
 
{| class="wikitable" border="1"
|-
|-
| 0x160
! FLAG
| 0x20
! VALUE
|  Extended header SHA-256 hash, over 0x400 bytes of the ExHeader
|-
|-
0x180
Visibility Flag (always present)
4
01
|  Extended header size
|-
|-
0x184
Allow use of 3D? (For use with parental Controls, it does not the affect whether the application uses 3D or not. An application can use the 3D affect, even when this flag isn't set)
4
04
|  Reserved
|-
|-
0x188
Require accepting CTR EULA?
8
08
|  Flags: byte[5]-byte[7] indicate content type ( system update, application, manual, ... ) size of media unit ( 512*2^byte[6] ) and encryption.
|-
|-
0x190
Autoboot?
4
02
|  Plain region offset, in media units
|-
|-
0x194
Autosave on exit?
4
10
|  Plain region size, in media units
|-
|-
0x198
Uses an extended Banner?
8
20
|  Reserved
|-
|-
0x1A0
Region game rating required?
4
40
|  ExeFS offset, in media units
|-
|-
0x1A4
Uses save data?
4
80
ExeFS size, in media units
|}
   
For example, if we wanted an application to use the 3D effect, autosave on exit and use save data. The combined flag would be '95' (01+04+10+80) (This is a hex value)
 
=== 'Optimal Animation Default Frame' (for BNR) ===
 
Purpose of this flag: If using an animated BNR, it's the most representative frame for the animation.
 
{| class="wikitable" border="1"
|-
|-
| 0x1A8
! OPTIMAL ANIMATION DEFAULT FRAME
| 4
! VALUE
|  ExeFS hash region size, in media units
|-
|-
0x1AC
0
4
00 00
|  Reserved
|-
|-
0x1B0
1
4
3F 80
|  RomFS offset, in media units
|-
|-
0x1B4
2
4
40 00
|  RomFS size, in media units
|-
|-
0x1B8
3
4
40 40
|  RomFS hash region size, in media units
|-
|-
|  0x1BC
|  4
|  4
Reserved
40 80
|-
|-
0x1C0
5
0x20
40 A0
|  ExeFS superblock SHA-256 hash, over first 0x200 bytes of the ExeFS
|-
|-
0x1E0
6
0x20
40 C0
|  RomFS superblock SHA-256 hash, over first 0x200 bytes of the RomFS
|}
|}


=== NCCH Flags ===
Flag Pattern: ???
 
=== CEC (StreetPass) ID ===
 
With a size of 4 bytes this represents the applications CEC ID. For example if the ID was '12345678' the flag would be '78 56 34 12'
 
== Icon graphics ==
 
At offset 0x2040, there are two icons:
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
INDEX
START
!  SIZE
!  DESCRIPTION
!  DESCRIPTION
|-
|-
5
0x2040
When the low 2-bits are 0x1, the NCCH is a CFA. Otherwise, it's a CXI.
0x480
|  Small - 24x24 (shown on top screen when pausing the app)
|-
|  0x24C0
|  0x1200
|  Large - 48x48 icon (the general icon)
|}
|}
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.


==== NCCH header example for Lego Starwars III ====
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 :
Signature:              720FF8F83F2A1E998322A026D1434165
                        ED19642ABC1CB2722135AA202BEAD60A
                        80BCD21C768C597B8268FEF2C64EA710
                        4C9BA5E12CFFBD1D0C619F4EF7B42CA7
                        DD8482CB4EB26720AD66CDA57ABCBCFB
                        D63268A6E2896A59B3B744E39E45B88A
                        ABB4C0980ACC6210818DCE6DAC838A10
                        95D0F66B352474D4B3DA4B333F49912D
                        29AF7EA58BC8C890B18C70B7D540A9FB
                        EBE24A5312055617D3353B28C3EB1D17
                        61021BEFF6AD22C384835B40BD44DFAD
                        981F6350F9458B17BCB5F768C92ABC93
                        2BCE9888855A8998F4CDE40C9543514A
                        C57B84EB75A680E7C742632614620D1D
                        A253284DF3DC01091EB3800C36FD62EE
                        BA15340F1FD498FAB67C0302E9CDA397
Magic:                  NCCH
Content size:          0x1cfef400
Partition id:          0004000000038c00
Maker code:            3436 ("46")
Version:                0002
Program id:            0004000000038c00
Temp flag:              00
Product code:          CTR-P-ALGP
Extended header hash:  0C27E3C1DE7B2AE2D3114F32A4EEBF46
                        9AFD0CF352C11D4984C2A9F1D2144C63
Extended header size:  00000400
Flags:                  0000030100000000
Plain region offset:    0x00004a00
Plain region size:      0x00000200
ExeFS offset:          0x00004c00
ExeFS size:            0x00143800
ExeFS hash region size: 0x00000200
RomFS offset:          0x00148400
RomFS size:            0x1ceab000
RomFS hash region size: 0x00000200
ExeFS Superblock Hash:  130C042615F647C4C63225EA9E67F8A2
                        7B15246B88FBC7A927257B84977B787B
RomFS Superblock Hash:  A65BEE1060BB6A6821BBCEC600035B7E
                        64FB6EACA7F0960CFB1F5A37087728F7
Note: Offsets and sizes in media units have been converted to byte sizes.


==== Plain region example for Lego Starwars III ====
* RGBA8
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]
* RGB8
0004a10: 52 5f 53 44 4b 2d 30 5f 31 34 5f 32 33 5f 32 30  R_SDK-0_14_23_20
* RGBA5551
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]
* RGB565
0004a30: 54 45 4e 44 4f 3a 46 69 72 6d 77 61 72 65 2d 30  TENDO:Firmware-0
* RGBA4
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]
* LA8
0004a50: 6c 69 70 3a 44 65 62 6c 6f 63 6b 65 72 5f 31 5f  lip:Deblocker_1_
* HILO8
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]
* L8
0004a70: 69 70 3a 49 6d 61 41 64 70 63 6d 44 65 63 5f 31  ip:ImaAdpcmDec_1
* A8
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]
* LA4
0004a90: 6c 69 70 3a 4d 6f 62 69 63 6c 69 70 44 65 63 5f  lip:MobiclipDec_
* L4
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]
* ETC1
0004ab0: 63 6c 69 70 3a 4d 6f 66 6c 65 78 44 65 6d 75 78  clip:MoflexDemux
* ETC1A4
0004ac0: 65 72 5f 31 5f 30 5f 32 5d 00 00 00 00 00 00 00  er_1_0_2].......
0004ad0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0004ae0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................


A tool for parsing this format is available [http://github.com/3dshax/ctr/tree/master/ctrtool here].
This does not necessarily mean the other encodings will be used, it is just that those are the options when compiling. Like we've seen with Super Mario 3D Land Nintendo has changed save file encryption, and likewise they can encode icons and banners differently ''should they choose to''. Currently we've seen just RGB565 so don't be fooled if an icon doesn'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's nice to know they have an opportunity to change.


==== Example dependency list from the extended header ====
There's a header of 0x40 bytes and then comes the raw data.
00850 41 50 54 3A 55 00 00 00 24 68 69 6F 46 49 4F 00 APT:U...$hioFIO.
00860 24 68 6F 73 74 69 6F 30 24 68 6F 73 74 69 6F 31 $hostio0$hostio1
00870 61 63 3A 75 00 00 00 00 62 6F 73 73 3A 55 00 00 ac:u....boss:U..
00880 63 61 6D 3A 75 00 00 00 63 65 63 64 3A 75 00 00 cam:u...cecd:u..
00890 63 66 67 3A 75 00 00 00 64 6C 70 3A 46 4B 43 4C cfg:u...dlp:FKCL
008A0 64 6C 70 3A 53 52 56 52 64 73 70 3A 3A 44 53 50 dlp:SRVRdsp::DSP
008B0 66 72 64 3A 75 00 00 00 66 73 3A 55 53 45 52 00 frd:u...fs:USER.
008C0 67 73 70 3A 3A 47 70 75 68 69 64 3A 55 53 45 52 gsp::Gpuhid:USER
008D0 68 74 74 70 3A 43 00 00 6D 69 63 3A 75 00 00 00 http:C..mic:u...
008E0 6E 64 6D 3A 75 00 00 00 6E 65 77 73 3A 75 00 00 ndm:u...<nowiki>news:u..</nowiki>
008F0 6E 77 6D 3A 3A 55 44 53 70 74 6D 3A 75 00 00 00 nwm::UDSptm:u...
00900 70 78 69 3A 64 65 76 00 73 6F 63 3A 55 00 00 00 pxi:dev.soc:U...
00910 73 73 6C 3A 43 00 00 00 79 32 72 3A 75 00 00 00 ssl:C...y2r:u...
00920 69 72 3A 55 53 45 52 00 6C 64 72 3A 72 6F 00 00 ir:USER.ldr:ro..
00930 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00940 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00950 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00960 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
... ...
009D0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF               
009E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
009F0 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 02 . .............


=== Extended Header ===
The data is encoded in tiles (starting from size 8x8, continuing recursively).
See also: [https://github.com/3dshax/ctr/blob/master/ctrtool/exheader.h]
 
If the buffer is like this:


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
OFFSET
0
SIZE
1
DESCRIPTION
2
!  3
!  4
!  5
!  6
!  7
!  8
!  9
!  10
!  11
!  12
!  13
!  14
!  15
!  16
|-
|}
 
Then the image would look like this:
 
{| class="wikitable" border="1"
|-
!  x=0
!  x=1
!  x=2
!  x=3
!  x=4
|-
| 0
| 1
| 4
| 5
| 16
|-
| 2
| 3
| 6
| 7
| ...
|-
| 8
| 9
| 12
| 13
|-
| 10
| 11
| 14
| 15
|-
|-
|  0x399
|  1
|  Memory type (00 = Base, 01 = Application, 02 = System)
|}
|}

Revision as of 08:26, 15 October 2012

This page describes the format of the icon stored at CXI ExeFS:/icon and CIA icons. The size of icons is 0x36c0 bytes. The CXI icon is displayed by Home Menu and System Settings(3DS Software Management), while CIA icons are dummies and not yet utilised by Dev 3DS' (at rev 40909).

Format

OFFSET SIZE DESCRIPTION
0x00 0x04 Magic 'SMDH'
0x04 0x04 Reserved
0x8 0x1600 11 application titles structs, each 0x200 bytes
0x1608 0xA00 Reserved
0x2008 0x30 Flags
0x2038 0x8 Reserved
0x2040 0x1680 Icon graphics

Application Titles

START SIZE DESCRIPTION
0x00 0x80 Short Description
0x80 0x100 Long Description
0x180 0x80 Publisher

All encoded in UTF-16. There are 11 app title structs, each one for separate languages.

The languages by order of appearance:

  • 1st: Japanese title name
  • 2nd: English title name
  • 3rd: French title name
  • 4th: German title name
  • 5th: Italian title name
  • 6th: Spanish title name
  • 7th: Chinese title name
  • 8th: Korean title name
  • 9th: Dutch title name
  • 10th: Portuguese title name
  • 11th: Russian title name

Flags

This is where the application Home Menu flags exist. It is important to note, only the Home Menu uses these flags

START SIZE DESCRIPTION
0x2008 0xA Region Specific Game Ratings (For use with Parental Controls)
0x2018 0x4 BNR Region (Used For Region Locking)
0x201C 0xC Match Maker IDs (Online Play)
0x2028 0x1 Combined Flag (Various Flags)
0x2032 0x2 'Optimal Animation Default Frame' (for BNR)
0x2034 0x4 CEC (StreetPass) ID (So the Home Menu knows which application icon to show the 'Green' CEC notification for)

Region Specific Game Age Ratings

These flags tell the 3DS the 'Age Rating' of the software for the below regions:

START SIZE DESCRIPTION
0x2008 0x1 CERO (Japan)
0x2009 0x1 ESRB (USA)
0x200B 0x1 USK (German)
0x200C 0x1 PEGI GEN (Europe)
0x200E 0x1 PEGI PRT (Portugal)
0x200F 0x1 PEGI BBFC (England)
0x2010 0x1 COB (Australia)
0x2011 0x1 Unknown/Unused

These flags are generated by converting the age rating to a hex value and then adding it to '80'. For example if '7 years' was the rating, then the flag would be '87'(this is a hex value). The unknown/unused rating is only has a value when the BNR is for 'All Regions'. Also if Game Ratings are not used, when selecting a region for the BNR, it generates random Game Age Ratings for all regions.

BNR Region

This flag is what the Home Menu uses in order to determine the Region Lockout of a title.

REGION VALUE
All Regions (No region restrictions) 7F FF FF FF
Japan 00 00 00 01
North America 00 00 00 02
Europe 00 00 00 0C
Korea 00 00 00 20
Taiwan 00 00 00 40
China 00 00 00 50

Match Maker IDs

These IDs are an application's online gaming IDs.

START SIZE DESCRIPTION
0x201C 0x4 Match Maker ID
0x2020 0x8 Match Maker BIT ID

For example, if the Match Maker ID was '12345678' and the Match Maker BIT ID was '1234567891234567', the flags would be '78 56 34 12' and '67 45 23 91 78 56 34 12' respectively

Bit Flags

This flag has multiple flags, packed into one byte. By use of addition the flags are combined:

FLAG VALUE
Visibility Flag (always present) 01
Allow use of 3D? (For use with parental Controls, it does not the affect whether the application uses 3D or not. An application can use the 3D affect, even when this flag isn't set) 04
Require accepting CTR EULA? 08
Autoboot? 02
Autosave on exit? 10
Uses an extended Banner? 20
Region game rating required? 40
Uses save data? 80

For example, if we wanted an application to use the 3D effect, autosave on exit and use save data. The combined flag would be '95' (01+04+10+80) (This is a hex value)

'Optimal Animation Default Frame' (for BNR)

Purpose of this flag: If using an animated BNR, it's the most representative frame for the animation.

OPTIMAL ANIMATION DEFAULT FRAME VALUE
0 00 00
1 3F 80
2 40 00
3 40 40
4 40 80
5 40 A0
6 40 C0

Flag Pattern: ???

CEC (StreetPass) ID

With a size of 4 bytes this represents the applications CEC ID. For example if the ID was '12345678' the flag would be '78 56 34 12'

Icon graphics

At offset 0x2040, there are two icons:

START SIZE DESCRIPTION
0x2040 0x480 Small - 24x24 (shown on top screen when pausing the app)
0x24C0 0x1200 Large - 48x48 icon (the general icon)

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 :

  • RGBA8
  • RGB8
  • RGBA5551
  • RGB565
  • RGBA4
  • LA8
  • HILO8
  • L8
  • A8
  • LA4
  • L4
  • ETC1
  • ETC1A4

This does not necessarily mean the other encodings will be used, it is just that those are the options when compiling. Like we've seen with Super Mario 3D Land Nintendo has changed save file encryption, and likewise they can encode icons and banners differently should they choose to. Currently we've seen just RGB565 so don't be fooled if an icon doesn'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's nice to know they have an opportunity to change.

There's a header of 0x40 bytes and then comes the raw data.

The data is encoded in tiles (starting from size 8x8, continuing recursively).

If the buffer is like this:

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Then the image would look like this:

x=0 x=1 x=2 x=3 x=4
0 1 4 5 16
2 3 6 7 ...
8 9 12 13
10 11 14 15