CLYT format: Difference between revisions
		
		
		
		Jump to navigation
		Jump to search
		
|  Section added about USD1 panes |  Update some descriptions based on disassembly of TwlBgMenu | ||
| Line 18: | Line 18: | ||
| |0x0C||0x4||UInt32||File Size | |0x0C||0x4||UInt32||File Size | ||
| |- | |- | ||
| |0x10|| | |0x10||0x2||UInt16||Nr Sections | ||
| |- | |||
| |0x12||0x2||UInt16||Padding | |||
| |} | |} | ||
| Line 132: | Line 134: | ||
| |- | |- | ||
| |11||Use Texture Only | |11||Use Texture Only | ||
| |} | |} | ||
| |} | |} | ||
| Line 190: | Line 184: | ||
| |} | |} | ||
| TODO:  | === Texture Coordinate Generation Entry === | ||
| {| class="wikitable" border="1" | |||
| |- | |||
| !  Offset | |||
| !  Size | |||
| !  Type | |||
| !  Description | |||
| |- | |||
| |0x00||0x1||UInt8||Type | |||
| {| class="wikitable" border="1" | |||
| |- | |||
| !  Value | |||
| !  Meaning | |||
| |- | |||
| |0||2x4 matrix | |||
| |} | |||
| |- | |||
| |0x08||0x1||UInt8||Source (N = Tex N, max 2) | |||
| |- | |||
| |0x0C||0x2||UInt8[]||Padding | |||
| |} | |||
| TODO: tevStage, alphaCompare, blendMode, etc... | |||
| == pan1 (Pane 1) == | == pan1 (Pane 1) == | ||
| Line 221: | Line 237: | ||
| |0x0A||0x1||UInt8||Alpha | |0x0A||0x1||UInt8||Alpha | ||
| |- | |- | ||
| |0x0B||0x1||UInt8|| | |0x0B||0x1||UInt8||Padding | ||
| |- | |- | ||
| | | |0x0C||0x10||String||Pane name | ||
| | | |||
| |- | |- | ||
| | | |0x1C||0x8||String||Data | ||
| |- | |- | ||
| |0x24||0xC||Vector3||Translation | |0x24||0xC||Vector3||Translation | ||
| Line 280: | Line 289: | ||
| == bnd1 (Bounding 1) == | == bnd1 (Bounding 1) == | ||
| Same data structure as [[#pan1 (Pane 1)|Panes]]. | |||
| == pas1 (Pane Start 1) == | == pas1 (Pane Start 1) == | ||
| Starts a pane. | Starts a pane. | ||
| Line 409: | Line 395: | ||
| | 0x4 || 0x4 || UInt32 || Value: offset (from start of this entry) to a value (type decided by last field) | | 0x4 || 0x4 || UInt32 || Value: offset (from start of this entry) to a value (type decided by last field) | ||
| |- | |- | ||
| | 0x8 ||  | | 0x8 || 0x2 || UInt16 || Amount or, if a string, the length of the value(s)   | ||
| |- | |- | ||
| |  | | 0xA || 0x2 || UInt16 || Value type | ||
| {| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
| |- | |- | ||
| ! Value | ! Value | ||
| ! Type | |||
| |- | |||
| | 0x0 || String | |||
| |- | |- | ||
| |  | | 0x1 || Int | ||
| |- | |- | ||
| |  | | 0x2 || Float | ||
| |} | |} | ||
| |} | |||
| ==Tools== | ==Tools== | ||
Revision as of 19:56, 30 September 2020
CLYT (.bclyt) is the layout format used on the 3DS. It stands for (Binary) CTR Layout, and is similar to the RLYT format used on the Wii.
Header
| Offset | Size | Type | Description | 
|---|---|---|---|
| 0x00 | 0x4 | String | Signature (CLYT) | 
| 0x04 | 0x2 | UInt16 | Byte Order Mark | 
| 0x06 | 0x2 | UInt16 | Header Length | 
| 0x08 | 0x4 | UInt32 | Revision | 
| 0x0C | 0x4 | UInt32 | File Size | 
| 0x10 | 0x2 | UInt16 | Nr Sections | 
| 0x12 | 0x2 | UInt16 | Padding | 
lyt1 (Layout 1)
| Offset | Size | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| 0x00 | 0x4 | String | Signature (lyt1) | ||||||
| 0x04 | 0x4 | UInt32 | Section Size | ||||||
| 0x08 | 0x4 | UInt32 | Origin type 
 | ||||||
| 0x0C | 0x8 | Vector2 | Canvas Size | 
txl1 (Texture List 1)
| Offset | Size | Type | Description | 
|---|---|---|---|
| 0x00 | 0x4 | String | Signature (txl1) | 
| 0x04 | 0x4 | UInt32 | Section Size | 
| 0x08 | 0x4 | UInt32 | Nr Textures = N | 
| 0x0C | N * 4 | UInt32[] | Texture Name Offsets (relative to the start of this array) | 
After this, the null terminated names follow.
fnl1 (Font List 1)
| Offset | Size | Type | Description | 
|---|---|---|---|
| 0x00 | 0x4 | String | Signature (fnl1) | 
| 0x04 | 0x4 | UInt32 | Section Size | 
| 0x08 | 0x4 | UInt32 | Nr Fonts = N | 
| 0x0C | N * 4 | UInt32[] | Font Name Offsets (relative to the start of this array) | 
After this, the null terminated names follow.
mat1 (Materials 1)
| Offset | Size | Type | Description | 
|---|---|---|---|
| 0x00 | 0x4 | String | Signature (mat1) | 
| 0x04 | 0x4 | UInt32 | Section Size | 
| 0x08 | 0x4 | UInt32 | Nr Materials = N | 
| 0x0C | N * 4 | UInt32[] | Material Entry Offsets (relative to the start of this section) | 
After this, the material entries follow.
| Offset | Size | Type | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x00 | 0x14 | String | Material Name | ||||||||||||||||
| 0x14 | 0x4 | RGBA8 | Tev Color (Buffer Color?) | ||||||||||||||||
| 0x18 | 0x18 | RGBA8[6] | Tev Constant Colors | ||||||||||||||||
| 0x30 | 0x4 | UInt32 | Flags / bitfield 
 | 
Texture Map Entry
| Offset | Size | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| 0x00 | 0x2 | UInt16 | Texture Index | ||||||
| 0x02 | 0x1 | Byte | Bitfield 
 | ||||||
| 0x02 | 0x1 | Byte | Bitfield 
 | 
Texture Matrix Entry
| Offset | Size | Type | Description | 
|---|---|---|---|
| 0x00 | 0x8 | Vector2 | Translation | 
| 0x08 | 0x4 | Single | Rotation | 
| 0x0C | 0x8 | Vector2 | Scale | 
Texture Coordinate Generation Entry
| Offset | Size | Type | Description | ||||
|---|---|---|---|---|---|---|---|
| 0x00 | 0x1 | UInt8 | Type 
 | ||||
| 0x08 | 0x1 | UInt8 | Source (N = Tex N, max 2) | ||||
| 0x0C | 0x2 | UInt8[] | Padding | 
TODO: tevStage, alphaCompare, blendMode, etc...
pan1 (Pane 1)
| Offset | Size | Type | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x00 | 0x4 | String | Signature (pan1) | ||||||||
| 0x04 | 0x4 | UInt32 | Section Size | ||||||||
| 0x08 | 0x1 | UInt8 | Flags 
 | ||||||||
