CrackArt file format

From AtariForumWiki
Jump to navigation Jump to search
CarckArt        *.CA1 (low resolution)
                *.CA2 (medium resolution)
                *.CA3 (high resolution)
 
1 word          'CA' crackart magic
1 byte          compression: 00 = uncompressed, 01 = compressed
1 byte          resolution: 00 = low res, 01 = medium res, 02 = high res
?? words        palette
                For low res pictures there are 16 palette entries
                For med res pictures there are 4 palette entries
                For high res pictures there are 0 palette entries
?? bytes        Picture data:
                For uncompressed pictures 32000 bytes follow
                For compressed pictures the compressed data follows

-----------
< 32057 bytes   total

CrackArt data compression:
1 byte          Escape character
1 byte          Delta: initially the 32000 screen memory are 
                filled with the delta byte
1 word          Offset: offset between two packed bytes;
                Offset is added to the current byte position
                to calculate the next byte position. When the 
                next byte position is greater 32000, the next 
                byte position is the first position of screen 
                memory not written to
                if Offset = 0, the whole screen if filled with 
                the delta byte, no packed bytes follow

1 byte          Cmd: Command byte
                Cmd <> Escape character: Cmd = one literal byte
                Cmd = Escape charater:
                  read 1 control byte
                    0: read one byte, n, and one byte, b;
                       repeat b (n+1) times
                    1: read one word, n, and one byte, b;
                       repeat b (n+1) times
                    2: read one byte, if zero: stop else read 
                       one extra byte and to make word n:
                       repeat Delta (n+1) times
                    Escape character: output one escape charater
                    else: read one byte, b;
                       repeat b cmd times
Decompression stops when Escape 2,0 is found or 32000 bytes have been written

Back to ST Picture Formats