Commodore 128 Programmer's Reference Manual page 253

Hide thumbs Also See for 128:
Table of Contents

Advertisement

n
THE POWER BEHIND COMMODORE 128 GRAPHICS
243
Another way to display graphics, which involves manipulating bits in the bit map,
^
is through mathematical equations, using geometry. Several books are available which
,
offer geometrical equations on how to draw three-dimensional objects and to move them.
1
Refer to the Suggestions for Further Reading the back of the book for sources on graphics.
1
COLOR RAM
In standard bit map mode, color RAM is not used since the color information for the bit
^
map is taken from the upper and lower nybble of screen RAM. Color RAM is used,
i
however, in multi-color bit map mode.
MULTI-COLOR BIT MAP MODE
Multi-color bit map mode is a combination of standard bit map mode and multi-color
character mode. Multi-color bit map mode allows the display of four colors within an 8
by 8 pixel bit map area. Like multi-color character mode, the horizontal resolution is
only half of the standard bit map mode, though the tradeoff in resolution is compensated
for by the use of two additional colors within an 8 by 8 pixel, bit mapped area.
HOW TO ENTER MULTI-COLOR
BIT MAP MODE
To enter multi-color bit map mode from C128 BASIC, issue the following command:
GRAPHIC 3
You can enter this mode with a POKE command as well. But make use of the
highest level commands available for the easiest programming:
POKE 216, PEEK (216) OR 160
This POKEs the value 160 and turns on the multi-color mode bit 7 (value 128) and
the bit map mode bit 5 (value 32) in the GRAPHM register which interfaces to the C128
interrupt driven screen editor. This indirectly turns on, respectively, bit 4 (multi-color
mode) of location 53270 ($D016), and bit 5 (bit map mode) of location 53265 ($D011).
Bit 5 of location 53265 determines whether the C128 is in bit map mode or
character mode. If bit 5 is equal to 1, bit map mode is enabled. Bit 4 of location 53270
determines whether the C128 is in standard or multi-color mode. If bit 4 is set, the
C128 operates in multi-color mode, regardless of whether it is in character or bit map
mode.
In C64 mode, you can store a value directly to these registers. But in C128 mode,
the GRAPHM intermediate register must be used as a gateway to these actual registers.
Again, this is because the C128 screen editor is interrupt driven, enabling the split-
screen modes for text and simultaneous bit map displays. Since the screen editor is
interrupt driven, an indirect register is used to restore the values that you need to use for

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents