Difference between revisions of "SMDH"

From 3dbrew
Jump to navigation Jump to search
m
m (oops :/ wrong order)
Line 244: Line 244:
 
|-
 
|-
 
|  0
 
|  0
Unknown/Unused
+
See Table Below
 
|-
 
|-
 
|  1
 
|  1
|  Unknown/Unused
+
|  Unknown - Usually 0x01(Some Dev Apps have this set to 0x00)
 
|-
 
|-
 
|  2
 
|  2
|  Unknown - Usually 0x01
+
|  Unknown/Unused
 
|-
 
|-
 
|  3
 
|  3
Line 259: Line 259:
 
|-
 
|-
 
|  5
 
|  5
|  Unknown/Unused
+
|  Unknown - Usually 0x01
 
|-
 
|-
 
|  6
 
|  6
|  Unknown - Usually 0x01(Some Dev Apps have this set to 0x00)
+
|  Unknown/Unused
 
|-
 
|-
 
|  7
 
|  7
See Table Below
+
Unknown/Unused
 
|}
 
|}
  
==== Bit[7] ====
+
==== Bit[0] ====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-

Revision as of 03:46, 19 February 2013

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' (as of rev 47586).

Format

OFFSET SIZE DESCRIPTION
0x00 0x04 Magic 'SMDH'
0x04 0x04 Reserved
0x8 0x2000 16 application titles structs, each 0x200 bytes
0x2008 0x30 Application Settings
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 16 app title structs(currently only 11 are used), 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

Application Settings

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.

START SIZE DESCRIPTION
0x2008 0x10 Region Specific Game Ratings (For use with Parental Controls)
0x2018 0x4 Region Lockout
0x201C 0xC Match Maker IDs (Online Play)
0x2028 0x8 Flags
0x2030 0x4 '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)
0x200A 0x1 Reserved
0x200B 0x1 USK (German)
0x200C 0x1 PEGI GEN (Europe)
0x200D 0x1 Reserved
0x200E 0x1 PEGI PRT (Portugal)
0x200F 0x1 PEGI BBFC (England)
0x2010 0x1 COB (Australia)
0x2011 0x1 Reserved For Future Use
0x2012 0x1 Reserved
0x2013 0x1 Reserved For Future Use
0x2014 0x1 Reserved For Future Use
0x2015 0x1 Reserved
0x2016 0x1 Reserved For Future Use
0x2017 0x1 Reserved For Future Use

These are generated by converting the age rating(decimal) to a hex value and then adding it to '0x80'. For example if '7 years' was the rating, then the flag would be 0x87. If Game Ratings are not used, the data is garbage.

Region Lockout

This flag is what the Home Menu uses in order to determine the Region Lockout of a title. This exists inside the ICN data as little endian. (In the table below they are presented in big endian)

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

Flags

These are a collection of bit-mask flags.

INDEX DESCRIPTION
0 See Table Below
1 Unknown - Usually 0x01(Some Dev Apps have this set to 0x00)
2 Unknown/Unused
3 Unknown/Unused
4 Unknown/Unused
5 Unknown - Usually 0x01
6 Unknown/Unused
7 Unknown/Unused

Bit[0]

FLAG BITMASK VALUE
Visibility Flag (always present) 0x01
Auto-boot this title? (Game Card titles only?) 0x02
Allow use of 3D? (For use with parental Controls. An application can use the 3D affect, even when this flag isn't set) 0x04
Require accepting CTR EULA? 0x08
Autosave on exit? 0x10
Uses an Extended Banner? 0x20
Region game rating required? 0x40
Uses save data? 0x80

For example, if we wanted an application to use the 3D effect, autosave on exit and use save data. The combined flag would be 0x95: (0x01 | 0x04 | 0x10 | 0x80)

'Optimal Animation Default Frame' (for BNR)

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

This value is generated by taking an input value(default BNR frame) as a float, then representing it a hexadecimal array.

CEC (StreetPass) ID

This u32 represents the application CEC ID. This is likely loaded by applications for use with the CEC services as well.

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