diff --git a/File-formats-structures.md b/File-formats-structures.md new file mode 100644 index 0000000..95741ce --- /dev/null +++ b/File-formats-structures.md @@ -0,0 +1,39 @@ +## File formats structures + +### TIM + +See http://psx.arthus.net/sdk/Psy-Q/DOCS/FileFormat47.pdf , p.179 + +```c +typedef struct RGB_PIX { + u_int R:5, G:5, B:5, STP:1; + } RGB_PIX; + +// Some structures to handle TIM files +typedef struct PIXEL { + u_long bnum; + u_short DX, DY; + u_short W, H; + RGB_PIX data[]; +} PIXEL; + +typedef struct CLUT { + u_long bnum; + u_short DX, DY; + u_short W, H; + u_short clut[]; +} CLUT; + +typedef struct TIM_FILE_CLUT{ + u_long ID; + u_long flag; + u_long clut; + PIXEL pixel[]; +} TIM_FILE_CLUT; + +typedef struct TIM_FILE{ + u_long ID; + u_long flag; + PIXEL pixel[]; +} TIM_FILE; +```