Atari ST series Technical Reference Manual page 148

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

nextx:
addq.w
#2,point
move.w
#49,d4
move.w
d4,point+2
nexty:
addq.w
#2,point+2
dc.w
PutPixel
dbra
d4,nexty
dbra
d3,nextx
*** wait for key press, then end
move.w
#l,-(sp)
trap
#1
addq.l
#2,sp
move.l
#0,-(sp)
trap
#1
*** Data for input is stored here
.data
color:
dc.w
.bss
point:
ds.w
.end
The inverse operation of Put Pixel is Get Pixel ($A002).
Given a set of x,y coordinates, Get Pixel finds the color regis­
ter used to display the dot located at that point. As with Put
Pixel, the x and y coordinates are placed in an array of 16-bit
words and a pointer to that array is placed in the PTSIN vari­
able. Upon return from the Get Pixel call, the color register
used for the specified pixel is returned in register DO.
The next step in complexity from drawing points is
drawing straight lines. The main routine for drawing lines is
called Arbitrary Line ($A003), because it can be used to draw
a straight line between any two points. This function re­
quires a lot more input than Put Pixel. The variables used
(and their offsets from the base address of the table) are
shown below:
COLBITO
= $18
= $1A
COLBIT1
COLBIT2
= $1C
COLBIT3
= $1E
LSTLIN
= $20
LNMASK
= $22
WMODE
= $24
XI
= $26
140
CHAPTER 7
* skip even columns
* draw 50 dots vertically
* starting at y of 51
* if the column's not done, do next
* if the row's not done, do next
* call conin() to wait for key press
* GEHOOS terminate command
* call GEMDOS and exit
1
* use color register 1 (black)
2
* storage for x,y coordinates
* bit value (0 or 1) for color plane 0
* bit value (0 or 1) for color plane 1
* bit value (0 or 1) for color plane 2
* bit value (0 or 1) for color plane 3
* draw last pixel of the line?
* (0 = yes, 1 = no)
* line pattern mask
* writing mode (0 = replace,
* 1 = transparent, 2 = XOR, 3 = reverse
* transparent)
* starting x coordinate
* skip even rows
* draw a point

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents