-
Notifications
You must be signed in to change notification settings - Fork 7
Home
This wiki shows documentations of Gfx2 (.gtx) file format.
The file header consists of 32 bytes:
Offset: 0x00
Size: 4
Description: Magic number, always 0x47 0x66 0x78 0x32 (Gfx2)
Offset: 0x04
Size: 4
Description: Size of header in bytes - must match exactly, or header (and hence file) is unreadable, always 0x20
Offset: 0x08
Size: 4
Description: Major version number - must match exactly or header is unreadable, always 0x07 in NSMBU
Offset: 0x0C
Size: 4
Description: Minor version number - will warn if lower, always 0x01 in NSMBU
Offset: 0x10
Size: 4
Description: GPU version for which this file is designed for, cast to u32 (file is GPU dependent after all), always 0x02 in NSMBU
Offset: 0x14
Size: 4
Description: Align mode of this file, always 0x01 in NSMBU
Offset: 0x18
Size: 4
Description: Padding, always 0x00
Offset: 0x1C
Size: 4
Description: Padding, always 0x00
The block header directly follows the file header, it consists of 32 bytes:
Offset: 0x00
Size: 4
Description: Magic number for block headers, always 0x42 0x4C 0x4B 0x7B (BLK{)
Offset: 0x04
Size: 4
Description: Size of block header in bytes, always 0x20
Offset: 0x08
Size: 4
Description: Major version number - must match exactly or this block is unreadable, always 0x01 in NSMBU
Offset: 0x0C
Size: 4
Description: Minor version number - will warn if lower, always 0x00 in NSMBU
Offset: 0x10
Size: 4
Description: Block type, it determines the type of the following data
Offset: 0x14
Size: 4
Description: Size of the following data block, in bytes, always 0x9C if the block type is 0x0B
Offset: 0x18
Size: 4
Description: A unique identifier for this block, allowing it to be referenced by other blocks, always 0x00
Offset: 0x1C
Size: 4
Description: An incrementing index for each instance of a given type, always 0x00
The image info directly follows the block header that has a block type 0x0B:
Offset: 0x00
Type: Unknow
Size: 4 bytes
Description: Dimension
Offset: 0x04
Type: u32
Size: 4 bytes
Description: Width
Offset: 0x08
Type: u32
Size: 4 bytes
Description: Height
Offset: 0x0C
Type: u32
Size: 4 bytes
Description: Depth
Offset: 0x10
Type: u32
Size: 4 bytes
Description: Number of Mips
Offset: 0x14
Type: Unknown
Size: 4 bytes
Description: Format
Offset: 0x18
Type: Unknown
Size: 4 bytes
Description: AA Mode
Offset: 0x1C
Type: Unknown
Size: 4 bytes
Description: Use of this file (texture, shader, etc...)
Offset: 0x20
Type: u32
Description: Image size
Offset: 0x24
Type: u32
Size: 4 bytes
Description: Image Pointer
Offset: 0x28
Type: u32
Size: 4 bytes
Description: Mip size
Offset: 0x2C
Type: u32
Size: 4 bytes
Description: Mip Pointer
Offset: 0x30
Type: Unknown
Size: 4 bytes
Description: Tile mode
Offset: 0x34
Type: u32
Size: 4 bytes
Description: Swizzle
Offset: 0x38
Type: u32
Size: 4 bytes
Description: Alignment
Offset: 0x3C
Type: u32
Size: 4 bytes
Description: Pitch
Offset: 0x40
Type: u32
Size: 13 bytes
Description: Mip Offset
The (swizzled) image data directly follows the block header that has a block type 0x0C
The (swizzled) image mipmap data directly follows the block header that has a block type 0x0D
WIP, coming soon.
©2016 AboodXD.