3 ** Shows the ASCII (or ATASCII, PETSCII) codes of typed characters.
5 ** 2002-12-25, Greg King <gngking@erols.com>
8 /* Define CONIO when you want to use the conio functions.
9 ** Undefine it when you want to use the stdio functions.
10 ** NOTE: Undefining CONIO will currently not work on the CBMs!!!
21 static unsigned char height, width, r, t;
25 # define PRINT cprintf
26 # define PUT(c) cputc((char)(c))
28 /* conio doesn't echo typed characters.
29 ** So, this function does it.
31 static int GET(void) {
32 PUT(c = (int)cgetc());
43 /* conio doesn't scroll! Avoid trouble by starting at the top
44 ** of the screen, and never going "below" the bottom of the screen.
47 r = 7; /* allow for prompt */
50 /* This prompt fits on the VIC-20's narrow screen.
52 PRINT("Type characters to see\r\ntheir hexadecimal code\r\nnumbers:\r\n\n");
53 screensize(&width, &height); /* get the screen's dimensions */
54 width /= 6; /* get number of codes on a line */
57 while ((c = GET()) != EOF) {
62 PUT(c); /* echo char. again because screen was erased */