This document describes the structure of the files used by "OCP Advanced Art Studio", a art utility for the Amstrad CPC, published by "Rainbird".
The files covered are:
Note:
The palette file has an extension of ".PAL". This file contains the display mode, palette and colour animation for a Advanced Art Studio window or screen.
The palette file has the same name as the window or screen it was saved with. (e.g. The screen file "raytrace.scr" will have a palette file named "raytrace.pal").
The file is binary and has the following properties:
The file has the following structure:
| Offset (decimal) | Count | Description | 
|---|---|---|
| 0 | 1 | Screen mode (see note 1) | 
| 1 | 1 | Colour animation flag: "FF" = colour animation active, "00" = no colour animation | 
| 2 | 1 | Colour animation delay in frames - 1 (see note 2) | 
| 3 | 1*12 | palette entry 0: colours for 12 frames (see note 3) | 
| 15 | 1*12 | palette entry 1: colours for 12 frames (see note 3) | 
| 27 | 1*12 | palette entry 2: colours for 12 frames (see note 3) | 
| 39 | 1*12 | palette entry 3: colours for 12 frames (see note 3) | 
| 51 | 1*12 | palette entry 4: colours for 12 frames (see note 3) | 
| 63 | 1*12 | palette entry 5: colours for 12 frames (see note 3) | 
| 75 | 1*12 | palette entry 6: colours for 12 frames (see note 3) | 
| 87 | 1*12 | palette entry 7: colours for 12 frames (see note 3) | 
| 99 | 1*12 | palette entry 8: colours for 12 frames (see note 3) | 
| 111 | 1*12 | palette entry 9: colours for 12 frames (see note 3) | 
| 123 | 1*12 | palette entry 10: colours for 12 frames (see note 3) | 
| 135 | 1*12 | palette entry 11: colours for 12 frames (see note 3) | 
| 147 | 1*12 | palette entry 12: colours for 12 frames (see note 3) | 
| 159 | 1*12 | palette entry 13: colours for 12 frames (see note 3) | 
| 171 | 1*12 | palette entry 14: colours for 12 frames (see note 3) | 
| 183 | 1*12 | palette entry 15: colours for 12 frames (see note 3) | 
| 195 | 1*12 | border: colours for 12 frames (see note 3) | 
| 207 | 16 | excluded inks (see note 4) | 
| 223 | 16 | protected inks(see note 5) | 
Notes:
The window file has an extension of ".WIN".
A window is a rectangular area of bitmapped graphics that has been cut from a bitmapped screen. The pixel data in the file can be compressed or uncompressed.
The mode and palette information for the window file is stored in a seperate palette file.
The file is binary and has the following properties:
The file has the following structure:
| Offset (decimal) | Length | Description | 
|---|---|---|
| 0 | length-5 | Window pixel data (see note 1) | 
| length-4 | 2 | Width of window in pixels (see note 2) | 
| length-2 | 1 | Height of window in lines/2 | 
| length-1 | 1 | ? | 
Notes:
The screen file contains the pixel data for a entire bitmapped screen.
The file is binary and has the following properties:
Notes:
The following table shows the start offset of each line in the screen file.
| Offset | Length | Description | 
|---|---|---|
| &0000 (line 0 + &0000) | 80 | Line 0 of image | 
| &0800 (line 0 + &0800) | 80 | Line 1 of image | 
| &1000 (line 0 + &1000) | 80 | Line 2 of image | 
| &1800 (line 0 + &1800) | 80 | Line 3 of image | 
| &2000 (line 0 + &2000) | 80 | Line 4 of image | 
| &2800 (line 0 + &2800) | 80 | Line 5 of image | 
| &3800 (line 0 + &3000) | 80 | Line 6 of image | 
| &3800 (line 0 + &3800) | 80 | Line 7 of image | 
| &0080 (line 8 + &0000) | 80 | Line 8 of image | 
| &0880 (line 8 + &0800) | 80 | Line 9 of image | 
| &1080 (line 8 + &1000) | 80 | Line 10 of image | 
| &1880 (line 8 + &1800) | 80 | Line 11 of image | 
| &2080 (line 8 + &2000) | 80 | Line 12 of image | 
| &2880 (line 8 + &2800) | 80 | Line 13 of image | 
| &3080 (line 8 + &3000) | 80 | Line 14 of image | 
| &3880 (line 8 + &3800) | 80 | Line 15 of image | 
| ... | ... | ... | 
| ... | ... | ... | 
| ... | ... | ... | 
| ... | ... | ... | 
| &0780 (line 192 + &0000) | 80 | Line 192 of image | 
| &0f80 (line 192 + &0800) | 80 | Line 193 of image | 
| &1780 (line 192 + &1000) | 80 | Line 194 of image | 
| &1f80 (line 192 + &1800) | 80 | Line 195 of image | 
| &2780 (line 192 + &2000) | 80 | Line 196 of image | 
| &2f80 (line 192 + &2800) | 80 | Line 197 of image | 
| &3780 (line 192 + &3000) | 80 | Line 198 of image | 
| &3f80 (line 192 + &3800) | 80 | Line 199 of image | 
The following equation can be used to calculate the offset of any line:
offset = ((line AND 7)*&800) + ((line/8)*&80)
The font file format describes the characters in a monochrome bitmapped font.
The file is binary and has the following properties:
Notes:
The following equation can be used to calculate the start of the character
offset = (ascii_code - 32)*8
Compression algorithm used by pixel data in window and screen files
If data is compressed using this algorithm, there will be one or more "compressed blocks".
A "compressed block" has the following structure:
| Offset | Length | Description | 
|---|---|---|
| 0 | 3 | Identification bytes: "M","J" and "H" in that order | 
| 3 | 2 | Length of uncompressed data in this block (note 1) | 
| 5 | ... | Compressed data for this block (note 2) | 
Notes:
The compressed data in each block will contain single data bytes and run-length packets.
A "marker" byte is used to identify a run-length packet.
Each packet has the following structure:
| Offset | Length | Description | 
|---|---|---|
| 0 | 1 | marker (see note 1) | 
| 1 | 1 | count (see note 2) | 
| 2 | 1 | byte (see note 3) | 
Notes:
If the marker exists in the data before compression, it will be encoded as the following run-length packet:
marker, 1, marker
i.e. &01, 1, &01 for OCP Advanced Art Studio files.