Personal Computer News


Amstrad Control Code Inputting

 
Published in Personal Computer News #094

Amstrad Control Code Inputting

The enclosed program demonstrates the ability of the Amstrad CPC464 to accept control codes enclosed in strings which can then be printed to the screen.

This is particularly useful for multicolour block graphics where the graphics take up more than one text line. This way the cursor does not have to be moved between individual print statements, and colours can be changed within the string.

The program shows a galleon in three colours moving back and forth across the screen. It is printed as a single string and includes codes to move the cursor around; transparent print and alter colours.

 10 MODE 1
 20 INK 0,11:INK 1,1:INK 2,24:INK 3,6
 30 CLS
 40 SYMBOL 255,24,24,24,60,60,24,24,24
 50 SYMBOL 254,0,0,24,24,60,60,24,24
 60 SYMBOL 253,126,255,255,255,255,255,255,129
 70 SYMBOL 252,0,0,126,255,255,255,255,129
 80 SYMBOL 251,0,0,6,6
 90 SYMBOL 250,0,0,102,102
100 SYMBOL 249,0,0,96,96
110 ship$=CHR$(15)+CHR$(2)+" "+CHR$(252)+CHR$(253)+CHR$(252)
+" "+CHR$(10)+STRING$(5,8)+" "+STRING$(3,253)+" "
120 ship$=ship$+CHR$(10)+STRING$(5,8)+CHR$(15)+CHR$(3)+" "+
CHR$(213)+CHR$(143)+CHR$(212)+" "+CHR$(15)+CHR$(1)+STRING$(2
,11)+STRING$(4,8)
130 ship$=ship$+CHR$(22)+CHR$(1)+CHR$(254)+CHR$(255)+CHR$(254)
+CHR$(10)+STRING$(3,8)+STRING$(3,255)+CHR$(10)+STRING$(3,8)
+CHR$(251)+CHR$(250)+CHR$(249)+CHR$(22)+CHR$(0)
140 FOR i=1 TO 36:LOCATE i,12:PRINT USING "&";ship$;:FOR pause
=1 TO 40:NEXT:NEXT
150 FOR i=35 TO 2 STEP -1:LOCATE i,12:PRINT USING "&";ship$;:
FOR pause =1 TO 40:NEXT:NEXT:GOTO 140

David Muir
Peverell, Plymouth

David Muir