CLYT Format

CLYT Format

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.

OffsetSizeTypeDescription
0x000x4StringSignature (CLYT)
0x040x2UInt16Byte Order Mark
0x060x2UInt16Header Length
0x080x4UInt32Revision
0x0C0x4UInt32File Size
0x100x2UInt16Nr Sections
0x120x2UInt16Padding

lyt1 (Layout 1) #

OffsetSizeTypeDescription
0x000x4StringSignature (lyt1)
0x040x4UInt32Section Size
0x080x4UInt32Origin type

ValueMeaning
0Classic
1Normal
0x0C0x8Vector2Canvas Size

txl1 (Texture List 1) #

OffsetSizeTypeDescription
0x000x4StringSignature (txl1)
0x040x4UInt32Section Size
0x080x4UInt32Nr Textures = N
0x0CN * 4UInt32[]Texture Name Offsets (relative to the start of this array)

After this, the null terminated names follow.

fnl1 (Font List 1) #

OffsetSizeTypeDescription
0x000x4StringSignature (fnl1)
0x040x4UInt32Section Size
0x080x4UInt32Nr Fonts = N
0x0CN * 4UInt32[]Font Name Offsets (relative to the start of this array)

After this, the null terminated names follow.

mat1 (Materials 1) #

OffsetSizeTypeDescription
0x000x4StringSignature (mat1)
0x040x4UInt32Section Size
0x080x4UInt32Nr Materials = N
0x0CN * 4UInt32[]Material Entry Offsets (relative to the start of this section)

After this, the material entries follow.

OffsetSizeTypeDescription
0x000x14StringMaterial Name
0x140x4RGBA8Tev Color (Buffer Color?)
0x180x18RGBA8[6]Tev Constant Colors
0x300x4UInt32Flags / bitfield

BitFlag / data
0-1Nr texMap
2-3Nr texMatrix
4-5Nr texCoordGen
6-8Nr tevStage
9Has alphaCompare
10Has blendMode
11Use Texture Only

Texture Map Entry #

OffsetSizeTypeDescription
0x000x2UInt16Texture Index
0x020x1ByteBitfield

BitData
0-1Wrap S (Clamp = 0, Repeat = 1, Mirror = 2)
2-3Min Filter (0 = Near, 1 = Linear)
0x030x1ByteBitfield

BitData
0-1Wrap T (Clamp = 0, Repeat = 1, Mirror = 2)
2-3Mag Filter (0 = Near, 1 = Linear)

Texture Matrix Entry #

OffsetSizeTypeDescription
0x000x8Vector2Translation
0x080x4SingleRotation
0x0C0x8Vector2Scale

Texture Coordinate Generation Entry #

OffsetSizeTypeDescription
0x000x1UInt8Type

ValueMeaning
02x4 matrix
0x010x1UInt8Source (N = Tex N, max 2)
0x020x2UInt8[]Padding

TODO: tevStage, alphaCompare, blendMode, etc…

pan1(Pane 1) #

Defines a Null pane, used mostly to keep panes grouped in hierarchies or to control the children of a given pan1 without having to do so individually.

OffsetSizeTypeDescription
0x000x4StringSignature (pan1)
0x040x4UInt32Section Size
0x080x1UInt8Flags

BitFlag
0Visible
1InfluencedAlpha
2LocationAdjust
0x090x1UInt8Origin (1 = centered, 2 = right, 3 = left, )
0x0A0x1UInt8Alpha
0x0B0x1UInt8Padding
0x0C0x10StringPane name
0x1C0x8StringData
0x240xCVector3Translation
0x300xCVector3Rotation
0x3C0x8Vector2Scale
0x440x8Vector2Size

pic1(Picture 1) #

pic1 represents a picture that can be displayed in a layout. The first 0x4C bytes are defined the same as pan1 with minor differences.

OffsetSizeTypeDescription
0x000x4StringSignature (pic1)
0x040x4UInt32Section size (including the texture coordinates)
Same as pan1 from 0x8 to 0x4c
0x4C0x4RGBA8Top left vertex color
0x500x4RGBA8Top right vertex color
0x540x4RGBA8Bottom left vertex color
0x580x4RGBA8Bottom right vertex color
0x5C0x2UInt16Material ID
0x5E0x2UInt16Nr texture coordinates = N
Texture coordinates entry
0x60 + (N-1) * 0x200x8Vector2Top left vertex texture coordinate
0x64 + (N-1) * 0x200x8Vector2Top right vertex texture coordinate
0x68 + (N-1) * 0x200x8Vector2Bottom left vertex texture coordinate
0x6C + (N-1) * 0x200x8Vector2Bottom right vertex texture coordinate

txt1 (Text 1) #

A textbox used in layouts. The first 0x4C bytes are defined the same as pan1 with minor differences.

