Personal Computer News


Amstrad Characters Walk Tall In Any Mode

 
Published in Personal Computer News #079

Amstrad Characters Walk Tall In Any Mode

Amstrad owners may find this double-height character routine useful. It can be used in any mode, and the mode number is held in the variable 'mo'.

The characters are PLOTted onto the screen by the routine which starts at line 1000. The variables 'x' and 'y' should be set to the pixel position, to start any message from and you can change the colours by altering the contents of the variable 'c'.

To get vertically striped characters, add 25 CALL &BA0A, and for horizontal stripes, REM out the second plot in line 1090. Other variations can be made by forcing 'y' values to even.

  10 SYMBOL AFTER 32
  20 FOR mo=0 TO 2:MODE mo
  30 c=1:'Colour
  40 x=20:y=199::'Pixel position
  50 m$="Double height in":GOSUB 1000
  60 x=20:y=167:m$="Mode"+STR$(mo)
  70 GOSUB 1000
  80 FOR n=1 TO 2000:NEXT n:'Pause
  90 NEXT mo
 100 GOTO 20
 110 '
1000 'Double height routine
1010 sp=4-mo*(mo+1):IF sp=-2 THEN sp=1
1020 FOR n=1 TO LEN(m$)
1030 IF MID$(m$,n,1)<>" " THEN 1050
1040 y=y-32:GOTO 1140
1050 FOR t=0 TO 7
1060 p=PEEK(&A500+(ASC(MID$(m$,n,1))-32)*8+t)
1070 r=256:FOR s=1 TO 8:r=r/2
1080 IF p-r < 0 THEN x=x+sp:GOTO 1110
1090 PLOT x,y,c:PLOT x,y-3,c
1100 p=p-r:x=x+sp
1110 NEXT
1120 y=y-4:x=x-8*sp
1130 NEXT
1140 y=y+32:x=x+8*sp
1150 IF x=639 THEN x=0:y=y-34
1160 NEXT
1170 RETURN

Philip Harling
Southwater, W. Sussex

Philip Harling