Videograph

Author(s): J. Showalter
Publication: Syntax
Pub Details: Syntax/Syntax ZX80 v5 n4 (Volume 5, Issue 4)
Date: April 1984
Pages: 9

You can create up to 4 user defined graphics characters at a time, using a 16 X 16 grid provided by VIDEOGRAPH. All 21 UDGs can be defined, but assigning a character to UDG “U” may distort the display, since the program uses this character to print the grid.

Move the cursor with the 4 arrow keys (unshifted). Blacken a pixel with the 1 key; erase a pixel with 0. When you want to define one or more UDGs from the grid, hit 9. The program will prompt you to assign each quarter of the grid to a letter: if you don’t want to assign a certain quarter of the grid, just hit ENTER. It takes about 10 seconds to store a UDG.

In the program listing, line 8030 contains 8 graphic U’s, line 8130 contains only one graphic U (the last U on the line), and line 8530 contains two graphic U’s.

VIDEOGRAPH screen with the 16 x 16 grid and UDG assignments
VIDEOGRAPH screen with the 16 x 16 grid and UDG assignments
8000 REM VIDEOGRAPH © 1984
8002 REM by J. Showalter
8004 REM [address omitted]
8006 REM [address omitted]
8010 LET l=4: LET c=1: LET x$=" "
8020 FOR n=0 TO 7: READ a: POKE USR "U"+n,a: NEXT n
8030 LET v$="UUUUUUUU": DIM z$(32,8)
8040 FOR n=1 TO 32: LET z$(n)=v$: NEXT n
8100 CLS : REM display
8110 FOR n=1 TO 17: PLOT 8-8*(n=9),n*8+8: DRAW 128+16*(n=9),0: PLOT n*8,8+8-8*(n=9): DRAW 0,128+16*(n=9): NEXT n
8115 PRINT AT 0,0;" VIDEOGRAPH "
8120 PRINT AT 2,1;"UDG-1";TAB 10;"UDG-3 ";AT 21,1;"UDG-2";TAB 10;"UDG-4 "
8130 FOR n=7 TO 16: PRINT AT n,22;CHR$ (n+58);"=";CHR$ (n+137);TAB 28;CHR$ (n+68);"=";CHR$ (n+147): NEXT n: PRINT AT 17,28;"U";"=";"U"
8135 REM cursor & controls
8140 LET r=l-3+16*(c>8): LET b=c-8*(c>8)
8150 PRINT AT l,c; OVER 1;">"
8160 PAUSE 0
8180 LET y$=INKEY$: IF CODE y$<48 OR CODE y$>57 THEN GO TO 8160
8190 GO TO (CODE y$-47)*20+8500
8520 REM [illegible]
8530 LET z$(r,b)="U": PRINT AT l,c;"U": GO TO 8140
8540 REM [illegible]
8550 LET z$(r,b)="█": PRINT AT l,c;"█": GO TO 8140
8590 REM [illegible]
8600 GO TO 8160
8620 REM cursor left
8630 PRINT AT l,c;z$(r,b): LET c=c-1+16*(c=1): GO TO 8140
8640 REM cursor down
8650 PRINT AT l,c;z$(r,b): LET l=l+1-16*(l=19): GO TO 8140
8660 REM cursor up
8670 PRINT AT l,c;z$(r,b): LET l=l-1+16*(l=4): GO TO 8140
8680 REM cursor right
8690 PRINT AT l,c;z$(r,b): LET c=c+1-16*(c=16): GO TO 8140
8700 REM define user graphics
8710 LET v=0: FOR n=1 TO 4
8720 INPUT FLASH 1;"UDG-";CHR$ (n+48); FLASH 0;"=(character A to U)";x$(n): IF x$(n)="9" THEN GO TO 8120
8730 IF x$(n)=" " THEN LET v=NOT v: NEXT n: GO TO 8760
8740 LET k=(CODE x$(n)-32*(CODE x$(n)>96)): IF k<65 OR k>85 THEN LET v=NOT v: GO TO 8720
8750 PRINT AT 2+19*(v),6+9*(n>2);"=";CHR$ k: LET v=NOT v: NEXT n
8760 PRINT AT 0,0; FLASH 1;"STAND-BY"; FLASH 0;" GRAPHICS BEING DEFINED"
8770 FOR n=1 TO 4: LET a=0: IF x$(n)=" " THEN NEXT n: GO TO 8810
8780 FOR y=1+8*(n-1) TO 8+8*(n-1): LET d=0: LET p=7: FOR x=1 TO 8
8790 LET d=d+2↑(p)*(CODE z$(y,x)=143): LET p=p-1: NEXT x
8800 POKE USR x$(n)+a,d: LET a=a+1: NEXT y: NEXT n
8810 BEEP .1,0: BEEP .1,10: BEEP .05,18: GO TO 8115
8900 SAVE "VIDEOGRAPH" LINE 8e3
8950 REM [illegible]
8960 DATA 128,128,128,128,128,128,128,255
SYNTACTIC SUM: 1279, TS2068

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.