Format Name: Apple IIGS Paintworks Animation Format Used on: Apple IIGS only Size: Variable, minimum= 0x8010 bytes Compression: None. Unpacks to: 320x200x16 colors or 640x200x4 colors or mix thereof; uses at most 256 colors from 4096 (2^12) possibilities. Number of frames of animation varies by file. Only video stored internally; sound is not supported. Filename Extensions: None defined (not used on Apple IIs) ProDOS Filetypes: Filetype $C2, Auxtype $xxxx The Paintworks Animation Format was initially used by the program Paintworks Plus for the Apple IIGS to create and playback simple movies. As an open file format, many other programs could write these. No viewers for other platforms exist to my knowledge. The file is displayed to the Apple IIGS screen, so it is recommended to read over the 'Apple IIGS Super Hires Screen Image' file format before writing a converter. Conventions: bit[7..0] is one byte, with 0 in the least significant place. A word is 2 bytes, least significant byte stored first in ram: bits[7..0], bits [15..8]. A 'long' is 4 bytes, stored bits [7..0], bits [15..8], bits [23..16], bits [31..24]. All hexadecimal numbers will be prefaced with the C-style '0x'; all other numbers may be assumed to be base 10. A 'Pascal String' consists of a length byte followed by the ascii characters in the string, no terminator. To read one word, this code fragment may help: short readword(char *ptr) { return ((*ptr) + ((*(ptr+1))<<8)); } long readlong(chat *ptr) { return (readword(ptr) + (readword(ptr+2)<<16)); } File format: each animation file has 3 pieces internally. The first is of length 0x8000 bytes (32K), and contains one screen image which is the first frame of the file. The second block is of length 0x10 bytes, and is of the following format: Offset Description +0 long- the length of the third block of the file in bytes +4 word- Speed: the number of ticks (1/60 second) each frame of the animation is to be displayed for. A value of 0 should be interpreted as 1. +6 word- reserved and unused +8 long- offset from here to start of third block in the file. Should be 4. The third block is of variable length, and contains the differences between each frame and the next, stored in pairs of words. The first word in a pair is the offset into screen memory of what to change, and the second word is the new value of that word in screen memory. The offsets do not need to be sorted. If the offset word is 0, then that is the end of changes for that frame. The next frame continues immediately after the last word pair of the frame. It is possible for pallettes and scanline control bytes to be modified during the playback of the movie (as they are in the same area of video ram), so it is recommended to check them if decompressing a movie. Description written by Nathan Mates (nathan@visi.com), August 1996.