6HN J?K?>F >~D0dQd :
n2 "PROGRAM FOR THE DESIGN OF HIGH RES GRAPHICS"
x
4 "A screen area of up to 128 character units is"
/ "used to plot points or lines or circles."
2 "This is then encoded into an integer array."
5 "The array may be written to cassette in either"
"of two forms :"
5 " 1. As a list of data that may be read by this"
0 "program when the design is to be changed."
3 " 2. As a list of DATA statements that may be"
. "merged into a user program for display."
/ "When ready to continue, type RETURN ";A1$
9 "The plotting area is defined as so many characters"
0 "high `H' and so many characters wide `W'."
, "`H' must be less than or equal to 16."
", "`W' must be less than or equal to 64."
,% "`H' * `W' must not exceed 128."
6
@4 "Note that data is written to cassette at 1200"
J6 "baud, because of the large amount of data used."
T
^" "When ready type RETURN ";A1$
h
r$ MACHINE LANGUAGE SUBROUTINE FOR
 SCREEN SAVE AND RESTORE :
I = USR(28672) FOR SAVE
I = USR(28684) FOR RESTORE
( 1,0,4,17,0,244,33,0,240,237,176,201
( 1,0,4,17,0,240,33,0,244,237,176,201
P = 28672
J = 1 24
K: P,K
P = P + 1
J
0 "Width of space in Characters (1  64) ";W
W > 64 500
W < 1 500
0 "Height of space in Characters (1  16) ";H
H > 16 530
& H < 1 530
0 T = W * H
:0 T > 128 " Max of 128 permitted ": 500
D
257,1
N, "I just pressed the 'LOCK' key for you"
X J = 1 800: J
b
l D is Width in hires points.
v! S is height in hires points.
1 E is array of constants for data conversion.
+ X is array of data for PCG characters.
! D = W * 8  1 : S = H * 16  1
E(16), X(T,16)
128,64,32,16,8,4,2,1
A = 1 8 : E(A) : A
$ Clear screen and set hires mode
2 reset current COLUMN 'C' and ROW 'R' to ZERO.
C = 0 : R = 0
) Display current Cursor colmn and row
and plotting area size.
* 1370
4
>, Clear part of screen and list commands.
H
R> V = 2 13: 35,V: " ";: V
\ 35,2: " I = Initalise ";
f$ 35,3: " P = Save shape data";
p$ 35,4: " K = Load shape data";
z) 35,5: " J = Draw shape from data";
+ 35,6: " O = Record data statements";
' 35,7: " L = Encode shape data ";
35,8: " U = Circles ";
35,9: " Y = goto XY ";
35,10: " H = Help !! ";
# 35,11: " Q = Quit Program ";
# Wait for a command to be typed
A1$ = $
A1$ = "" 990
. Print Command Char. Then check & execute.
50,10: A1$;
A1$ = "I" A1$ = "i" 750
$ A1$ = "d" 1440: 990
. A1$ = "s" 1510: 990
8 A1$ = "e" 1580: 990
B A1$ = "x" 1650: 990
L A1$ = "c" 1720: 990
V A1$ = "z" 1780: 990
` A1$ = "w" 1840: 990
j A1$ = "r" 1900: 990
t* A1$ = "T" A1$ = "t" 1960: 990
~ A1$ = "D" 2010: 990
A1$ = "S" 2070: 990
A1$ = "E" 2130: 990
A1$ = "X" 2190: 990
A1$ = "R" 2250: 990
A1$ = "W" 2320: 990
A1$ = "Z" 2390: 990
A1$ = "C" 2460: 990
* A1$ = "L" A1$ = "l" 2540: 760
* A1$ = "P" A1$ = "p" 3060: 750
* A1$ = "K" A1$ = "k" 3380: 700
* A1$ = "J" A1$ = "j" 3770: 760
* A1$ = "O" A1$ = "o" 4230: 750
* A1$ = "U" A1$ = "u" 4570: 850
* A1$ = "Y" A1$ = "y" 5200: 850
* A1$ = "H" A1$ = "h" 5370: 850
' A1$ = "Q" A1$ = "Q" 140,0:
( 990
2
D C = 1
1370
1 Subroutine to move cursor LEFT without plot.
C = C  1
C < 0 C = D
1370
/ Subroutine to move cursor UP without plot.
"
, R = R + 1
6 R > S R = 1
@ 1370
J
T
^1 Subroutine to move cursor DOWN without plot.
h
r R = R  1
 R < 0 R = S
1370
2 Subroutine to move cursor DOWN RIGHT no plot.
1440
1650
1 Subroutine to move cursor DOWN LEFT no plot.
1510
1650
/ Subroutine to move cursor UP LEFT no plot.
&
0 1510
: 1580
D
N
X/ Subroutine to move cursor UP RIGHT no plot
b
l 1440
v 1580
. Subroutine to plot point at X = C, Y = R.
C,R
/ Subroutine to move cursor RIGHT with plot.
1440
1960
. Subroutine to move cursor LEFT with plot.
1510
1960
*
4
>, Subroutine to move cursor UP with plot.
H
R 1580
\ 1960
f
p
z. Subroutine to move cursor DOWN with plot.
1650
1960
2 Subroutine to move cursor UP RIGHT with plot.
1440
1580
1960
1 Subroutine to move cursor UP LEFT with plot.
1510
1580
$ 1960
.
8
B3 Subroutine to move cursor DOWN LEFT with plot.
L
V 1510
` 1650
j 1960
t
~
4 Subroutine to move cursor DOWN RIGHT with plot.
1440
1650
1960
 Subroutine to convert data in PCG buffer
