[Coco] VEF specification
Willard Goosey
goosey at virgo.sdc.org
Wed Aug 11 04:12:44 EDT 2004
>From: "Boisy G. Pitre" <boisy at boisypitre.com>
>Date: Tue, 10 Aug 2004 20:22:44 -0500
>
>I'm looking for the specification on VEF, the CoCo 3 VDG Extended File
>format. Instead of trying to construct it from looking at source, and
>possibly missing a detail, does there exist a document which explicitly
>defines the format of a VEF file?
Yep. The MVCanvas docs, by Mike Haaland of Hyper-Tech Software, 1989,
updated 03/22/90.
He says:
FILE FORMAT
----------------
NOTE: "char" below refers to a Byte.
VEF picture format:
A two byte VEF Header. Header Values are in Hexadecimal
Standard Squashed Screen Type Screen size Colors
-------------------------------------------------------
0000 8000 08 320x200 16
0001 8001 07 640x200 4
0003 8003 06 320x200 4
0004 8004 05 640x200 2
16 bytes palette information
Picture Data:
----------------
If picture is a Standard (UnCompressed) VEF
Raw Data -- just put it on the screen
If picture is compressed (Squashed)
char len; Number of bytes to read and decode to restore 1/2 scan
line of screen data. 1/2 scan line is 80 bytes on a
type 7 or 8 screen, 40 bytes on types 5 or 6 screen.
(40 and 80 are Decimal values)
char count; compressed/uncompressed byte count
if data is compressed:
char data;
if data is uncompressed:
char data[count];
The header data will only be found once at the beginning of the file.
Now to decode the Compressed Data. Read the first byte and call it
len. It's the length of the compressed 1/2 scan line. Now read 'len'
bytes into an array. All we have to do now is to decode the data we
just read into the buffer. Get the first byte in the buffer and see
if the high bit is set. It's our 'count' byte. If the high bit is
set it's compressed. Now subtract 128 from our 'count' (clear the
high bit) and put the next byte in the buffer 'count' times.
If the high bit is not set, get the next 'count' bytes from the buffer
and put them on the screen.
This continues until you've used 'len' bytes that are in the buffer.
When the buffer has been decoded, read the next 'len' byte from the
file and do it again. This will be repeated 400 times in the file.
For compressed data:
--------------------------
(In Decimal)
char count, 1 to 127 - High bit set - means its compressed
data; this will be the screen data, put it on the screen
'count' times.
For uncompressed data:
--------------------------
(In Decimal)
char count, 1 to 127 - Uncompressed number of bytes to follow.
data[count];
Willard says: That's it! I've only dealt with uncompressed VEFs
myself.
>
>Boisy
>
>
>--
>Coco mailing list
>Coco at maltedmedia.com
>http://five.pairlist.net/mailman/listinfo/coco
>
--
Willard Goosey goosey at sdc.org
Socorro, New Mexico, USA
"I've never been to Contempt! Isn't that somewhere in New Mexico?"
--- Yacko
More information about the Coco
mailing list