This character editor lets you design UDGs easily and reports the values so that you can include them in a program. The arrow keys move the cursor, “a” adds a pixel, “d” deletes, and “n” moves you to the next UDG, which are numbered 0-23.
Content
Source Code
1 REM character editor
2 PRINT "This character editor lets you design UDGs easily and reports the values so that you can include them in a program. The arrow keys move the cursor, ""a"" adds a pixel, ""d"" deletes, and ""n"" moves you to the next UDG, which are numbered 0-23."
3 PRINT : PRINT : PRINT "Press any key to begin."
4 IF INKEY$="" THEN GO TO 4
5 CLS
60 INK 0: PAPER 7
110 LET x=10: LET y=6
120 DIM c(8)
125 CLS : GO SUB 2000
130 PRINT AT 20,6;"Input character number";
140 INPUT c: PRINT c
150 CLS
160 GO SUB 2000
170 GO SUB 1300
180 GO TO 550
300 REM keyboard input
310 IF INKEY$="" THEN GO TO 310
320 LET xo=x: LET yo=y
330 IF INKEY$="a" THEN GO TO 700
340 IF INKEY$="d" THEN GO TO 900
350 IF INKEY$="5" THEN LET x=x-1: GO TO 400
360 IF INKEY$="6" THEN LET y=y+1: GO TO 400
370 IF INKEY$="7" THEN LET y=y-1: GO TO 400
380 IF INKEY$="8" THEN LET x=x+1: GO TO 400
390 IF INKEY$="n" THEN GO TO 100
392 GO TO 300
410 IF x<10 THEN LET x=10
420 IF x>17 THEN LET x=17
430 IF y<6 THEN LET y=6
440 IF y>13 THEN LET y=13
500 REM draw cursor
510 LET xc=xo*8: LET yc=(21-yo)*8
520 PLOT INVERSE 1;xc+2,yc+4
530 DRAW INVERSE 1;4,0
540 PLOT INVERSE 1;xc+4,yc+2
550 DRAW INVERSE 1;0,4
560 LET xc=x*8: LET yc=(21-y)*8
570 PLOT xc+2,yc+4
580 DRAW 4,0
590 PLOT xc+4,yc+2
600 DRAW 0,4
610 GO TO 300
700 REM add point
710 LET q=x+22528+(32*y)
715 IF PEEK (q)=10 THEN GO TO 300
716 IF PEEK (q)=8 THEN GO TO 300
720 POKE q,10
730 LET p=0
740 GO SUB 1500
800 GO TO 300
900 REM delete point
910 LET q=x+22528+(32*y)
915 IF PEEK (q)=56 THEN GO TO 300
920 POKE q,56
930 LET p=1
940 GO SUB 1500
950 GO TO 300
1300 REM display grid
1310 FOR g=64 TO 128 STEP 8
1320 PLOT 80,g
1330 DRAW 64,0
1340 NEXT g
1350 FOR g=80 TO 144 STEP 8
1360 PLOT g,64
1370 DRAW 0,64
1380 NEXT g
1390 FOR q=1 TO 8
1400 PRINT AT q+5,20;c(q)
1410 NEXT q
1420 PRINT AT 20,8;"Character #-";
1430 PRINT c
1440 PRINT AT 5,5;CHR$ (144+c)
1450 RETURN
1500 REM calculate character values
1510 LET xv=7-(x-10)
1520 LET z=2^xv
1530 LET v=y-5
1540 IF p=1 THEN GO TO 1600
1550 LET c(v)=c(v)+z
1560 GO TO 1650
1610 LET c(v)=c(v)-z
1650 FOR q=1 TO 8
1660 PRINT AT q+5,20;" "
1670 PRINT AT q+5,20;c(q)
1680 NEXT q
1710 LET s=USR CHR$ (144+c)
1720 FOR q=1 TO 8
1730 POKE q+(s-1),c(q)
1740 NEXT q
1750 PRINT AT 5,5;CHR$ (144+c)
1800 RETURN
2000 REM draw border
2010 PLOT 0,0
2020 DRAW 255,0
2030 DRAW 0,175
2040 DRAW -255,0
2050 DRAW 0,-175
2060 RETURN
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.