to data in array X.
V = 1
1 Note that we start at top left of plot area.
R = H 1 1
C = 1 W
(
20 Print current row and column being decoded.
<
F 1370
P
Z5 Compute address in display memory for char code.
d subtract 128 to remove bit 7 (PCG flag).
n
x* K1 = (16  R) * 64 + (C) + 61440  1
P = ((K1))
P = P128
7 Use the code just found to compute address of data
in PCG buffer.
Q = 63488 + 16 * P
6 Next get the data at this address and the next 15
: bytes and insert them into X, as data for char shape.
J = 1 16
L = (Q + J  1)
X(V,17J) = L
Display data just read.
"
,# 42,11: [I6 V];[I3 J];[I4 L];
6 J
@ V = V + 1
J C
T R
^
h, All done, reset Column and Row counters
r and Print on screen.

C = 0: R = 0
1370
6 Subroutine for writing data to cassette in a form
5 that may be read later if you want to change the
design for any reason.
9 if any character is typed in addition to RETURN then
the Write is aborted.
3 : 0: "Start recording then type 'return'";A2$
A2$ <> "" :
 OUT#3 ON turns cassette at 1200 baud on,
. First print some dummy data in case first
&) record or so is damaged by tape AGC.
0
: #3
D8 "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
N8 "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
X8 "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
b
"######"
l
v" Record plot area size first,
8 followed by 1 line of 16 data values per character.
W;",";H
C = 1 T
C;",";
R = 16 1 1
X(C,R);",";
R
C
#3
1 : 15,5: 0: "Stop tape, type 'return'";A2$
4 This Subroutine reads a cassette recording made
7 by the subroutine above, and sets up the plot area
 size from that data, then fills array X.
