Join The Dots - AMSTRAD cpc 6128 User Instruction

Integrated computer/disc system
Hide thumbs Also See for cpc 6128:
Table of Contents

Advertisement

The box is drawn in ink 1- because of line 7121. Ifline 7121 were omitted then we would
need to add a ' , l' either as the third parameter ofthe M 0 V
E
command in line 1 121 121, or
the third parameter of the D RAW command in line 11 121 in order to instruct the
computer to change graphics pens.
Join the dots ....
Lines need not be solid, they can be dotted. The M ASK command allows us
to
specify
the size of the dots. The pattern will repeat every 8 pixels and each subsequent line
will continue the dotting scheme from where the last line left off. A new M ASK
command (probably with the same parameter as the current one) will reset the
dotting logic to the start of the 8 pixel pattern.
The dotting pattern is actually a single byte binary number where the bits set
indicate where to put pen ink. In our example we will use a binary constant (called up
by the '&X') indicating that we want four pixels drawn in the middle of each 8 pixel
group, with the two either side not drawn. This will give a dashed line with four
pixels on and four pixels off. To do this, add:
9~
MASK
&X~~1111~~
run
But hold on a moment! This program does not give us a smooth continuation of the
dotting around the corners as we expected. The reason for this is that each corner
point is actually plotted twice, once as the last pixel of one line, and again as the first
pixel of the next line. A clumsy way around this is to type in:
115 MOVE
18~,22
125 MOVE 178,180
135 MOVE
2~,178
run
.... which produces the desired effect. However there is a simpler way, which is to add a
second parameter', 121' to the end of the M ASK command which tells the computer
NOT to plot the first point of each line. Edit line 9121 to read:
9~
MASK
&X~~1111~~,~
.... and delete the lines youjust added by typing:
115
125
135
At your leisure ....
Chapter 9 Page 49

Advertisement

Table of Contents
loading

Table of Contents

Save PDF