by Rick Mosdell (rick.mosdell@canrem.com)
(c) September 1995 (used by permission)
Introduction
High resolution graphics on the C64 is not all that complicated. How to set
up the VIC-chip to see your bitmap and colors IS, so this will not become
a discussion on which bits to flip or where to put your blocks of data
inside a computer already renowned for its lack of space. Instead, I
am interested in the internal data formats of the only two graphics formats.
Definitions
- nybble
- the first (lowest) or last(highest) group of 4 bits found in a:
- byte
- the fundamental 8 bit unit of our C64: an 8-bit computer.
- word
- two bytes side by side and related, ie. 16 bits. c64 pointers
into RAM are lo/hi byte style.
- bitmap
- a contiguous block of data where a shape is defined when some
bits or bit-pairs take a fore-ground color and others take on
a background color.
- color-ram
- a block of data which defines the colors for the bitmap,
thus completing the picture.
- color nybble
- since the C64 has a maximum of nybble 16 colors, to conserve
space 2 colors fit into 1 byte.
- LORES
- important! This would refer to pictures created by using the
normal 256-byte character set. Extensive use of the graphics
characters in lowercase plus RVSon/RVSoff here. These are NOT
graphic files and are text files stored in SEQ format.
- MEDRES
- this refers to Koala Paint files and related formats.
- HIRES
- this refers to Doodle files and their derivatives.
Doodle!
This graphics format is the simplest of all! Here the screen is
divided into 64000 pixels of light (320x200) and is truly HIRES. Neither
the text color-ram at $D800 nor the 4 background colors at $D021 apply at
all. The downside is that only 2 colors can be displayed at one time in an
8x8 pixel block. This is the format geoPaint uses (but allows for a whole
page displayed a screenful at a time). These files are prefixed with
"dd..." that when compressed become "jj...". They are PRG files that load
at $5C00. Internally, the 1K of color (1024 bytes) is first followed by 8K
of bitmap (8192 bytes). The "dd..." files are invariably 37 blocks long,
which makes sense since they are 9K long (36+ disk sectors each 254
bytes). The "1" bit of the bitmap uses the low nybble value of the
color-ram while the "0" bit displays the high nybble color.
Simple, straight-forward and direct! Some artists might find this
color restriction too hazardous to their health. Since our screen is
320x200 pixels (64000 total remember?) dividing by 8 will give us only
8000 bytes needed for the bitmap and only 1000 bytes necessary for
the color-ram. So this format actually wastes 216 bytes! Careful placement
of colors can result in spectacular HIRES pictures though: look for
the "Lobster" pic in geoPaint and the Doodle files "Middle Earth"
and "Pagoda". Other related formats are (refer to the program "Autograph+"
by Fuzzy Fox):
- OCP Art Studio
- RUN Paint HIRES
- SID/PIC HIRES
- (geoPaint)
Koala Paint
Koala is certainly the most colorful and interesting format. Here
the screen is MEDRES, resulting in dots double pixel width for a resolution
of 32000 elements (160x200). The loss of resol- ution is compensated by
the ability to display 4 colors at once in each 8x8 pixel block. Here you
have 2 blocks of color-ram, one wherever you put it AND the normal
color-ram at $D800. Your picture is also effected screen-wide by
the background color at $D021. These files, prefixed by "[cbm-1]pic...", are
PRG files that load at $6000. The same files, when compressed, are prefixed
by "gg...". That first character in the filename of the raw format means that
you cannot delete these files normally. It is made by pressing CBM-1
(orange) and is hex $81 (decimal 129). The only way I know to scratch
these files is by typing:
OPEN15,DV,15,"s0:[cbm-1]pic...":close15
Where DV is your current device. Here the creators of Koala were smart
and wasted NO space. Internally the file contains 8000 bytes for the
bitmap(not 8192 bytes), 1000 bytes (not 1024) for the movable color-ram,
1000 bytes for the color-ram at $D800, and (this IS important) ONE more
byte for the background color. The length ends up at 41 blocks which is
ok considering it is about 10K long. These double width dots are called
bit-pairs and they draw their colors from various sources:
%00 from the background color at $D021
%01 from the high nybble of the movable color-ram
%10 from the low nybble of the movable color-ram
%11 from the low nybble of the normal color-ram at $D800.
Interesting eh? There's your 4 colors and where they come from! Related
formats would be:
- Advanced OCP Art Studio
- Artist64
- Blazing Paddles
- RUN Paint MEDRES
- SID/PIC multi-color
Conclusion
Although I am not an expert on graphics screens (not am I claiming to be),
I think programmers should be aware of these two poular formats for
storing and displaying graphics on the Commodore 64/128.
Last Updated: 1995-12-04