In case anyone was wondering, here is how the header is made for TIM2 files:
typedef struct
{
char FileId[4]; // ID of the File (must be 'T', 'I', 'M' and '2')
BYTE FormatVersion; // Version number of the format
BYTE FormatId; // ID of the format
WORD Pictures; // Number of picture data
char Reserved[8]; // Padding (must be 0x00)
} TIM2_FILEHEADER;
typedef struct
{
DWORD TotalSize; // Total size of the picture data in bytes
DWORD ClutSize; // CLUT data size in bytes
DWORD ImageSize; // Image data size in bytes
WORD HeaderSize; // Header size in bytes
WORD ClutColors; // Total color number in CLUT data
BYTE PictFormat; // ID of the picture format (must be 0)
BYTE MipMapTextures;// Number of MIPMAP texture
BYTE ClutType; // Type of the CLUT data
BYTE ImageType; // Type of the Image data
WORD ImageWidth; // Width of the picture
WORD ImageHeight; // Height of the picture
BYTE GsTex0[8]; // Data for GS TEX0 register
BYTE GsTex1[8]; // Data for GS TEX1 register
DWORD GsRegs; // Data for GS TEXA, FBA, PABE register
DWORD GsTexClut; // Data for GS TEXCLUT register
} TIM2_PICTUREHEADER;
typedef struct
{
char FileId[4]; // ID of the File (must be 'T', 'I', 'M' and '2')
BYTE FormatVersion; // Version number of the format
BYTE FormatId; // ID of the format
WORD Pictures; // Number of picture data
char Reserved[8]; // Padding (must be 0x00)
} TIM2_FILEHEADER;
typedef struct
{
DWORD TotalSize; // Total size of the picture data in bytes
DWORD ClutSize; // CLUT data size in bytes
DWORD ImageSize; // Image data size in bytes
WORD HeaderSize; // Header size in bytes
WORD ClutColors; // Total color number in CLUT data
BYTE PictFormat; // ID of the picture format (must be 0)
BYTE MipMapTextures;// Number of MIPMAP texture
BYTE ClutType; // Type of the CLUT data
BYTE ImageType; // Type of the Image data
WORD ImageWidth; // Width of the picture
WORD ImageHeight; // Height of the picture
BYTE GsTex0[8]; // Data for GS TEX0 register
BYTE GsTex1[8]; // Data for GS TEX1 register
DWORD GsRegs; // Data for GS TEXA, FBA, PABE register
DWORD GsTexClut; // Data for GS TEXCLUT register
} TIM2_PICTUREHEADER;
nthego: