1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-19 06:56:16 +02:00

tstimg.c: completed the alphabet

- tstimg.c (printc): added diagonal to '0' (zero) to distinguish it from
  'O' (oh)
- tstimg.c (printc): added "nose" to '1' to better distinguish it from
  'I'
- tstimg.c (printc): completed the alphabet
- tstimg.c (printc): added '.' character
This commit is contained in:
Werner Almesberger 2011-05-01 14:29:11 -03:00
parent 9fb5c6f3f4
commit 7d16a0682d

View File

@ -201,8 +201,10 @@ static void printc(void **f, int xres, int x, int y, char c, int n,
line45(f, xres, x, y+n, 0, 1, 2*n, color, side); line45(f, xres, x, y+n, 0, 1, 2*n, color, side);
line45(f, xres, x+2*n, y+n, 0, 1, 2*n, color, side); line45(f, xres, x+2*n, y+n, 0, 1, 2*n, color, side);
arc(f, xres, x+n, y+3*n, n, 6, color, side); arc(f, xres, x+n, y+3*n, n, 6, color, side);
line45(f, xres, x, y+3*n, 1, -1, 2*n, color, side);
break; break;
case '1': case '1':
line45(f, xres, x, y+n, 1, -1, n, color, side);
line45(f, xres, x+n, y, 0, 1, 4*n, color, side); line45(f, xres, x+n, y, 0, 1, 4*n, color, side);
break; break;
case '2': case '2':
@ -267,6 +269,30 @@ static void printc(void **f, int xres, int x, int y, char c, int n,
line45(f, xres, x, y+4*n, 1, 0, n, color, side); line45(f, xres, x, y+4*n, 1, 0, n, color, side);
line45(f, xres, x, y, 0, 1, 4*n, color, side); line45(f, xres, x, y, 0, 1, 4*n, color, side);
break; break;
case 'C':
arc(f, xres, x+n, y+n, n, 9, color, side);
line45(f, xres, x, y+n, 0, 1, 2*n, color, side);
arc(f, xres, x+n, y+3*n, n, 6, color, side);
break;
case 'D':
arc(f, xres, x+n, y+n, n, 1, color, side);
line45(f, xres, x, y, 0, 1, 4*n, color, side);
line45(f, xres, x+2*n, y+n, 0, 1, 3*n, color, side);
line45(f, xres, x, y, 1, 0, n, color, side);
line45(f, xres, x, y+4*n, 1, 0, n, color, side);
arc(f, xres, x+n, y+3*n, n, 2, color, side);
break;
case 'E':
line45(f, xres, x, y, 0, 1, 4*n, color, side);
line45(f, xres, x, y, 1, 0, 2*n, color, side);
line45(f, xres, x, y+2*n, 1, 0, 2*n, color, side);
line45(f, xres, x, y+4*n, 1, 0, 2*n, color, side);
break;
case 'F':
line45(f, xres, x, y, 0, 1, 4*n, color, side);
line45(f, xres, x, y, 1, 0, 2*n, color, side);
line45(f, xres, x, y+2*n, 1, 0, 2*n, color, side);
break;
case 'G': case 'G':
arc(f, xres, x+n, y+n, n, 9, color, side); arc(f, xres, x+n, y+n, n, 9, color, side);
line45(f, xres, x, y+n, 0, 1, 2*n, color, side); line45(f, xres, x, y+n, 0, 1, 2*n, color, side);
@ -274,6 +300,78 @@ static void printc(void **f, int xres, int x, int y, char c, int n,
line45(f, xres, x+n, y+2*n, 1, 0, n, color, side); line45(f, xres, x+n, y+2*n, 1, 0, n, color, side);
line45(f, xres, x+2*n, y+2*n, 0, 1, n, color, side); line45(f, xres, x+2*n, y+2*n, 0, 1, n, color, side);
break; break;
case 'H':
line45(f, xres, x, y, 0, 1, 4*n, color, side);
line45(f, xres, x+2*n, y, 0, 1, 4*n, color, side);
line45(f, xres, x, y+2*n, 1, 0, 2*n, color, side);
break;
case 'I':
line45(f, xres, x+n, y, 0, 1, 4*n, color, side);
line45(f, xres, x, y, 1, 0, 2*n, color, side);
line45(f, xres, x, y+4*n, 1, 0, 2*n, color, side);
break;
case 'J':
line45(f, xres, x+2*n, y, 0, 1, 3*n, color, side);
arc(f, xres, x+n, y+3*n, n, 6, color, side);
break;
case 'K':
line45(f, xres, x, y, 0, 1, 4*n, color, side);
line45(f, xres, x, y+2*n, 1, -1, 2*n, color, side);
line45(f, xres, x, y+2*n, 1, 1, 2*n, color, side);
break;
case 'L':
line45(f, xres, x, y, 0, 1, 4*n, color, side);
line45(f, xres, x, y+4*n, 1, 0, 2*n, color, side);
break;
case 'M':
line45(f, xres, x, y, 0, 1, 4*n, color, side);
line45(f, xres, x+2*n, y, 0, 1, 4*n, color, side);
line45(f, xres, x, y, 1, 1, n, color, side);
line45(f, xres, x+n, y+n, 1, -1, n, color, side);
line45(f, xres, x+n, y+1*n, 0, 1, n, color, side);
break;
case 'N':
line45(f, xres, x, y, 0, 1, 4*n, color, side);
line45(f, xres, x+2*n, y, 0, 1, 4*n, color, side);
line45(f, xres, x, y, 1, 1, n, color, side);
line45(f, xres, x+n, y+n, 0, 1, 2*n, color, side);
line45(f, xres, x+n, y+3*n, 1, 1, n, color, side);
break;
case 'O':
arc(f, xres, x+n, y+n, n, 9, color, side);
line45(f, xres, x, y+n, 0, 1, 2*n, color, side);
line45(f, xres, x+2*n, y+n, 0, 1, 2*n, color, side);
arc(f, xres, x+n, y+3*n, n, 6, color, side);
break;
case 'P':
line45(f, xres, x, y, 0, 1, 4*n, color, side);
line45(f, xres, x, y, 1, 0, n, color, side);
line45(f, xres, x, y+2*n, 1, 0, n, color, side);
arc(f, xres, x+n, y+n, n, 3, color, side);
break;
case 'Q':
arc(f, xres, x+n, y+n, n, 9, color, side);
line45(f, xres, x, y+n, 0, 1, 2*n, color, side);
line45(f, xres, x+2*n, y+n, 0, 1, 2*n, color, side);
arc(f, xres, x+n, y+3*n, n, 6, color, side);
line45(f, xres, x+n, y+3*n, 1, 1, n, color, side);
break;
case 'R':
line45(f, xres, x, y, 0, 1, 4*n, color, side);
line45(f, xres, x, y, 1, 0, n, color, side);
line45(f, xres, x, y+2*n, 1, 0, n, color, side);
arc(f, xres, x+n, y+n, n, 3, color, side);
line45(f, xres, x, y+2*n, 1, 1, 2*n, color, side);
break;
case 'S':
arc(f, xres, x+n, y+n, n, 9, color, side);
line45(f, xres, x, y+n, 1, 1, 2*n, color, side);
arc(f, xres, x+n, y+3*n, n, 6, color, side);
break;
case 'T':
line45(f, xres, x+n, y, 0, 1, 4*n, color, side);
line45(f, xres, x, y, 1, 0, 2*n, color, side);
break;
case 'U': case 'U':
line45(f, xres, x, y, 0, 1, 3*n, color, side); line45(f, xres, x, y, 0, 1, 3*n, color, side);
line45(f, xres, x+2*n, y, 0, 1, 3*n, color, side); line45(f, xres, x+2*n, y, 0, 1, 3*n, color, side);
@ -285,11 +383,43 @@ static void printc(void **f, int xres, int x, int y, char c, int n,
line45(f, xres, x+n, y+4*n, 1, -1, n, color, side); line45(f, xres, x+n, y+4*n, 1, -1, n, color, side);
line45(f, xres, x+n, y+4*n, -1, -1, n, color, side); line45(f, xres, x+n, y+4*n, -1, -1, n, color, side);
break; break;
case 'W':
line45(f, xres, x, y, 0, 1, 4*n, color, side);
line45(f, xres, x+2*n, y, 0, 1, 4*n, color, side);
line45(f, xres, x, y+4*n, 1, -1, n, color, side);
line45(f, xres, x+n, y+3*n, 1, 1, n, color, side);
line45(f, xres, x+n, y+2*n, 0, 1, n, color, side);
break;
case 'X':
line45(f, xres, x, y+n, 1, 1, 2*n, color, side);
line45(f, xres, x, y+3*n, 1, -1, 2*n, color, side);
line45(f, xres, x, y, 0, 1, n, color, side);
line45(f, xres, x+2*n, y, 0, 1, n, color, side);
line45(f, xres, x, y+3*n, 0, 1, n, color, side);
line45(f, xres, x+2*n, y+3*n, 0, 1, n, color, side);
break;
case 'Y':
line45(f, xres, x, y, 0, 1, n, color, side);
line45(f, xres, x+2*n, y, 0, 1, n, color, side);
line45(f, xres, x, y+n, 1, 1, n, color, side);
line45(f, xres, x+2*n, y+n, -1, 1, n, color, side);
line45(f, xres, x+n, y+2*n, 0, 1, 2*n, color, side);
break;
case 'Z':
line45(f, xres, x, y, 1, 0, 2*n, color, side);
line45(f, xres, x, y+4*n, 1, 0, 2*n, color, side);
line45(f, xres, x+2*n, y, 0, 1, n, color, side);
line45(f, xres, x, y+3*n, 0, 1, n, color, side);
line45(f, xres, x, y+3*n, 1, -1, 2*n, color, side);
break;
case '-': case '-':
line45(f, xres, x, y+2*n, 1, 0, 2*n, color, side); line45(f, xres, x, y+2*n, 1, 0, 2*n, color, side);
break; break;
case ' ': case ' ':
break; break;
case '.':
line45(f, xres, x+n, y+3*n, 0, 1, n, color, side);
break;
default: default:
arc(f, xres, x+n, y+n, n, 9, color, side); arc(f, xres, x+n, y+n, n, 9, color, side);
line45(f, xres, x+n, y+2*n, 1, -1, n, color, side); line45(f, xres, x+n, y+2*n, 1, -1, n, color, side);
@ -328,6 +458,7 @@ void tstimg(void **f, int xres, int yres)
grid(f, xres, yres); grid(f, xres, yres);
sides(f, xres, yres); sides(f, xres, yres);
color_bars(f, xres, yres); color_bars(f, xres, yres);
sprintf(buf, "UBB-VGA %dx%d", xres, yres); sprintf(buf, "UBB-VGA %dx%d", xres, yres);
ctext(f, xres, xres/2, yres/2-GRID*0.75, buf, 10, WHITE, 3); ctext(f, xres, xres/2, yres/2-GRID*0.75, buf, 10, WHITE, 3);
ctext(f, xres, xres/2, yres*(CBAR_Y0+CBAR_Y1)/2, buf, 2, 0, 0); ctext(f, xres, xres/2, yres*(CBAR_Y0+CBAR_Y1)/2, buf, 2, 0, 0);