Have you ever purchased a program that used a character set other than the one that came with your 2068? Ever wished you could duplicate that character set in your programs? Here’s how you can do it!
First, there is a system variable, called CHARS, that contains the location of the currently active character set. This is really the address of the character set, less 256, to allow the computer to find the correct character information.
The address of CHARS is 23606 and 23607. CHARS is set to contain 15360 upon turning on your computer. You can verify this by typing:
PRINT PEEK 23606+PEEK 23607*256
You will find that 23606 contains 0 and 23607 contains 60. This is how we tell the computer where to find the character set so, we can use the above statement to find the fancy character set we are interested in.
Now, load in your program with the fancy characters. BREAK out of the program and type the above statement. Add 256 to answer you just got and write it down. This is the start of the fancy character set.
The length of the character table is 768. This is arrived at by knowing that there are 96 definable characters, each needing 8 bytes of infomation to define their shape.
We now have all the information we need to ‘lift’ the character set from the program, for our own use. Type in the proper command to save the character information to whatever storage medium you use. The tape command is:
SAVE "name"CODE start,768
Remember to use the first number we calculated, in place of the word ‘start’, in the above command.
The only thing we need to do now, in order to use our fancy characters is to load them and poke the system variable, CHARS.
This is easiest to accomplish if we calculate a start address for our character table, such that it starts on a new page of memory. This allows us to change character sets with a single POKE.
The highest address we can use, without interfering with the UDG’s, is 64512. 64512/256=252. We need to remember to subtract 256 before our POKE. The easiest way to do this is to subtract 1 from 252.
Now, type in the needed commands to load your fancy character set and POKE the system variable. The tape commands are:
LOAD "name"CODE 64512
POKE 23607,251
Of course, you could load your character set to almost any address. You need only adjust the address in the LOAD command and the value POKEd to CHARS, in the above commands.
You can now switch between the character sets at will. All that is needed is to POKE 23607,60, for the normal characters or POKE 23607,251, for the fancy characters.
If you are still using the 2040 printer, this can be used to make the printing more legible. I use a ‘fat’ character set, for bold printing, to my 2040!
Have Fun!
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.