EasyManua.ls Logo

Atari ST series - Page 149

Atari ST series
420 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Line A Routines
Yl
X2
Y2
= $28 * starting y coordinate
= $2A * ending x coordinate
= $2C * ending y coordinate
The last four variables hold the coordinates for the start
ing point and ending point on the line. The first four are
used to store the color register value. Instead of storing this
value as one word, for the purposes of this function, store it
as bit values in each of four words. For example, to select a
register value of 8, you would store a 1 in COLBIT3, and a 0
in each of the other three variables.
The other variables introduce some new features.
LNMASK is used to create a line pattern for dotted or
dashed lines. This is a 16-bit value which is logically ANDed
with the line. All the points on the line that correspond to 1
bits in the mask are drawn in the selected pen color, while
all of the points that correspond to 0 bits in the mask remain
in the background color. Therefore, a mask of $FFFF
produces a solid line, while $5555 produces a dotted line.
Note that the least significant bit of LNMASK is aligned with
the right-most endpoint of the line.
The WMODE variable is used to determine the drawing
mode is used. The four modes are replace, transparent,
XOR, and reverse transparent. In mode 0, replace mode, all
1 bits in the mask are drawn in the selected foreground
color, while all 0 bits are drawn in the background color. In
transparent mode (mode 1), 1 bits are drawn in the fore
ground color while the colors in areas corresponding to 0 bits
are left alone. In mode 3, reverse transparent, the reverse
happens. Areas corresponding to 1 bits in the mask are left
alone, while 0 bits are drawn in the foreground color.
The last mode, number 2, is called XOR mode. In this
mode, neither the foreground nor background colors are
used to draw the line. Instead, wherever there is a 1 bit in
the line pattern, the color that already exists on the screen at
that spot is logically complemented, using the XOR opera
tion. That means that the values in the color bit planes are all
reversed. A color value of 5 (0101), for example, becomes a
color value of 10 (1010).
The XOR mode has some unique properties. If you color
a green background with a green line, you won't see the
line. But if you use an XOR line, it will always show up,
141

Related product manuals