OffsetSizeTypeDescription
0x000x4StringSignature (txt1)
0x040x4UInt32Section size (including the textbox string)
Same as pan1 from 0x8 to 0x4c
0x4C0x2UnknownFlags (H Direction?)
0x4E0x2UnknownFlags (V Direction?)
0x500x4UInt32Material ID
0x540x2UnknownFlags (Line alignment?)
0x560x2UnknownPadding
0x580x4UInt32Offset from signature to beginning of the string
0x5C0x4RGBA8Font top color
0x600x4RGBA8Font bottom color
0x640x8Vector2Font scale
0x6C0x4FloatHorizontal font spacing
0x700x4FloatVertical font spacing
0x74User definedStringTextbox text (must be multiple of 4), can be usd1

wnd1 (Window 1) #

A more complex type of image pane, where the user can define the content, the corners and the sides of it, depending on what mode it’s set to.

OffsetSizeTypeDescription
0x000x4StringSignature (wnd1)
0x040x4UInt32Section size (including the texture coordinates)

Same as pan1 from 0x8 to 0x4c

0x4C0x4floatCoordinate 1
0x500x4floatCoordinate 2
0x540x4floatCoordinate 3
0x580x4floatCoordinate 4
0x5C0x1ByteNumber of frames (n)
0x5D0x1ByteFlag
0x5E0x2UInt16Padding
0x600x4UInt32Window content offset (Points to 0x68)
0x640x4UInt32Window frame offsets, offset to offsets of the materials for the frames. (W)
0x680x4RGBA8Content box top left vertex color
0x6C0x4RGBA8Content box top right vertex color
0x700x4RGBA8Content box bottom left vertex color
0x740x4RGBA8Content box bottom right vertex color
0x780x2UInt16Content box Material ID
0x7A0x2UInt16Number of Texture coordinates (N)

Texture coordinates entry

0x7C + (N-1) * 0x200x8Vector2Top left vertex texture coordinate
0x84 + (N-1) * 0x200x8Vector2Top right vertex texture coordinate
0x8C + (N-1) * 0x200x8Vector2Bottom left vertex texture coordinate
0x94 + (N-1) * 0x200x8Vector2Bottom right vertex texture coordinate

Window frames

0x(W)0x4 * nUInt32Offsets to frame materials
0x(W)0x4 * nWindow frame
OffsetSizeTypeDescription
0x0UInt160x2Frame Material ID
0x2Byte0x1Flip Type
0x3Byte0x1Padding

Below is a table of possible material flip types. (From Mario Kart Wii Wiki)

TypeDescription
0None
1Flip (Horizontal)
2Flip (Vertical)
3Rotate 90 Degrees
4Rotate 180 Degrees
5Rotate 270 Degrees

bnd1 (Bounding 1) #

Same data structure as Panes, but used to limit interaction with buttons.

OffsetSizeTypeDescription
0x000x4StringSignature (bnd1)
0x040x4UInt32Section size (including the texture coordinates)
Same as pan1 from 0x8 to 0x4c

pas1 (Pane Start 1) #

Marks the start of a pane hierarchy, with the parent being the previous pane.

OffsetSizeTypeDescription
0x000x4StringSignature (pas1)
0x040x4UInt32Section Size

pae1 (Pane End 1) #

Marks the end of a pane hierarchy.

OffsetSizeTypeDescription
0x000x4StringSignature (pae1)
0x040x4UInt32Section Size

grp1 (Group 1) #

Starts a pane group, which can be inside other pane groups.

OffsetSizeTypeDescription
0x000x4StringSignature (grp1)
0x040x4UInt32Section Size
0x080x10StringGroup Name
0x180x4UInt32Nr Pane References (=N)
0x1C0x10 * NString[N]Pane References

grs1 (Group Start 1) #

Starts a group hierarchy.

OffsetSizeTypeDescription
0x000x4StringSignature (grs1)
0x040x4UInt32Section Size

gre1 (Group End 1) #

Ends a group hierarchy.

OffsetSizeTypeDescription
0x000x4StringSignature (gre1)
0x040x4UInt32Section Size

usd1 (User Data 1) #

Contains a dictionary with strings as keys and variable values

OffsetSizeTypeDescription
0x000x4StringSignature (usd1)
0x040x4UInt32Section Size
0x080x4UInt32Number of entries (= N)
0xC0xC * N // VariableEntries[]Entries

User Entries #

Where an entry is as follows:

OffsetSizeTypeDescription
0x00x4UInt32Key offset (from start of this entry) to null-terminated ascii string that serves as key.
0x40x4UInt32Value offset (from start of this entry).
0x80x2UInt16Number of entries or string length.
0xA0x2UInt16Value type

ValueType
0x0String
0x1Int
0x2Float

Tools #

See also #

🔗 https://wiki.tockdom.com/wiki/BRLYT_(File_Format) 🔗 http://florian.nouwt.com/wiki/index.php/CLYT_%28File_Format%29 ( 🔗 Archived) 🔗 https://github.com/Gericom/EveryFileExplorer/tree/master/3DS/NintendoWare/LYT1 🔗 https://github.com/KillzXGaming/Switch-Toolbox/tree/master/File_Format_Library/FileFormats/Layout/CTR/Panes

Category:File formats