*
4, : 0: "Play tape and type return ";A2$
> A2$ <> "" :
H
R+ IN #3 directs all input from cassette.
\3 Clear Command removes all data and array sizes
f" so constants must be reread.
p
z #3
: 690
7 Read records from tape until the "######" is found
5 this is followed by the plot area size and data.
" A5$: A5$ <> "######" 3510
7 Read plot area width and height and set up arrays.
W,H
% D = W * 8 : S = H * 16 : T = W * H
X(T,16), E(16)
5 Next read data for each character, note that the
5 First number in each record is the char no. this
5 is compared with loop variable to detect missing
$ records due to tape errors.
.
8 C = 1 T
B V,X(C,16),X(C,15),X(C,14),X(C,13),X(C,12), X(C,11),X(C,10),X(C,9),X(C,8),X(C,7),X(C,6),X(C,5), X(C,4),X(C,3),X(C,2),X(C,1)
L V = C 3690
V "tape reading error": #0
`! J = 1 2000: J: * C 3700
j C
t #0
~0 : 15,5: 0: "Stop tape, type return ";A2$
1 This subroutine converts the data in array X
3 into a display on the screen. It is very SLOW.
V = 1
$ Start at Top Left of plot Area.
R = H 1 1
C = 1 W
$ Print Character column and row.
1370
(
24 The next two loops are done for each character.
<
F J = 1 16
P
Z Q is the Y value for row J.
d0 K is the Data value for row J from array X.
n
x Q = (R1) * 16 + J  1
K = X(V,J)
L = 1 8
, P is the X value for each DOT in line J
/ Powers of 2 in array E are used to compute
( if each DOT is to be SET or not, ie
' IF K > 128 then bit 7 must be SET.
P = (C1) * 8 + L  1
$ K >= E(L) P,Q: K = K  E(L)
L
J
V = V + 1
C
R
"5 All done, reset column & row counters and print.
,
6 C = 0: R = 0
@ 1370
J
T
^5 This subroutine is used to write DATA statements
h4 to cassette, these may be MERGED into a program
r$ to display the graphics design.

3 : 0: "Start recording then type 'return'";A2$
A2$ <> "" :
' First data statement is line 10000
% Remark is in case of AGC trouble
' then the plot area size is written
followed by the DATA .
V = 10000
#3
, V;" REM This is the data for the shape"
V = V + 10
V;" DATA ";W;",";H
V = V + 10
C = 1 T
V;" DATA ";
& R = 16 2 1
0 X(C,R);",";
: R
D X(C,1)
N
V = V + 10
X C
b
l1 CHR$(26) automaticaly restores keboard input
v7 when merging data statements into display program.
$(26)
#3
1 : 15,5: 0: "Stop tape, type 'return'";A2$
/ This subroutine is used to plot circles or
Parts of circles.
P1 = 3.14159
7 Constant C0 is used to convert degrees to radians.
C0 = 2*P1/360
V = (257): 257,1
$ 35,10 : "radius in points ";R1
% 35,11 : "axis & direction ";D1$
*( 35,12 : " 'Clock' or 'Anti' ";D2$;
4& 35,12: "TYPE A KEY TO PLOT IT";
>
257,V
H
R' A4 = Angle of latest point plotted
\) A5 = Increment added to A4 each time
f" R1 = Radius in vertical units
p% C1 = X value of centre of circle
z% C2 = Y value of centre of circle
A4 = 0: A5 = 1/R1
/ D1$="+X" A4=180:C1=(C) + R1*2:C2=(R)
/ D1$="X" A4= 0:C1=(C)  R1*2:C2=(R)
 D1$="+Y" A4=270:C1=(C):C2=(R) + R1
 D1$="Y" A4= 90:C1=(C):C2=(R)  R1
2 D1$ ="C" A4=0:C1=(C):C2=(R):C=C+2*(R1)
! D2$ = "C" A5 = A5 * (1)
2 Convert angle to radians, then wait for a key
, to be typed, if SPACE then stop circle.
A4 = A4 * C0
V = C: U = R
Q1$ = $: Q1$ = "" 4880
Q1$ = " "
$
. X1 = Current X value
8 Y1 = Current Y value
B C = integer from X1, R = integer from Y1
L
V Y1 = R1 * (A4) + 0.5
` X1 = R1 * (A4) * 2 + 0.5
j X1 = X1 + C1
t Y1 = Y1 + C2
~ C = (X1)
R = (Y1)
( If point is outside limits move it.
C < 1 C = 1
C > D C = D
R < 1 R = 1
R > S R = S
 Now PLOT the point, increment the angle.
Print the cursor psition.
V,U C,R: V = C: U = R
A4 = A4 + A5
1370
4880
(
2* This subroutine uses the plot command
< to plot lines anywhere in the plot area.
F
P( 35,11: " Target X, AND Y = ";V,U;
Z" V > D " TOO BIG";: 5200
d" U > S " TOO BIG";: 5200
n
x2 Lower case command moves cursor without plot.
A1$ = "y" 5280
C,R V,U
C = V: R = U
Print cursor position
1370
User Instruction listing
I = (28672):
% 35,2: "Plotting instructions."
* 35,3: " To Move RIGHT use `D'"
* 35,4: " To Move LEFT use `S'"
"* 35,5: " To Move UP use `E'"
,* 35,6: " To Move DOWN use `X'"
6* 35,7: " To Move UP RIGHT use `R'"
@* 35,8: " To Move UP LEFT use `W'"
J* 35,9: " To Move DOWN LEFT use `Z'"
T* 35,10: " To Move DOWN RIGHT use `C'"
^ 35,11: " UPPER case causes MOVE & MARK"
h+ 35,12: " lower case causes MOVE only"
r+ 35,13: " This applies to `Y' command"
+ 35,14: " To turn a point ON/OFF `T'"
2,2: " Circle Commands."
 2,3: "Preset PEN position is regarded"
, 2,4: "as the origin of XY coordinate"
 2,5: "and center of desired circle is"
 2,6: "placed on one of the four axis."
. 2,7: "+X, X, +Y, Y, OR C for Center."
/ 2,8: "Circle is plotted in clockwise or"
) 2,9: "anticlockwise direction by "
* 2,10: "typing C or A. The Circle is"
) 2,11: "plotted when any key except"
' 2,12: "the space bar is pressed."
, 2,13: "The space bar STOPS the circle"
' 2,14: "and returns to main menu."
5 2,16: "Please read and type return when READY";
A1$;
I = (28684)
&
,25,50,100,200,0,0,0,16
F# 8,100,6,30,90,270,400,550,50,2
P 0,0,0,0,0,0,0,0,0,12
Z# 9,100,6,30,90,270,400,