Gemini User’s Manual

extra wait is part of the price for BASIC’s simplicity. In addition, detailed graphics like this involves massive data manipulation.

If for any reason you didn’t get an output that looks like it was supposed to look(compare with Figure 7-5),then turn Gemini “off:’ reset it by turning it back “on:’enter LLIST, and compare the resul-

tant printout to see where you went wrong. After you fix the problem, RUN the program.

Analyzing the Program

-

This program will take about 3 minutes to run. It generates 900

 

bytes of data that will be printed using the ESC “K”function. The

 

first part of the program will initialize several constants as well as

 

an array to store our data. The array MASK%0 contains the values

 

for each dot. Notice that we are using only six dots in this program.

 

This is to make sure that this program will work with all computers,

 

even those with 7-bit interfaces. LX and LY provide a scale for our

 

image and XFAC and YFAC relate the scale to the overall size of

 

the image. RAD is the radius of the shape; Xl andY1 are the

 

starting points for the curve.

 

 

 

 

The subroutine

that starts at

line

1000 will plot the points

_

around the curve and will call the subroutine starting at line 3000

 

to actually plot the line from X, Y, to X,Y,. This subroutine will call

 

yet another routine starting at line 4000;this routine actually “turns

-

on” the dots. It stores the element in BIT%0 and then uses the

 

values in MASK%0

to turn on the

proper dots

by use of an OR-

-

function.

 

 

 

 

 

Note: Some of the computers

used in this

book do not have

-

an OR function; therefore, some of the programs use a machine

 

language subroutine that will simulate our OR function. This

 

routine is created by “POKE-ing” data into memory.

 

The last subroutine starts at line 2000. This subroutine will

 

get the data and send it to your Gemini printer. The routine star-

 

ting at line 2020 through 2110 uses a loop to go through the data.

 

It will print 12 lines

and each line contains 375 dots. Data will be

-

sent to the printer one line at a time. The shape we plot will il-

 

lustrate our ability to plot mathematical

curves. Since we need to

-

generate high quantities of data through our equations, please

 

note that it will take a few minutes

to

use this

program.

-

110

Page 116
Image 116
Gemini Industries Printer user manual Analyzing the Program, 110