EasyManua.ls Logo

Atari ST series - Page 150

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...
CHAPTER 7
since it changes whatever color is there. Secondly, the XOR
operation cancels itself the second time it's used. When a
color is complemented, it changes to its opposite color, but
when it's complemented again, it changes back to the origi
nal.
To prevent this property from erasing a common end
point of two lines that are both drawn in XOR mode, there is
a variable called LSTLIN. This is a flag that lets you choose
whether the last pixel of the line will be drawn. If LSTLIN is
zero, the last pixel of the line will be drawn, but if it is non
zero, it will not be drawn. If you are drawing a series of con
nected lines in XOR mode, where the last point of one line
segment is used for the first point of the next line segment,
you'll want to place a 1 in LSTLIN.
Program 7-2 shows how to draw a series of dashed, con
nected lines using function $A003. Try changing the line pat
tern and the color planes (if you have a color monitor) to see
what the effect is.
Program 7-2. LINE.S
* LINE.S Demonstrates the
use of the line A
*
*
* Arbitrary line ($A005) function. Draws 6
*
* dashed, connected lines.
*
*
*
*** Variable table offsets
COLBITO = $18
COLBIT1 = $1A
COLBIT2 = $1C
COLBIT3 = $1E
LSTLIN = $20
LNMASK = $22
WMODE = $24
XI = $26
Y1 = $28
X2 = $2A
Y2 = $2C
*** Function Equates
--
Init = $a000
Aline = $a003
*** Program starts here
.text
dc.w Init * get base address of
variable
move.w #1,COLBITO(aO) *
1 is lsb
move.w #0,COLBITl(aO) *
0 in all other bits
move.w #0.COLBIT2(aO) *
= 0001
142

Related product manuals