+==========================================================================================+ |Dangerous Dave graphics format: | +==========================================================================================+ This covers the file EGADAV.DAV, the 16 color EGA graphics for Dave to use. The CGA and VGA graphics are stored in the executable and not covered here yet. Dave uses EGA type graphics, in which an image is stored as 4 (or 5) 'planes' of data. (4 for unmasked graphics, blue, green, red and intensity, 5 for unmasked graphics, which also has a 'masked' plane.) Dave has each single graphic divided into four planes, the mask for sprites being another, seperate, graphic. In each plane 8 pixels are stored per byte, (this is why graphic sizes tend to be multiples of 8 pixels wide.) giving in total an approximately 4-bit form of storage. A pixel (Or rather 8 pixels) is composed by adding all the values from the four planes for each pixel. So black is 0000, and dark blue is 1000 (Light blue is 1001) etc. In summary: GRAPHICS -> 4 PLANES -> 8 PIXEL LINES -> 0\1 BITS BGRL: COLOR 0000: Black 0001: Dark grey 0010: Red 0011: Light red 0100: Green 0101: Light green 0110: Brown 0111: Light brown (Yellow) 1000: Dark blue 1001: Light blue 1010: Purple 1011: Light purple (Pink) 1100: Turqoise 1101: Light Turquoise 1110: Grey 1111: White +------------------------------------------------------------------------------------------+ |Dave I External EGA Graphics ('EGADAV.DAV'): | +------------------------------------------------------------------------------------------+ This stores all the external EGA graphics used by dave; tiles, sprites and the header for all images. ------------------------------------------------------------------------------- EGAHEAD STRUCTURE: HEADER IMAGES ... .. . ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- HEADER: 0 4 Numpics Number of images in the file 4 4x Picloc Location, from file start, to picture x data. There are [numpics] of these ? 4x Picdat Picture data, one set for each picture. If this is a tile it will be 128 bytes in size (16x16 pixels) Otherwise the height and width are stored in the picture data itself If the picture s masked (A sprite) then it is followed by a black and white image used as its mask, Dave has no seperate masking plane. ------------------------------------------------ GRAPHIC ENTRIES: ? 2 Size h The width of the graphic. Absent if graphic is a tile +2 2 Size v The height of the graphic in pixels. Absent if graphic is a tile +4 x data Graphics data; graphic is divided into rows, each h \ 8 bytes long, with the order I,R,G,B giving each graphic a total size of hw \ 2 ------------------------------------------------