Altering The T-S 2068 Character Set

See all articles from T-S Horizons n8
Author(s): Gordon Young
Publication: T-S Horizons
Pub Details: T-S Horizons n8 (Issue 8)
Date: Sept 1984
Pages: 16-17

One of the easiest alterations a TS2068 user can make on the machine is new character sets. Initially, the ROM uses the character table it was “born” with. Unless you tell it otherwise, it will do so forever. If there did exist another set, and you POKEd a couple of addresses, you could be printing in another font! In the 1000, a similar table also exists, but you can not alter the printing address. Likewise, you can not alter the characters (without altering the contents in the TS1000 ROM). Put simply, the address of the character set pointer is in the TS 1000 ROM and on the 2068 you will find it in RAM (where you can easily modify it).

What this special address points to is the first address of the character grid table. The grid is 8 bytes long giving each character a grid of 8 bits wide/8 bytes long. Study figure 1 where you see the first byte of 8 bits at the top. The second byte follows below and so on. It produces a grid of 64 bits. The first byte is usually a line of nothing. This produces a spacing between lines of characters on the screen. The last line or byte is reserved for the tails of lower case text. In the same manner, a column of spaces is provided to the left and right of the character itself to give spacing between sequential characters on the screen. You may notice that an even smaller grid of 36 blocks are used to produce all upper case letters. The difficult part of changing to a new character set is to determine the real value of each byte (each grid line of the character block). In creating your own set you will be left with the chore of physically drawing out each character on grid paper and decoding each byte to a decimal value you can POKE into RAM. Since each character is 8 bytes long and there are over 100 character, you have at least 800 bytes to store for a complete character set.

FIG. 1 The letter "G" on an 8 x 8 grid
FIG. 1 The letter "G" on an 8 x 8 grid

After drawing out each character, decode each line by the following method. Each byte of the grid (each line) represents a binary (base 2) number. The left most bit represents 128 in decimal. The following bit is 128/2 or 64. The next is 64/2 or 32 and so one. Value placement is such:

bit 8 = 128  (left most column)
bit 7 = 64
bit 6 = 32
bit 5 = 16
bit 4 = 8
bit 4 = 4
bit 2 = 2
bit 1 = 1

From figure 1 you can see that line 4 of the grid has columns 7, 4, 3 and 2 filled with black boxes. The value of that byte can be determined by adding the values of those columns together. In this case column 7 has a value of 64. Column 4 is 8, column 3 is 4 and column 2 is 2. Added up this is 64 + 8 + 4 + 2 = 78. You will have to determine the values of each line (byte) of each character.

The portion of the character table for the letter “G” would be: 0/126/64/78/66/66/126. These would be sequential bytes beginning at some address. Naturally, when building your own character table, you would begin POKEing these grid values at some starting address that begins with a space and is followed by the punctuation set, number, upper case, symbols, and finally the lower case. It is quite a chore to enter all these character grid values, but it will give you an entirely different font. To let the computer know about this set, you will have to change the contents of address 23606 and 23607. If the beginning address of your table begins at 40,256 then POKE 23607 with (40256-256)/256 or 156. A remainder of 64 is left and this is POKEd into address 23606. If your character set is correct and you POKEd the right numbers into 23606/23607, everything printed onto the screen or even the TS 2040 printer will be in the new character font! While it all sounds kinda difficult, you can experiment. You might first move the entire table from ROM into RAM somewhere and then change the values in address 23606/24607 to point to the character table address in RAM. Although if successfully done, no change in characters will occur. However, you can alter each character one by one and see how each font is altered. All you have really done is move the table into RAM where you can now alter each character. The table in ROM can not be changed so this moving of the internal table is a must.

To illustrate how each character is made, enter and RUN the BASIC program in figure 2. Each letter and symbol of the ROM table is printed in the large format onto the screen. This little program will also print the starting address of the character printed. Each character is printed bit by bit to illustrate the grid pattern.

 10 LET y=15624
25 LET m=8
26 BEEP .1,20
27 PRINT AT 20,0;y
30 LET x=PEEK y
35 LET n=m
40 IF x<128 THEN GO TO 70
50 LET x=x-128
60 PRINT AT n,8;"█"
70 IF x<64 THEN GO TO 100
80 LET x=x-64
90 PRINT AT n,9;"█"
100 IF x<32 THEN GO TO 130
110 LET x=x-32
120 PRINT AT n,10;"█"
130 IF x<16 THEN GO TO 160
140 LET x=x-16
150 PRINT AT n,11;"█"
160 IF x<8 THEN GO TO 190
170 LET x=x-8
180 PRINT AT n,12;"█"
190 IF x<4 THEN GO TO 220
200 LET x=x-4
210 PRINT AT n,13;"█"
220 IF x<2 THEN GO TO 250
230 LET x=x-2
240 PRINT AT n,14;"█"
250 IF x<1 THEN GO TO 280
260 LET x=x-1
270 PRINT AT n,15;"█"
285 LET m=m+1
286 IF m=16 THEN GO TO 330
287 LET y=y+1
303 GO TO 30
330 PAUSE 100
340 LET y=y+1
350 CLS
360 GO TO 25
FIG. 2 A "#" character printed in the large format
FIG. 2 A "#" character printed in the large format

Next month I will chat about the TS 2068 display. Unlike the TS 1000, it is much more difficult to print characters onto the screen. In it, I will provide a machine language routine to SCROLL the screen. This sounds easy, but it takes a lot more than on the 1000!!

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