Listing 4. Candy Wrapper program.
10 TEXT : HOME : HTAB (14): VTAB (09) : PRINT "CANDY WRAPPE
20 PRINT CHR$ (4)! "BRUN LOMEM: ": & LOMEM: 16384: REM RELOCATES A/S TO
START AT $4000 (ABOVE HGR 1)
30 BELL$ = CHR$ (7)
40 D$ = CHR$ (4): DIM X$(160): REM SAVE SPACE FOR 5 FONTS OF 32 CHARACTE
RS
50 DEF FN A(A) = 8192 + 40 * INT (A / 64) + 128 * INT ((A - 64 * INT
(A / 64)) / 8) + 1024 * (A - 8 * INT ( A / 8))
60 POKE 768,01: POKE 769,00: POKE 770,04: POKE 771,00: POKE 772,58: POKE
773,36: POKE 774,45: POKE 775,54: POKE 776,07: POKE 777,0: POKE 232,0
0: POKE 233,03: REM LOAD SHAPE TABLE FOR HIRES CURSOR
70 ONERR GOTO 12000
80 X = 139:Y = 95:FF = 0
90 TEXT : HOME : HTAB (14): VTAB (08): PRINT "CHARACTER PLOT"
100 PRINT BELL$: INPUT "READ FROM DISK DRIVE:":DI: IF DI < 1 OR DI > 2 THEN
100
110 PRINT BELL$: INPUT "WRITE TO DISK DRIVE:":DO: IF DO < 1 OR DO > 2 THEN
110
120 PRINT BELL$: INPUT "FONTS FROM DISK DRIVE:";DF: IF DF < 1 OR DF > 2 THEN
120
130 TEXT : HOME : HTAB (10): VTAB (06): PRINT “OPTIONS...”
140 PRINT : PRINT "1. CHANGE DISK DRIVES": PRINT "2. CATALOG DISK": PRINT
"3. SET ENVIRONMENT”
150 PRINT "4. LOAD HIRES PIX": PRINT "5. SAVE HIRES PIX": PRINT "6. ADD T
EXT TO PIX": PRINT "7. CHANGE FONT": PRINT "8. CLEAR HIRES SCREEN": PRINT
"9. DISPLAY CURRENT PICTURE": PRINT "10. QUIT"
160 PRINT BELL$: INPUT "WHICH--> "C: IF C < 1 OR C > 10 THEN 160,
170 ON C GOTO 90,1000,8000,2000,2000,3000,4000,5000,6000,7000
1000 TEXT : HOME
1010 PRINT "WHICH DRIVE ";: INPUT D
1030 PRINT D$;"CATALOG, D";D
1040 PRINT : PRINT BELL$;"STRIKE ANY KEY TO CONTINUE";: GET A$ GOTO 130
2000 HOME : HTAB (5): VTAB (10): INPUT "FILENAME OF PICTURE-->";N$
2010 ON C - 3 GOTO 2020,2030
2020 HGR : POKE - 16302,0:X = 139:Y = 95: PRINT D$;"BLOAD “;N$;",D";DI: FOR
I = 1 TO 2000: NEXT : GOTO 130
2030 PRINT D$:"BSAVE ";N$:",A$20 00,L$2000,D";DO
2040 PRINT D$: "LOCK ";N$: GOTO 1390
3000 IF FF = 0 THEN PRINT "NEED FONTS TO CONTINUE...": FOR I = 1 TO 1000
: NEXT : GOTO 4000
3010 TEXT : HOME : PRINT "PROCEDURE TO ADD TEXT TO PICTURE"
3020 PRINT : PRINT "1. INPUT TEXT TO ADD"; PRINT "2. POSITION CURSOR USIN
G I,J,K,M KEYS": PRINT "NOTE:KEY MAY BE PRECEEDED bY A NUMBER, E.G.
50I MOVES 50 SPACES RIGHT."
3030 PRINT "3. STRIKE CTRL-P TO PRINT TEXT": PRINT "4. <ESC> TO RETURN TO
MENU, <SPACE> TO CHANGE TEXT."
3040 PRINT : PRINT "STRIKE ANY KEY TO START-->";: GET A$: IF ASC (A$) =
27 THEN 130
3050 GOSUB 20000
3060 SCALE= 1: ROT= 0: HCOLOR= 7: POKE - 16304,0: POKE - 16207, 0: POKE
- 16302,0
3070 Z = 0:Z$ = "0": GOSUB 25000: DRAW 1 AT X,Y
3080 GET (A$: PRINT BELL$: IF (A$ > ",") AND (A$ < > ".") AND (A$ < ":") THEN
Z$ = Z$ + A$:Z = VAL (Z$): GOTO 3080
3090 IF ASC (A$) < 73 OR (ASC (A$) > 77 THEN 3190
3100 GOSUB 30000: FOR I = 0 TO Z: IF (X > 10) AND (X < 270) AND (Y > 10)
(Y < 182) THEN ON ASC (A$) - 72 GOTO 3110, 3130, 2150, 3150, 3170
3110 Y= Y = 1: IF Y= 10 THEN Y = 11
27