0'comment line 2000 to display instructions on the monochrome display.
10 KEY OFF
15 CLS:CURSX=0:CURSY=0:SAVEX=0:SAVEY=0:PENDOWN=0:ANGLE=0:F=0
17 DIM PICT(1),DIR(1)
18 DEF SEG
20 GOSUB 2000
30 LOCATE 1,20:COLOR 1,0
40 PRINT "COMMANDS FOR GRAPHICS ACTIONS":COLOR 7,0
60 COLOR 15,0:PRINT "F1";:COLOR 7,0:PRINT" - SAVE CURRENT POINT"
70 COLOR 15,0:PRINT "F2";:COLOR 7,0:PRINT" - DRAW LINE BETWEEN CURRENT POINT AND SAVED POINT"
80 COLOR 15,0:PRINT "F3";:COLOR 7,0:PRINT" - DRAW BOX BETWEEN SAVED POINT AND CURRENT POINT"
90 COLOR 15,0:PRINT "F4";:COLOR 7,0:PRINT" - DRAW CIRCLE USING CURRENT POINT AS CENTER AND SAVED POINT AS RADIUS"
100 COLOR 15,0:PRINT "F5";:COLOR 7,0:PRINT" - PEN DOWN MODE"
110 COLOR 15,0:PRINT "F6";:COLOR 7,0:PRINT" - PEN UP MODE"
120 COLOR 15,0:PRINT "F7";:COLOR 7,0:PRINT" - GET FROM SCREEN WITH CURRENT AND SAVED POINTS DEFINING AREA"
125 COLOR 15,0:PRINT "F8";:COLOR 7,0:PRINT" - PUT SAVED PICTURE ON SCREEN"
130 COLOR 15,0:PRINT "F9";:COLOR 7,0:PRINT" - SWITCH DRAWING COLOR"
140 COLOR 15,0:PRINT "F10";:COLOR 7,0:PRINT" - CLEAR SCREEN"
150 COLOR 15,0:PRINT CHR$(24);:COLOR 7,0:PRINT" - MOVE CROSS-HAIR UP"
160 COLOR 15,0:PRINT CHR$(27);:COLOR 7,0:PRINT" - MOVE CROSS-HAIR TO THE LEFT"
170 COLOR 15,0:PRINT CHR$(26);:COLOR 7,0:PRINT" - MOVE CROSS-HAIR TO THE RIGHT"
180 COLOR 15,0:PRINT CHR$(25);:COLOR 7,0:PRINT" - MOVE CROSS-HAIR DOWN"
185 COLOR 15,0:PRINT "PgUp";:COLOR 7,0:PRINT" - TAB UP"
186 COLOR 15,0:PRINT "PgDn";:COLOR 7,0:PRINT" - TAB DOWN"
187 COLOR 15,0:PRINT "?"+CHR$(27);:COLOR 7,0:PRINT" - TAB LEFT"
188 COLOR 15,0:PRINT CHR$(26)+"?";:COLOR 7,0:PRINT" - TAB RIGHT"
189 COLOR 15,0:PRINT "Home";:COLOR 7,0:PRINT" - MOVE CURSOR TO HOME POSITION"
191 COLOR 15,0:PRINT "E";:COLOR 7,0:PRINT" - ERASE SAVED POINT"
192 COLOR 15,0:PRINT "P";:COLOR 7,0:PRINT" - PAINT INSIDE OF OBJECT"
193 COLOR 15,0:PRINT "L";:COLOR 7,0:PRINT" - CHANGE PALETTE"
194 COLOR 15,0:PRINT "B";:COLOR 7,0:PRINT" - CHANGE BACKGROUND COLOR";
195 LOCATE 25,1:COLOR 15,0:PRINT "X";:COLOR 7,0:PRINT" - TERMINATE PROGRAM";
196 LOCATE 17,40:COLOR 15,0:PRINT "End";:COLOR 7,0:PRINT" - MOVE CURSOR TO END";
197 LOCATE 18,40:COLOR 15,0:PRINT "S";:COLOR 7,0:PRINT" - SAVE SCREEN TO FILE";
198 LOCATE 19,40:COLOR 15,0:PRINT "R";:COLOR 7,0:PRINT" - RESTORE FILE TO SCREEN";
199 LOCATE 20,40:COLOR 15,0:PRINT "1";:COLOR 7,0:PRINT" - DRAW CAR";
200 LOCATE 21,40:COLOR 15,0:PRINT "2";:COLOR 7,0:PRINT" - DRAW DONKEY";
201 LOCATE 22,40:COLOR 15,0:PRINT "I";:COLOR 7,0:PRINT" - INCREMENT FILE NUMBER";
202 LOCATE 23,40:COLOR 15,0:PRINT "/ AND SHIFT /";:COLOR 7,0:PRINT" - MOVE DIAGONAL TO RIGHT";
203 LOCATE 24,40:COLOR 15,0:PRINT "\ AND SHIFT \";:COLOR 7,0:PRINT" - MOVE DIAGONAL TO LEFT";
204 LOCATE 25,40:COLOR 15,0:PRINT "T";:COLOR 7,0:PRINT" - CHANGE ROTATION FOR NUMERIC PICTURES";
205 LOCATE 16,40:COLOR 15,0:PRINT "M";:COLOR 7,0:PRINT" - MOVE CURSOR TO SAVED POINT";
206 WHILE INKEY$="":WEND
208 FOR I=1 TO 14:KEY(I) ON:NEXT I
210 ON KEY(1) GOSUB 3000
220 ON KEY(2) GOSUB 4000
230 ON KEY(3) GOSUB 5000
240 ON KEY(4) GOSUB 6000
250 ON KEY(5) GOSUB 7000
260 ON KEY(6) GOSUB 8000
270 ON KEY(7) GOSUB 9000
280 ON KEY(8) GOSUB 10000
290 ON KEY(9) GOSUB 11000
300 ON KEY(10) GOSUB 12000
310 ON KEY(11) GOSUB 13000
320 ON KEY(12) GOSUB 14000
330 ON KEY(13) GOSUB 15000
340 ON KEY(14) GOSUB 16000
350 GOSUB 1000
355 GOSUB 18000
360 IF INKEY$<>"" THEN POKE 106,0:GOTO 360
370 SW=1
380 WHILE SW=1
390 IN$=INKEY$
395 IF IN$="" THEN GOTO 430
400 IF IN$="x" OR IN$="X" THEN GOSUB 17000:GOTO 430
401 IF IN$="p" OR IN$="P" THEN GOSUB 20000:GOTO 430
402 IF IN$=CHR$(9) THEN GOSUB 21000:GOTO 430
403 IF LEN(IN$)=2 AND RIGHT$(IN$,1)=CHR$(15) THEN GOSUB 22000:GOTO 430
404 IF LEN(IN$)=2 AND RIGHT$(IN$,1)=CHR$(73) THEN GOSUB 23000:GOTO 430
405 IF LEN(IN$)=2 AND RIGHT$(IN$,1)=CHR$(81) THEN GOSUB 24000:GOTO 430
406 IF IN$="l" OR IN$="L" THEN GOSUB 25000:GOTO 430
407 IF IN$="b" OR IN$="B" THEN GOSUB 26000:GOTO 430
408 IF IN$="E" OR IN$="e" THEN GOSUB 27000:GOTO 430
409 IF LEN(IN$)=2 AND RIGHT$(IN$,1)=CHR$(71) THEN GOSUB 28000:GOTO 430
410 IF LEN(IN$)=2 AND RIGHT$(IN$,1)=CHR$(79) THEN GOSUB 29000:GOTO 430
411 IF IN$="s" OR IN$="S" THEN GOSUB 30000:GOTO 430
412 IF IN$="r" OR IN$="R" THEN GOSUB 31000:GOTO 430
413 IF IN$="1" THEN GOSUB 32000:GOTO 430
414 IF IN$="2" THEN GOSUB 33000:GOTO 430
415 IF IN$="T"OR IN$="t" THEN GOSUB 34000:GOTO 430
416 IF IN$="I"OR IN$="i" THEN GOSUB 35000:GOTO 430
417 IF IN$="/" THEN DIR(0)=2:DIR(1)=2:GOSUB 36000:GOTO 430
418 IF IN$="?" THEN DIR(0)=2:DIR(1)=-2:GOSUB 36000:GOTO 430
419 IF IN$="\" THEN DIR(0)=-2:DIR(1)=2:GOSUB 36000:GOTO 430
420 IF IN$="|" THEN DIR(0)=-2:DIR(1)=-2:GOSUB 36000:GOTO 430
421 IF IN$="m" OR IN$="M" THEN GOSUB 37000:GOTO 430
428 IF IN$<>""THEN BEEP
430 WEND
440 GOSUB 2000
450 FOR I=1 TO 14:KEY(I) OFF:NEXT I
460 GOTO 65200
1000 REM switch to color/graphics adapter
1010 DEF SEG=0
1020 POKE &H410,(PEEK(&H410) AND &HCF) OR &H20
1030 DEF SEG
1040 LOCATE ,,1,6,7
1050 SCREEN 1,0
1060 RETURN
2000 GOTO 2050'REM SWITCH TO MONOCHROME ADAPTER
2010 DEF SEG=0
2020 POKE &H410,(PEEK(&H410) OR &H30)
2030 DEF SEG
2040 LOCATE ,,1,12,13
2050 SCREEN 0
2060 WIDTH 80
2070 RETURN
3000 REM SUBROUTINE FOR F1 - SAVE POINT
3010 SAVEX=CURSX
3020 SAVEY=CURSY
3022 PUT (CURSX-5,CURSY-5),XHR
3025 PSET (SAVEX,SAVEY),DCOLOR
3027 PUT (CURSX-5,CURSY-5),XHR
3030 GOSUB 19000
3040 RETURN
4000 REM SUBROUTINE FOR F2 - DRAW LINE
4005 PUT (CURSX-5,CURSY-5),XHR
4010 LINE (SAVEX,SAVEY)-(CURSX,CURSY),DCOLOR
4015 PUT (CURSX-5,CURSY-5),XHR
4020 RETURN
5000 REM SUBROUTINE FOR F3 - DRAW BOX
5005 PUT (CURSX-5,CURSY-5),XHR
5010 LINE (SAVEX,SAVEY)-(CURSX,CURSY),DCOLOR,B
5015 PUT (CURSX-5,CURSY-5),XHR
5020 RETURN
6000 REM SUBROUTINE FOR F4 - CIRCLE
6002 CX#=CURSX:CY#=CURSY:SX#=SAVEX:SY#=SAVEY
6010 DX2#=ABS(CX#-SX#)^2
6020 DY2#=ABS(CY#-SY#)^2
6030 DIST#=SQR(DX2#+DY2#)
6035 PUT (CURSX-5,CURSY-5),XHR
6040 CIRCLE (CURSX,CURSY),DIST#,DCOLOR
6045 PUT (CURSX-5,CURSY-5),XHR
6050 RETURN
7000 REM SUBROUTINE FOR F5 - PENDOWN
7005 PENDOWN=1
7006 PUT (CURSX-5,CURSY-5),XHR
7007 LINE (0,0)-(MINX,MINY),2,BF
7008 PUT (CURSX-5,CURSY-5),XHR
7010 RETURN
8000 REM SUBROUTINE FOR F6 - PEN UP
8005 PENDOWN=0
8006 PUT (CURSX-5,CURSY-5),XHR
8007 LINE (0,0)-(MINX,MINY),0,BF
8008 PUT (CURSX-5,CURSY-5),XHR
8010 RETURN
9000 REM SUBROUTINE FOR F7 - GET FROM SCREEN
9010 PUT (CURSX-5,CURSY-5),XHR
9020 DX=ABS(SAVEX-CURSX)
9030 DY=ABS(SAVEY-CURSY)
9040 DM=4+INT((DX*2+7)/8)*DY
9050 DM=45+INT(DM/4)
9060 ERASE PICT
9070 DIM PICT(DM)
9075 PRESET (SAVEX,SAVEY)
9080 GET (SAVEX,SAVEY)-(CURSX,CURSY),PICT
9090 PUT (CURSX-5,CURSY-5),XHR
9095 PSET (SAVEX,SAVEY),DCOLOR
9100 RETURN
10000 REM SUBROUTINE FOR F8 - PUT
10005 ON ERROR GOTO 10050
10010 PUT (CURSX-5,CURSY-5),XHR
10020 PUT (CURSX,CURSY),PICT
10030 PUT (CURSX-5,CURSY-5),XHR
10040 RETURN
10050 BEEP
10060 RESUME NEXT
11000 REM SUBROUTINE FOR F9 - SWITCH DRAWING COLORS
11010 DCOLOR=DCOLOR+1
11012 IF DCOLOR = 4 THEN DCOLOR=0
11014 LINE (MAXX,0)-(319,MINY),DCOLOR,BF
11020 RETURN
12000 REM SUBROUTINE FOR F10 - CLEAR SCREEN
12010 CLS
12020 GOSUB 19000
12025 LINE (MAXX,0)-(319,MINY),DCOLOR,BF
12027 IF PENDOWN=1 THEN LINE (0,0)-(MINX,MINY),2,BF
12030 PUT (CURSX-5,CURSY-5),XHR
12040 RETURN
13000 REM SUBROUTINE FOR CURSOR UP
13005 KEY(7) STOP
13010 PUT (CURSX-5,CURSY-5),XHR
13020 CURSY=CURSY-1
13030 IF CURSYMAXX THEN CURSX=MINX
15035 IF PENDOWN=1 THEN PSET(CURSX,CURSY),DCOLOR
15040 PUT (CURSX-5,CURSY-5),XHR
15045 GOSUB 19040
15050 RETURN
16000 REM SUBROUTINE FOR CURSOR DOWN
16010 PUT (CURSX-5,CURSY-5),XHR
16020 CURSY=CURSY+1
16030 IF CURSY>MAXY THEN CURSY=MINY
16035 IF PENDOWN=1 THEN PSET(CURSX,CURSY),DCOLOR
16040 PUT (CURSX-5,CURSY-5),XHR
16045 GOSUB 19040
16050 RETURN
17000 REM SUBROUTINE TO END PROGRAM
17010 SW=0
17015 ON ERROR GOTO 0
17020 RETURN
18000 REM SUBROUTINE TO INITIALIZE GRAPHICS FUNCTIONS
18010 BACKGCOLOR=8:PALETTE=0
18020 COLOR BACKGCOLOR,PALETTE
18040 DCOLOR=2
18050 LINE (5,0)-(5,10),1
18060 LINE (0,5)-(10,5),1
18070 DIM XHR(12)
18080 GET (0,0)-(10,10),XHR
18090 MINX=5:MAXX=314:MINY=5:MAXY=185
18100 CURSX=INT((MAXX-MINX)/2)
18110 CURSY=INT((MAXY-MINY)/2)
18120 CLS
18130 PUT (CURSX-5,CURSY-5),XHR
18135 LINE (MAXX,0)-(319,MINY),DCOLOR,BF
18140 GOSUB 19000
18150 RETURN
19000 REM SUBROUTINE TO PUT CURRENT AND SAVED CURSOR VALUES ON SCREEN
19030 LOCATE 25,18:PRINT "SAVED ";:PRINT USING "###_,###";SAVEX,SAVEY;
19035 LOCATE 25,32:PRINT USING "& ##";"FILE#",F;
19040 LOCATE 25,1:PRINT "CURRENT ";:LOCATE 25,9:PRINT USING "###_,###";CURSX,CURSY;
19050 RETURN
20000 REM SUBROUTINE TO DO PAINTING
20010 PUT (CURSX-5,CURSY-5),XHR
20020 PAINT (CURSX,CURSY),DCOLOR
20030 PUT (CURSX-5,CURSY-5),XHR
20040 RETURN
21000 REM SUBROUTINE FOR TAB RIGHT
21005 IF PENDOWN=1 THEN SX=CURSX:SY=CURSY
21010 PUT (CURSX-5,CURSY-5),XHR
21020 CURSX=CURSX+10
21030 IF CURSX>MAXX THEN CURSX=MINX
21035 IF PENDOWN=1 THEN LINE(SX,SY)-(CURSX,CURSY),DCOLOR
21040 PUT (CURSX-5,CURSY-5),XHR
21045 GOSUB 19040
21050 RETURN
22000 REM SUBROUTINE FOR TAB LEFT
22005 IF PENDOWN=1 THEN SX=CURSX:SY=CURSY
22010 PUT (CURSX-5,CURSY-5),XHR
22020 CURSX=CURSX-10
22030 IF CURSXMAXY THEN CURSY=MINY
24035 IF PENDOWN=1 THEN LINE(SX,SY)-(CURSX,CURSY),DCOLOR
24040 PUT (CURSX-5,CURSY-5),XHR
24045 GOSUB 19040
24050 RETURN
25000 REM SUBROUTINE TO CHANGE PALETTE
25010 IF PALETTE=0 THEN PALETTE=1 ELSE PALETTE=0
25020 COLOR BACKGCOLOR,PALETTE
25030 RETURN
26000 REM SUBROUTINE TO CHANGE BACKGROUND COLOR
26010 BACKGCOLOR=BACKGCOLOR+1
26020 IF BACKGCOLOR=16 THEN BACKGCOLOR=0
26030 COLOR BACKGCOLOR,PALETTE
26040 RETURN
27000 REM SUBROUTINE TO ERASE SAVED POINT
27010 PRESET (SAVEX,SAVEY)
27020 RETURN
28000 REM SUBROUTINE TO MOVE CURSOR TO "HOME"
28005 PUT (CURSX-5,CURSY-5),XHR
28010 CURSX=MINX
28020 CURSY=MINY
28030 PUT (CURSX-5,CURSY-5),XHR
28040 GOSUB 19040
28050 RETURN
29000 REM SUBROUTINE TO MOVE CURSOR TO "END"
29005 PUT (CURSX-5,CURSY-5),XHR
29010 CURSX=MAXX
29020 CURSY=MAXY
29030 PUT (CURSX-5,CURSY-5),XHR
29040 GOSUB 19040
29050 RETURN
30000 REM SUBROUTINE TO SAVE SCREEN IN FILE
30005 PUT (CURSX-5,CURSY-5),XHR
30010 DEF SEG=&HB800
30020 BSAVE "FPICT"+CHR$(48+F)+".DAT",0,&H4000
30030 DEF SEG
30035 PUT (CURSX-5,CURSY-5),XHR
30040 RETURN
31000 REM SUBROUTINE TO RESTORE SCREEN FROM FILE
31010 DEF SEG=&HB800
31015 CLS
31020 BLOAD "FPICT"+CHR$(48+F)+".DAT",0
31025 PUT (CURSX-5,CURSY-5),XHR
31027 LINE (MAXX,0)-(319,MINY),DCOLOR,BF
31028 IF PENDOWN=1 THEN LINE (0,0)-(MINX,MINY),2,BF ELSE LINE (0,0)-(MINX,MINY),0,BF
31030 GOSUB 19000
31040 RETURN
32000 REM SUBROUTINE TO DRAW PICTURE 1 - CAR
32005 PUT (CURSX-5,CURSY-5),XHR
32010 PRESET (CURSX,CURSY)
32020 DRAW "a=ANGLE;S10C=DCOLOR;"
32030 DRAW"r3m+1,3d2R1ND2u1r2d4l2u1l1"
32040 DRAW"d7R1nd2u2r3d6l3u2l1d3m-1,1l3"
32050 DRAW"m-1,-1u3l1d2l3u6r3d2nd2r1u7l1d1l2"
32060 DRAW"u4r2d1nd2R1U2"
32070 DRAW"M+1,-3"
32080 DRAW"BD10D2R3U2M-1,-1L1M-1,1"
32090 DRAW"BD3D1R1U1L1BR2R1D1L1U1
32100 DRAW"BD2BL2D1R1U1L1BR2R1D1L1U1
32110 DRAW"BD2BL2D1R1U1L1BR2R1D1L1U1
32120 PUT (CURSX-5,CURSY-5),XHR
32130 RETURN
33000 REM SUBROUTINE TO DRAW PICTURE 2 - DONKEY
33015 PUT (CURSX-5,CURSY-5),XHR
33017 DRAW "BM=CURSX;,=CURSY;"
33030 DRAW"A=ANGLE;S15C=DCOLOR;"
33040 DRAW"M+2,-4R8M+1,-1U1M+1,+1M+2,-1
33050 DRAW"M-1,1M+1,3M-1,1M-1,-2M-1,2"
33060 DRAW"D3L1U3M-1,1D2L1U2L3D2L1U2M-1,-1"
33070 DRAW"D3L1U5M-2,3U1"
33080 PUT (CURSX-5,CURSY-5),XHR
33090 RETURN
34000 REM SUBROUTINE TO CHANGE ROTATION ON NUMERIC PICTURES
34010 ANGLE=ANGLE+1
34020 IF ANGLE=4 THEN ANGLE=0
34030 RETURN
35000 REM SUBROUTINE TO INCREMENT FILE NUMBER
35010 F=F+1
35020 IF F=5 THEN F=0
35030 GOSUB 19035
35040 RETURN
36000 REM SUBROUTINE TO MOVE DIAGONALLY
36010 PUT (CURSX-5,CURSY-5),XHR
36020 IF PENDOWN=1 THEN SX=CURSX:SY=CURSY
36030 CURSX=CURSX+DIR(0)
36040 IF DIR(0)<0 THEN IF CURSX < MINX THEN CURSX=MAXX
36050 IF DIR(0)>0 THEN IF CURSX > MAXX THEN CURSX=MINX
36060 CURSY=CURSY+DIR(1)
36070 IF DIR(1)<0 THEN IF CURSY < MINY THEN CURSY=MAXY
36080 IF DIR(1)>0 THEN IF CURSY > MAXY THEN CURSY=MINY
36090 IF PENDOWN=1 THEN LINE (SX,SY)-(CURSX,CURSY),DCOLOR
36100 PUT (CURSX-5,CURSY-5),XHR
36110 GOSUB 19040
36120 RETURN
37000 REM SUBROUTINE TO MOVE CURSOR TO SAVED POINT
37010 PUT (CURSX-5,CURSY-5),XHR
37020 CURSX=SAVEX
37030 CURSY=SAVEY
37040 PUT (CURSX-5,CURSY-5),XHR
37050 GOSUB 19040
37060 RETURN
65200 RUN"basmenu