Grand Prix Legends .MIP File Format by P.A.Flack 1998
contact: phil@flack99.freeserve.co.uk
last revised 21/Dec/'98
MIP files, or Multiple Image Pictures are used for textures requiring different resolution versions of the same picture, so that at a distance there is less data to display, and up close the image looks good.  All MIP's start with the same header:
 
Bytes Values Notes
0-3 
4-7 
8-11
"PIM " 
0x00000000 
data size
Section Type (last char is a space - 0x20) 

size of following data

After the header section comes the real header section:
 

Bytes Values Notes
0-3 
4-7 
8-11 
12 
13-16 
17-20 
21-24 
25 
26-29 
30-31
"DHPM" 
0x00000000 
data size 
0,1, 2, ?other? 
power width 
power height 
average colour? 
unknown- 0,1,2,3 
no. of images 
padding
Section Type 

size of following data (generally 0x12 - doesn't include padding bytes 30&31) 
Specifies type of MIP file (see next section) 
if this is e.g. 8, maximum images width is 2^8=256 pixels 
same but for height 
seems to be the average colour, for when the image is drawn tiny (1x1 or 2x2 pixels) 
can't find a reason for this - only seen as 0, 1, 2 or 3 (0/3 mostly) 
number of images in the file 
two 0x20 padding bytes to get size up to a multiple of 4

The MIP type (byte 12 of the MPHD section) is either 0, 1 or 2, but maybe some other values:

0: Image is completely opaque, i.e. all CMAP (later) entries have the alpha channel set to 0xff
1: Image has transparent parts, i.e. CMAP entries range from 0x00 to 0xff.
2: Each image has it's own CMAP, with no general CMAP, i.e. each image has a different palette.
other: Each image is 16bit (?)

- the only check needed at this stage is if the type is 0 or 1.  If so, there follows a CMAP section

Next follows a series of Bitmaps, each with their own header, data, and sometimes CMAP sections - but this can be determined from the BMAP header.



contact: phil@flack99.freeserve.co.uk
last revised 21/Dec/'98