| 0x09 | 0x1 | UInt8 | Origin | ||||||||
| 0x0A | 0x1 | UInt8 | Alpha | ||||||||
| 0x0B | 0x1 | UInt8 | Padding | ||||||||
| 0x0C | 0x10 | String | Pane name | ||||||||
| 0x1C | 0x8 | String | Data | ||||||||
| 0x24 | 0xC | Vector3 | Translation | ||||||||
| 0x30 | 0xC | Vector3 | Rotation | ||||||||
| 0x3C | 0x8 | Vector2 | Scale | ||||||||
| 0x44 | 0x8 | Vector2 | Size | 
pic1 (Picture 1)
pic1 represents a picture that can be displayed in a layout. The previous 0x4C bytes are all defined by pan1.
| Offset | Size | Type | Description | 
|---|---|---|---|
| 0x4C | 0x4 | RGBA8 | Top left vertex color | 
| 0x50 | 0x4 | RGBA8 | Top right vertex color | 
| 0x54 | 0x4 | RGBA8 | Bottom left vertex color | 
| 0x58 | 0x4 | RGBA8 | Bottom right vertex color | 
| 0x5C | 0x2 | UInt16 | Material ID | 
| 0x5E | 0x2 | UInt16 | Nr texture coordinates = N | 
| Texture coordinates entry | |||
| 0x60 + N*0x20 | 0x8 | Vector2 | Top left vertex texture coordinate | 
| 0x60 + N*0x20 | 0x8 | Vector2 | Top right vertex texture coordinate | 
| 0x60 + N*0x20 | 0x8 | Vector2 | Bottom left vertex texture coordinate | 
| 0x60 + N*0x20 | 0x8 | Vector2 | Bottom right vertex texture coordinate | 
txt1 (Text 1)
wnd1 (Window 1)
bnd1 (Bounding 1)
Same data structure as Panes.
pas1 (Pane Start 1)
Starts a pane.
| Offset | Size | Type | Description | 
|---|---|---|---|
| 0x00 | 0x4 | String | Signature (pas1) | 
| 0x04 | 0x4 | UInt32 | Section Size | 
pae1 (Pane End 1)
Ends a pane.
| Offset | Size | Type | Description | 
|---|---|---|---|
| 0x00 | 0x4 | String | Signature (pae1) | 
| 0x04 | 0x4 | UInt32 | Section Size | 
grp1 (Group 1)
| Offset | Size | Type | Description | 
|---|---|---|---|
| 0x00 | 0x4 | String | Signature (grp1) | 
| 0x04 | 0x4 | UInt32 | Section Size | 
| 0x08 | 0x10 | String | Group Name | 
| 0x18 | 0x4 | UInt32 | Nr Pane References (=N) | 
| 0x1C | 0x10 * N | String[N] | Pane References | 
grs1 (Group Start 1)
Starts a group.
| Offset | Size | Type | Description | 
|---|---|---|---|
| 0x00 | 0x4 | String | Signature (grs1) | 
| 0x04 | 0x4 | UInt32 | Section Size | 
gre1 (Group End 1)
Ends a group.
| Offset | Size | Type | Description | 
|---|---|---|---|
| 0x00 | 0x4 | String | Signature (gre1) | 
| 0x04 | 0x4 | UInt32 | Section Size | 
usd1 (User Data 1)
Contains a map with strings as keys and variable values
| Offset | Size | Type | Description | 
|---|---|---|---|
| 0x00 | 0x4 | String | Signature (usd1) | 
| 0x04 | 0x4 | UInt32 | Section Size | 
| 0x08 | 0x4 | UInt32 | Number of entries (= N) | 
| 0x12 | 0x12 * N | Entries[] | Entries | 
| 0x12 + 0x12 * N | ? | Variable | Values referred to by the entries | 
Where an entry is as follows:
| Offset | Size | Type | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0 | 0x4 | UInt32 | Key: offset (from start of this entry) to null-terminated ascii string | ||||||||
| 0x4 | 0x4 | UInt32 | Value: offset (from start of this entry) to a value (type decided by last field) | ||||||||
| 0x8 | 0x2 | UInt16 | Amount or, if a string, the length of the value(s) | ||||||||
| 0xA | 0x2 | UInt16 | Value type 
 | 
Tools
- Every File Explorer has limited support for viewing these
See also
http://florian.nouwt.com/wiki/index.php/CLYT_%28File_Format%29 https://github.com/Gericom/EveryFileExplorer/tree/master/3DS/NintendoWare/LYT1