Personal Computer News


Use UDGs For Taller Characters

 
Published in Personal Computer News #099

Use UDGs For Taller Characters

Print a string of double-height characters on the ZX Spectrum with this routine.

It works by copying the dot patterns for the character codes of the string from ROM to a pair of UDGs (S and T). These are then printed on top of one another.

To use the subroutine at line 9000, three variables must be set up. t$ is the string to be printed, x is the column number (0 to 31) across the screen, and y is the row number down the screen. The string should fit into the current line.

  10 INPUT LINE t$
  20 PRINT AT 0,0;t$
  30 LET y=5
  40 LET x=0
  50 GOSUB 9000
  60 STOP
9000 IF t$<" " OR t$>CHR$ 127 THEN RETURN
9010 LET base=PEEK 23606+256*PEEK 23607
9020 FOR c=1 TO LEN t$
9030 LET cde=CODE t$(c)
9040 LET address=base+8*cde
9050 FOR r=0 TO 15 STEP 2
9060 POKE USR "s"+r,PEEK address
9070 POKE USR "s"+r+1,PEEK address
9080 LET address=address+1
9090 NEXT r
9100 PRINT AT y,x+c-1;CHR$ 162;AT y+1,x+c-1;CHR$ 163
9110 NEXT c
9120 RETURN

Dilwyn Jones
Bangor, N. Wales

Dilwyn Jones