[comp.sys.atari.8bit] MicroIllustrator file format

langdon@lll-lcc.UUCP (02/03/87)

There were questions about the format of these picture files.
Here it is (below). I also have an Action program that
reads and displays them.
----------------------------------------------------------------------
	Bruce Langdon  L-472                langdon@lll-lcc.ARPA
	Physics Department                  "langdon#bruce%d@lll-mfe.ARPA"
	Lawrence Livermore National Laboratory       
	Livermore, CA 94550                 (415) 422-5444
UUCP: ..{ihnp4,qantel,ucdavis,pyramid,styx,topaz}!lll-lcc!langdon
                  ..{gymble,ll-xn,seismo}!lll-crg!lll-lcc!langdon
----------------------------------------------------------------------
Picture Data Format
        for
 MicroIllustrator
        and
   Koala Painter
        and
    AtariArtist


  Each file consists of two sections,
a header and the data.

Header:

Offset  Description
------  -----------------------------
$00-03  ID sequence: $FF,$80,$C9,$C7
$04-05  # bytes in header (-1)
        usually $1A,$00
$06     Revision #: $01
$07     Compression type: $00=none,
        $01=vertival, $02=horizontal
$08     Graphics mode: xx00yyyy where
        xx=GTIA bits from GPRIOR and
        yyyy=ANTIC mode. Nprmally $0E
$09-0C  Active screen area (L,R,T,B)
        $00,$2B,$00,$C0
$0D-11  Color register data for
        COLOR0 thru COLOR4
$12-13  Total length of file: lsb,msb
$14-15  Unused: $00,$00
$16-19  Reserved: $9B,$9B,$9B,$9B
$1A     Unused: $A2

The data follows immediately.  If
uncompressed, then it is in screen
RAM order.

In horizontal compression, the data
will fill memory on order (fill each
row on the screen left to right, top
to bottom.

In vertical compression, The data
fills a 1-byte column, every other
row, followed by the skipped row,
then on to the next column.

Compressed data consists of variable
length records.  The first byte of
each record determines the type of
record.  Format:

 1st byte  2nd byte  3rd byte  
<--------><--------><--------><....>>
|0|Cnt<>0 | Data    |
   Cnt bytes of repeated Data
|1|Cnt<>0 | Unique  | Data    | ...
   Cnt bytes of unique data
|0|   0   | msb Cnt | lsb Cnt | Data|
   Cnt (>127) bytes of repeated data
|1|   0   | msb Cnt | lsb Cnt |data|..
   Cnt (>127) bytes of unique data


The subroutine READPIC.MAC will read
a picture file onto a mode E or F
screen (assumed).  It only looks at
the compression type and color values
in the header and assumes that the
picture area and mode are compatible
with a full screen mode E or F
picture.
----------------------------------------------------------------------