/* 2FASTNC Converts compressed IFF file to fast loading MCGA format */
/* This version does not save the palette, only width and height */
/* use C O M P A C T MODE!!! */
4 bytes "FORM" (FORM chunk ID)
1 long length of file that follows
4 bytes "ILBM" (InterLeaved BitMap file ID)
4 bytes "BMHD" (BitMap HeaDer chunk ID)
1 long length of chunk [20]
20 bytes 1 word = image width in pixels
1 word = image height in lines
1 word = image x-offset [usually 0]
1 word = image y-offset [usually 0]
1 byte = # bitplanes
1 byte = mask (0=no, 1=impl., 2=transparent, 3=lasso)
1 byte = compressed [1] or uncompressed [0]
1 byte = unused [0]
1 word = transparent color (for mask=2)
1 byte = x-aspect [5=640x200, 10=320x200/640x400, 20=320x400]
1 byte = y-aspect [11]
1 word = page width (usually the same as image width)
1 word = page height (usually the same as image height)
4 bytes "CMAP" (ColorMAP chunk ID)
1 long length of chunk [3*n where n is the # colors]
3n bytes 3 bytes per RGB color. Each color value is a byte
and the actual color value is left-justified in the
byte such that the most significant bit of the value
is the MSB of the byte. (ie. a color value of 15 ($0F)
is stored as $F0) The bytes are stored in R,G,B order.
4 bytes "CRNG" (Color RaNGe chunk ID)
1 long length of chunk [8]
8 bytes 1 word = reserved [0]
1 word = animation speed (16384 = 60 steps per second)
1 word = active [1] or inactive [0]
1 byte = left/lower color animation limit
1 byte = right/upper color animation limit
4 bytes "CAMG" (Commodore AMiGa viewport mode chunk ID)
1 long length of chunk [4]
1 long viewport mode bits (bit 11 = HAM, bit 3 = interlaced)
4 bytes "BODY" (BODY chunk ID)
1 long length of chunk [# bytes of image data that follow]
? bytes actual image data
NOTES: Some of these chunks may not be present in every IFF file, and may
not be in this order. You should always look for the ID bytes to find a
certain chunk. All chunk IDs are followed by a long value that tells the
size of the chunk (note that "ILBM" is not a chunk ID). This is the number of
bytes that FOLLOW the 4 ID bytes and size longword. The exception to this is
the FORM chunk. The size longword that follows the FORM ID is the size of the
remainder of the file. The FORM chunk must always be the first chunk in an
IFF file.