DEGAS Elite Compressed file format

From Atari Wiki
Jump to navigation Jump to search
DEGAS Elite (Compressed)        *.PC1 (low resolution)
                                *.PC2 (medium resolution)
                                *.PC3 (high resolution)
 
1 word          resolution (same as Degas, but high order bit is set;
                i.e., hex 8000 = low res, hex 8001 = medium res,
                hex 8002 = high res).  Other bits may be used in the
                future; use a simple bit test rather than checking
                for specific word values.
16 words        palette
                For high resolution pictures the least significant bit of
                the first word determines whether the picture is black on 
                white (bit set) or white on black (bit not set)
< 32000 bytes   control/data bytes
4 words         left color animation limit table (starting color numbers)
4 words         right color animation limit table (ending color numbers)
4 words         animation channel direction flag [0 = left, 1 = off, 2 = right]
4 words         128 - animation channel delay in 1/60's of a second. [0 - 128]
                (I.e., subtract word from 128 to get 1/60th's of a second.)
-----------
< 32066 bytes   total
 
Compression Scheme:
 
   PackBits compression is used (see below).  Each scan line is compressed
separately; i.e., all data for a given scan line appears before any data
for the next scan line.  The scan lines are specified from top to bottom
(i.e., 0 is first).  For each scan line, all the data for a given bit plane
appears before any data for the next higher order bit plane.  Note that this
is identical to the IFF 'BODY' image data.
   To clarify:  The first data in the file will be the data for the lowest
order bit plane of scan line zero, followed by the data for the next higher
order bit plane of scan line zero, etc., until all bit planes have been
specified for scan line zero.  The next data in the file will be the data
for the lowest order bit plane of scan line one, followed by the data for
the next higher order bit plane of scan line one, etc., until all bit planes
have been specified for all scan lines.
 
Caveats:
 
   DEGAS Elite's picture loading routine places some restrictions on
compressed DEGAS files:
 
        o Elite uses a 40-byte buffer to store data being decompressed.
 
        o Whenever a control command is encountered, bytes are stuffed
        in this buffer.
 
        o The buffer is only emptied when there are EXACTLY 40
        characters in it.
 
The important conclusion here is that
 
        No control command may cause the buffer to have more than 40
        bytes in it.  In other words, all control commands must end on
        or before the 40-byte boundary.
 
Any picture violating the last condition will cause Elite to get a bus
error when the picture is loaded.

See also PackBits Compression Algorithm

Back to ST Picture Formats