https://mk8.tockdom.com/w/api.php?action=feedcontributions&user=Random0666&feedformat=atom
MK8 - User contributions [en]
2024-03-29T12:10:10Z
User contributions
MediaWiki 1.35.14
https://mk8.tockdom.com/w/index.php?title=BFLYT_(File_Format)&diff=4693
BFLYT (File Format)
2018-04-02T14:59:03Z
<p>Random0666: /* txt1 */</p>
<hr />
<div>'''BFLYT''' ('''B'''inary ca'''F'''e '''L'''a'''Y'''ou'''T''') is an updated format for [[:mkw:BRLYT (File Format)|BRLYT]] files on the Wii. It contains 2D layout information.<br />
<br />
= Format =<br />
== Header ==<br />
The file starts with a header which is 0x14 bytes long.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x00 || String || '''File magic'''. Always ''FLYT'' in ASCII.<br />
|-<br />
| 0x04 || UInt16 || {{BOM}}<br />
|-<br />
| 0x06 || UInt16 || Header size.<br />
|-<br />
| 0x08 || UInt32 || Version.<br />
|-<br />
| 0x0C || UInt32 || File size.<br />
|-<br />
| 0x10 || UInt16 || Number of sections.<br />
|-<br />
| 0x12 || UInt16 || Padding.<br />
|}<br />
<br />
== Sections ==<br />
After the header comes first 4 sections, where 3 of them are optional. Then comes all the panes and then the groups.<br />
<br />
=== lyt1 ===<br />
The ''lyt1'' section contains general information about the layout.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x00 || String || '''Section magic'''. Always ''lyt1'' in ASCII.<br />
|-<br />
| 0x04 || UInt32 || Section size.<br />
|-<br />
| 0x08 || Byte || Drawn from center. <br />
|-<br />
| 0x09 || Byte[3] || Padding.<br />
|-<br />
| 0x0C || Float || '''Width''' of the layout.<br />
|-<br />
| 0x10 || Float || '''Height''' of the layout.<br />
|-<br />
| 0x14 || Float || ''Max parts height''. '''Unknown meaning'''.<br />
|-<br />
| 0x18 || Float || ''Max parts height''. '''Unknown meaning'''.<br />
|-<br />
| 0x1C || Float || Layout name.<br />
|}<br />
<br />
=== txl1 ===<br />
The ''txl1'' section is a list of external [[BFLIM]] references.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x00 || String || '''Section magic'''. Always ''txl1'' in ASCII.<br />
|-<br />
| 0x04 || UInt32 || Section size.<br />
|-<br />
| 0x08 || UInt16 || '''N''' = Number of textures.<br />
|-<br />
| 0x0A || UInt16 || Padding.<br />
|-<br />
| 0x0C || UInt32['''N'''] || '''Texture string offsets'''. Links to null-termined strings.<br />
|}<br />
<br />
=== fnl1 ===<br />
The ''fnl'' section is a font list. It links to external [[BFFNT]] files.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x00 || String || '''Section magic'''. Always ''fnl1'' in ASCII.<br />
|-<br />
| 0x04 || UInt32 || Section size.<br />
|-<br />
| 0x08 || UInt16 || '''N''' = Number of fonts.<br />
|-<br />
| 0x0A || UInt16 || Padding.<br />
|-<br />
| 0x0C || UInt32['''N'''] || '''Font string offsets'''. Links to null-termined strings.<br />
|}<br />
<br />
=== mat1 ===<br />
The ''mat1'' section stores materials. It is currently unknown.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x00 || String || '''Section magic'''. Always ''mat1'' in ASCII.<br />
|-<br />
| 0x04 || UInt32 || '''S''' = Section size.<br />
|-<br />
| 0x08 || Byte['''S'''] || {{Unknown-left|Material data.}}<br />
|}<br />
<br />
=== pas1 ===<br />
The ''pas1'' section indicates start of children pane data.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x00 || String || '''Section magic'''. Always ''pas1'' in ASCII.<br />
|-<br />
| 0x04 || UInt32 || Section size.<br />
|}<br />
<br />
=== pae1 ===<br />
The ''pas1'' section indicates end of children pane data.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x00 || String || '''Section magic'''. Always ''pae1'' in ASCII.<br />
|-<br />
| 0x04 || UInt32 || Section size.<br />
|}<br />
<br />
=== pan1 ===<br />
The ''pan1'' section contains information about a null pane, a pane that isn't visible. The root pane is always a pan1 called "RootPane". Other pane sections start with this structure and then has additional data. The only difference is that the magic is changed.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x00 || String || '''Section magic'''. Always ''pan1'' in ASCII.<br />
|-<br />
| 0x04 || UInt32 || Section size.<br />
|-<br />
| 0x08 || Byte || Flag 1. '''xxxx xxAB''':<br />
'''A''' = Influence alpha<br />
'''B''' = Visible<br />
|-<br />
| 0x09 || Byte || Flag 2. '''AABB CCDD''':<br />
'''A''' = Origin X where 0 = center, 1 = left, 2 = right<br><br />
'''B''' = Origin Y where 0 = center, 1 = top, 2 = bottom<br><br />
'''C''' = Parent origin X (same values as '''A''')<br><br />
'''D''' = Parent origin Y (same values as '''B''')<br />
|-<br />
| 0x0A || Byte || Alpha.<br />
|-<br />
| 0x0B || Byte || {{Unknown-left|'''Unknown'''.}}<br />
|-<br />
| 0x0C || String || '''Pane name'''. The string has a fixed length of 0x18, unused characters are set to 0.<br />
|-<br />
| 0x24 || String || '''User information'''. Unknown purpose. The string has a fixed length of 8, unused character are set to 0.<br />
|-<br />
| 0x2C || Float[3] || Pane translation in X, Y and Z directions.<br />
|-<br />
| 0x38 || Float[3] || Pane rotation in X, Y and Z directions.<br />
|-<br />
| 0x44 || Float[2] || Pane scale in X and Y directions.<br />
|-<br />
| 0x4C || Float[2] || Pane size in X and Y directions.<br />
|}<br />
<br />
=== pic1 ===<br />
The ''pic1'' section contains information about a picture pane.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x54 || Byte[4] || '''Top left''' vertex color in RGBA format.<br />
|-<br />
| 0x58 || Byte[4] || '''Top right''' vertex color in RGBA format.<br />
|-<br />
| 0x5C || Byte[4] || '''Bottom left''' vertex color in RGBA format.<br />
|-<br />
| 0x60 || Byte[4] || '''Bottom right''' vertex color in RGBA format.<br />
|-<br />
| 0x64 || UInt16 || '''[[#mat1|Material]]''' index.<br />
|-<br />
| 0x66 || Byte || '''Number of UV coordinates'''.<br />
|-<br />
| 0x67 || Byte || Padding.<br />
|}<br />
<br />
UV coordinates then follows with the following structures.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x00 || Float[2] || '''Top left''' UV coordinates.<br />
|-<br />
| 0x08 || Float[2] || '''Top right''' UV coordinates.<br />
|-<br />
| 0x10 || Float[2] || '''Bottom left''' UV coordinates.<br />
|-<br />
| 0x08 || Float[2] || '''Bottom right''' UV coordinates.<br />
|}<br />
<br />
=== txt1 ===<br />
The ''txt1'' section contains information about a text pane.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x54 || UInt16 || Text length.<br />
|-<br />
| 0x56 || UInt16 || Restricted text length.<br />
|-<br />
| 0x58 || UInt16 || [[#mat1|Material]] index.<br />
|-<br />
| 0x5A || UInt16 || [[#fnl1|Font index]].<br />
|-<br />
| 0x5C || Byte || Text alignment. xxxx AABB<br><br />
'''A''' = Horizontal where 0 = Center, 1 = Left, 2 = Right<br><br />
'''B''' = Vertical where 0 = Center, 1 = Left, 2 = Right<br><br />
|-<br />
| 0x5D || Byte || Line alignment.<br />
'''0''' = Not specified<br><br />
'''1''' = Left<br><br />
'''2''' = Center<br><br />
'''3''' = Right<br />
|-<br />
| 0x5E || Byte || Flag 1. '''xxxA BBCD'''<br />
'''A''' = Per Char Transform enabled<br><br />
'''B''' = Border format where 0 = standart, 1 = Delete Border, 2 = Render in two cycles<br><br />
'''C''' = Restricted text lenght enabled<br><br />
'''D''' = Shadow enabled<br />
|-<br />
| 0x5F || Byte || Padding.<br />
|-<br />
| 0x60 || Float || Italic tilt.<br />
|-<br />
| 0x64 || UInt32 || '''Text offset''', relative to the start of this pane. Links to the pane text which is stored in UTF-16 (big endian) as a null-termined string.<br />
|-<br />
| 0x68 || Byte[4] || Font top color in RGBA format.<br />
|-<br />
| 0x6C || Byte[4] || Font bottom color in RGBA format.<br />
|-<br />
| 0x70 || Float[2] || Font XY size.<br />
|-<br />
| 0x78 || Float || Character space.<br />
|-<br />
| 0x7C || Float || Line space.<br />
|-<br />
| 0x80 || UInt32 || '''Textbox name offset''', relative to the start of this pane. Links to the name of this textbox, stored in ASCII as a null-termined string.<br />
|-<br />
| 0x84 || Float[2] || Shadow XY.<br />
|-<br />
| 0x8C || Float[2] || Shadow XY size.<br />
|-<br />
| 0x94 || Byte[4] || Shadow top color in RGBA format.<br />
|-<br />
| 0x98 || Byte[4] || Shadow bottom color in RGBA format.<br />
|-<br />
| 0x9C || Float || Shadow italic.<br />
|-<br />
| 0xA0 || UInt32 || {{Unknown-left|'''Per character transform offset'''. Links to an unknown structure.}}<br />
|}<br />
<br />
=== wnd1 ===<br />
The ''wnd1'' pane contains information about a window pane. It is unknown how it works.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x54 || Int16 || Inflation left.<br />
|-<br />
| 0x56 || Int16 || Inflation right.<br />
|-<br />
| 0x58 || Int16 || Inflation top.<br />
|-<br />
| 0x5A || Int16 || Inflation bottom.<br />
|-<br />
| 0x5C || Int16 || Frame size left.<br />
|-<br />
| 0x5E || Int16 || Frame size right.<br />
|-<br />
| 0x60 || Int16 || Frame size top.<br />
|-<br />
| 0x62 || Int16 || Frame size bottom.<br />
|-<br />
| 0x64 || Byte || '''N''' = Number of frames.<br />
|-<br />
| 0x65 || Byte || {{Unknown-left|'''Window flag'''.}}<br />
|-<br />
| 0x66 || UInt16 || Padding.<br />
|-<br />
| 0x68 || UInt32 || [[#Window Content|Content]] offset.<br />
|-<br />
| 0x6C || UInt32 || Frame offset table offset. Links to a UInt32['''N'''} with offsets which links to [[#Window Frame|window frames]]. All offsets are relative to the start of the pane.<br />
|}<br />
<br />
==== Window Content ====<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x00 || Byte[4] || '''Top left''' vertex color in RGBA format.<br />
|-<br />
| 0x04 || Byte[4] || '''Top right''' vertex color in RGBA format.<br />
|-<br />
| 0x08 || Byte[4] || '''Bottom left''' vertex color in RGBA format.<br />
|-<br />
| 0x0C || Byte[4] || '''Bottom right''' vertex color in RGBA format.<br />
|-<br />
| 0x10 || UInt16 || [[#mat1|Material]] index.<br />
|-<br />
| 0x12 || Byte || '''Number of UV coordinates'''.<br />
|-<br />
| 0x13 || Byte || Padding.<br />
|}<br />
<br />
UV coordinates then follows with the following structures.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x00 || Float[2] || '''Top left''' UV coordinates.<br />
|-<br />
| 0x08 || Float[2] || '''Top right''' UV coordinates.<br />
|-<br />
| 0x10 || Float[2] || '''Bottom left''' UV coordinates.<br />
|-<br />
| 0x08 || Float[2] || '''Bottom right''' UV coordinates.<br />
|}<br />
<br />
==== Window Frame ====<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x00 || UInt16 || [[#mat1|Material]] index.<br />
|-<br />
| 0x02 || Byte || Texture flip.<br />
|-<br />
| 0x03 || Byte || Padding.<br />
|}<br />
<br />
=== bnd1 ===<br />
The ''bnd1'' section is a boundary pane. It has unknown purpose and no additional data follows the pane.<br />
<br />
=== prt1 ===<br />
The ''prt1'' section is an unknown pane. Unknown additional data follows the pane.<br />
<br />
=== grs1 ===<br />
The ''grs1'' section indicates start of group children data.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x00 || String || '''Section magic'''. Always ''grs1'' in ASCII.<br />
|-<br />
| 0x04 || UInt32 || Section size.<br />
|}<br />
<br />
=== gre1 ===<br />
The ''gre1'' section indicates end of group children data.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x00 || String || '''Section magic'''. Always ''gre1'' in ASCII.<br />
|-<br />
| 0x04 || UInt32 || Section size.<br />
|}<br />
<br />
=== grp1 ===<br />
The ''grp1'' section contains information about a group.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x00 || String || '''Section magic'''. Always ''grp1'' in ASCII.<br />
|-<br />
| 0x04 || UInt32 || Section size.<br />
|- bgcolor="#AAFFAA"<br />
| colspan="4" align="center" | '''if BFLYT version < 5.2.0.0'''<br />
|- bgcolor="#DDFFDD"<br />
| 0x08 || String || '''Group name'''. The string has a fixed length of 0x18, unused characters are set to 0.<br />
|- bgcolor="#DDFFDD"<br />
| 0x20 || UInt16 || Number of children.<br />
|- bgcolor="#DDFFDD"<br />
| 0x22 || UInt16 || Padding.<br />
|- bgcolor="#FFAAAA"<br />
| 0x08 || String || '''Group name'''. The string has a fixed length of 0x22, unused characters are set to 0.<br />
|- bgcolor="#FFDDDD"<br />
| 0x2A || UInt16 || Number of children.<br />
|}<br />
<br />
The section follows by children names. The amount is given by "Number of children". Each string has a fixed length of 0x18, unused characters are set to 0.<br />
<br />
=== cnt1 ===<br />
''Unknown''.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x00 || String || '''Section magic'''. Always ''cnt'' in ASCII.<br />
|-<br />
| 0x04 || UInt32 || '''S''' = Section size.<br />
|-<br />
| 0x08 || Byte['''S''' - 8] || {{Unknown-left|'''Unknown data'''}}.<br />
|}<br />
<br />
=== usd1 ===<br />
The ''usd1'' section contains user data, generic data set by the creator. User data can be attached to any pane section. The section follows directly after the section it is attached to.<br />
<br />
{|class="wikitable"<br />
|-<br />
! Offset !! Type !! Description<br />
|-<br />
| 0x00 || String || '''Section magic'''. Always ''usd1'' in ASCII.<br />
|-<br />
| 0x04 || UInt32 || '''S''' = Section size.<br />
|-<br />
| 0x08 || Byte['''S''' - 8] || {{Unknown-left|'''Unknown data'''}}.<br />
|}<br />
<br />
= Tools =<br />
The following tool can handle BFLYT files:<br />
* [https://www.dropbox.com/s/7ni9vf43e0o7fxz/BenzinU.exe?dl=0 BenzinU], by [[User:diddy81|diddy81]]<br />
* [[Wexos's Toolbox]], by [[Wexos]]<br />
<br />
[[Category:File Format]]</div>
Random0666