[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PaintWorks Animation Format - 12 byte chunk only



Ken Richardson (KCR103@psuvm.psu.edu) wrote:
: Sometime between yesterday and today a little gremlin stole my
: May/June copy of GS+ with the FLI convert info.  I need to
: know the 12 byte chunk of the PaintWorks Animation file that
: contains the length, speed etc.  Thanks.  Ken

It seems I kinda know the format on this one...although it was never
officially defined...

At the start of the file is 32,768 bytes of screen data, including palettes
and SCBs. At offset $8000 (32,768), there is a longword giving the length of
the file minus $8008 (32,776). Then, there is a word containing the delay
between frames in ticks. The next word was not officially defined, and
you should ignore it when reading a file, and store a $000C in it when
writing a file. The next longword was also undefined, and you should ignore
it when reading, and store a duplicate of the length-minus-32,776 longword
when writing. After that, there is the animation data block, which consists
of pairs of words. The first word in a pair is an offset into screen
memory, and the second word is a word value to store there. A zero in the
offset word marks the end of a frame. This is stupid, because the first
byte of screen memory can't be modified!

To play back an animation, load the screen data into screen memory, copy
the length and speed data into local storage, and then process the animation
data block. When you come to a zero offset word, do an appropriate delay, and
go to the next frame. There is no end-of-file value, so keep track of the
length longword, subtract 4 from it, and you have the length of the animation
data block.

If there are inaccuracies in this posting, I apologize. Also, the format was
not officially defined, so be careful, and never look at the undefined
fields. I'd like to thank Greg Templeman <softdisk.inc@genie.geis.com> for
the format info.

- Rolf Braun
- Apple IIgs Programmer
- Sassy Software
- Internet e-mail: rbraun@hopper.itc.virginia.edu