80-Bus News |
March–April 1983 · Volume 2 · Issue 2 |
Page 30 of 55 |
---|
Graphpac Command Manual | Page 3 |
---|
10 CLS 20 FOR A=0 T0 30 30 PSET A,A 40 NEXT A
This short routine will draw a diagonal line on the screen.
PRESET X,Y
To RESET a pixel.
X and Y are graphic co-ordinates.
10 CLS 20 FOR A=0 TO 30 30 PSET A,A 40 NEXT A 50 FOR A=0 TO 30 60 PRESET A,A 7O NEXT A 80 GOTO 20
This routine will continuously draw and erase a line on the screen.
PTEST X,Y: A=PEEK (PVALUE)
To test if a specified pixel on the screen is dark or bright.
Normally PTEST is implemented as a BASIC function, so that the line A=PTEST X,Y would be valid. It has been impossible in the space allocated for Mbaslink to include functions in its command table, therefore this function has to be completed in two stages. PTEST X,Y tests the specified pixel and stores the result in a memory location. It is then the responsibility of the BASIC program to retrieve this value by PEEKing this location. In the statement line above, the numeric variable would hold the result of the pixel test. If the test confirmed that the pixel was bright, the result in A would be 1. If the pixel was dark the result would be 0. If the specified X,Y coordinate does not lie within the screen display area the result would be 2.
The address of (PVALUE), the location to PEEK is given in the Graphpac System Manual.
Graphpac Command Manual | Page 4 |
---|
A collection of PEN commands have been made available in Graphpac. The PEN commands control an invisible graphics cursor. The position of this cursor we have chosen to call the CAP (Current Active Point). The CAP can be moved around on or off the display area by various graphic statements and depending on the PEN mode active at the time, a line may be drawn, erased, or inverted. The commands that control the PEN mode may he abbreviated if required.
In the interests of speed Graphpac works in 16-bit arithmetic, this limits the distance the CAP may be moved in the X or the Y plane, in one operation to 32767. It is therefore probable that moving the CAP from the centre of the screen to X,Y co-ordinates −32767,−32767 in one operation may introduce a small error which can be confirmed by using the CAP command.
STARTAT X,Y or SA X,Y
This command allows the CAP to be moved unconditionally to the specified X,Y graphics co-ordinate as if the PENUP mode is effective.
STARTAT would normally be used as part of the first graphic statement of a program, to position the CAP ready for subsequent plotting. The current PEN mode is not altered. PENRET will now be inactive until a subsequent DRAWTO, DRAW or PLOT command is encountered.
PENUP or PU
To allow the CAP to be moved around the display area using DRAW, DRAWTO or PLOT commands without producing a trace or changing the existing display.
PENDOWN or PD
All following DRAW, DRAWTO, PLOT or DOCAP commands will cause any pixels the CAP passes through to be set bright.
PENFLIP or PF
All following DRAW, DRAWTO, DOCAP and PLOT commands will cause any pixels the CAP passes through to be inverted, that is, dark pixels will be SET bright and bright pixels will be RESET dark.
Page 30 of 55 |
---|