ICN Files

From PS2 Developer wiki
Jump to navigation Jump to search

ICN files are 3d models rendered in the Content Browser menu. They contain vertex data, animation data, and a texture.

ICN Header[edit | edit source]

Offset Length Description
0x00 0x04 Magic (0x10000)
0x04 0x04 Animation shape count
0x08 0x04 Texture type
0x0C 0x04 ?
0x10 0x04 Vertex count

Geometry[edit | edit source]

Offset Length Description
0x00 Vertex count Vertex

Animation Data[edit | edit source]

Animation Header[edit | edit source]

Offset Length Description
0x00 0x04 Tag (0x01)
0x04 0x04 Frame length
0x08 0x04 Animation speed (float)
0x0C 0x04 Play
0x10 0x04 Frame count

Animation Frames[edit | edit source]

Offset Length Description
0x00 Frame count Array of Frames

Texture[edit | edit source]

The texture is an optionally-compressed 128x128px ABGR1555 image.

When the Texture Type in the header is 0x07, the texture is uncompressed and can be used as a pixel buffer. Otherwise it must be RLE decompressed.

Compressed Texture[edit | edit source]

Offset Length Description
0x00 0x04 Compressed Size
0x04 Compressed Size Pixel (unsigned 16 bit integer)

RLE decompression algorithm

Offset = 0
Index = 0

WHILE Offset < Compressed Size
    Repetitions = Compressed[Offset]
    Offset = Offset + 1
    
    IF Repetitions < 0xFF00
        // Repeat same pixel
        Pixel = Compressed[Offset]
        Offset = Offset + 1
        
        LOOP < Repetitions
            Texture[Index] = Pixel
            Index = Index + 1
    ELSE
        // Unique pixels
        LOOP <= Repetitions
            Pixel = Compressed[Offset]
            Offset = Offset + 1
            Texture[Index] = Pixel
            Index = Index + 1

Data Types[edit | edit source]

Vertex[edit | edit source]

Offset Length Description
0x00 0x08 * Animation shape count Interleaved list of Positions for each animation shape
* 0x08 Normal
* 0x04 UV
* 0x04 Color

Position[edit | edit source]

Offset Length Description
0x00 0x02 X (integer)
0x02 0x02 Y (integer)
0x04 0x02 Z (integer)
0x06 0x02 W (unsigned int)

Normal[edit | edit source]

Offset Length Description
0x00 0x02 X (integer)
0x02 0x02 Y (integer)
0x04 0x02 Z (integer)
0x06 0x02 W (unsigned int)

UV[edit | edit source]

Offset Length Description
0x00 0x02 U (unsigned int)
0x02 0x02 V (unsigned int)

Color[edit | edit source]

Offset Length Description
0x00 0x01 R
0x01 0x01 G
0x02 0x01 B
0x03 0x01 A

Frame[edit | edit source]

Offset Length Description
0x00 0x04 Shape ID
0x04 0x04 Key count
0x08 0x08 ?
0x10 0x08 * Key count Frame Key

Frame Key[edit | edit source]

Offset Length Description
0x00 0x04 Time (float)
0x04 0x04 Value (float)