Authors
Publication
Pub Details
Date
Pages
When I first got an Aerco interface and a C. Itoh 8510AP printer for my TS2068, my immediate interest was in getting out a big batch of letters I needed to get done at the time, so after casually noting that PRINT CHR$ 0 called up a screen-dump COPY routine I didn’t give much attention right then to the 8510’s bit-graphic capabilities. When I did get around to experimenting with UDG printouts, however, I soon discovered that whenever a character defini- tion contained a zero byte, which occurs often, the printer went into an orgy of copying everything in sight. (I understand Aerco has corrected this in their later versions.)
Comes now Tom Woods with his neat little 117-byte printer driver routine that he sent me to try out before including it in the PRO/FILE 2068 manual (well worth the price in itself). Not only does it allow embedding printer commands right in the text but these can include any succession of bit-graphic codes for UDGs. However, it does not support the COPY command (nor does it expand the T/S tokenword character-codes for LIST) so the following routine was developed to provide for printout of screen-dumps. It should be noted that while this technique may be applied to all dot-matrix printers (and a variation may be used with daisy-wheel printers) the actual codes must be adjusted for your particular printer from the examples given here for the C. Itoh 8510 AP.
First, a short review of the way a dot-matrix printer handles character-fonts. As you know, when it moves across the page the printhead fires a vertical column of dots at the paper (from 7 to 24 in single-strike mode, depending on the dot-density capability of your printer). However, the TS2068 reads character fonts in horizontal rows in printing the respective bits to the screen as a dot for a 1-bit and a space for a 0-bit. This means that in defining a complete 8 X 8 matrix UDG character to the printer the character must be rotated 90 degrees from the way It appears in the display–that is, unless we read each individual bit directly from the display file as the printhead traverses the page a single dot-line at a time.
The POINT function allows us to do this. We also need a single-dot UDG character in the very corner of an 8 X 8 matrix so we define this as CHR$ 01h (hex notation). Now, let’s single-step through the following demo routine written for the 8510AP and using Tom’s printer driver:
1 CLEAR 63487: PRINT FLASH 1; " Load WOODSPRINT code from P/F ": LOAD ""CODE: POKE 26703,187 • POKE 26704,248: CLS
2 PRINT "12345678901234567890 123456789012"
3 PLOT 50,120: CIRCLE 50,120, 50
5 LPRINT "^1BP^1BT01"
10 FOR x=175 TO 0 STEP -1
20 FOR y=8 TO 255
30 IF POINT (y, x) THEN LPRINT "^1BS0001^01";
40 IF NOT POINT (y,x) THEN LPRINT "^1B1";
50 IF y=0 THEN LPRINT
60 NEXT y
70 NEXT x
Line 1 CLEARs a location for the printer driver routine, LOADs the codes, and the POKEs tell the computer where to look for the start of the LPRINT routine. Other driver routines may be used. by adjusting the CLEAR location and POKEs accordingly. Lines 2 and 3 set up a test display of 32 columns, with the center of a circle plotted to help in experimenting with size and linearity modifications. Line 5 sets the 8510AP in proportional pitch and dot-spacing mode, with 1/144″ line-feed increment.
The up-arrow control character (Extended-mode H on the TS2068 keyboard) tells Tom’s driver routine to interpret the next two characters as hex for the ESC (CHR$ 1Bh) command, followed by the P character for proportional-mode command and another up-arrow followed by ESC T 01 to set LF increments. This line could also be written in decimal codes (if your driver routine does not support imbedded commands): LPRINT CHR$ 27; CHR$ 80; CHR$ 27; CHR$ 84; CHR$ 48; CHR$ 49.
Line 10 provides for a vertical scan, x, of the contents of DFILE1, and line 20 provides for the horizontal scan, y, of DFILE1 bits to determine If they are 1 or 0 by using the POINT function. A 1-bit value returned in line 30 calls first for the bit graphic command, which then tells the printer to treat the next n character-codes as dot-bits, in this case the single code for the one-dot character we described previously. For the 8510AP this command could also be written in decimal codes as: PRINT CHR$ 27; CHR$ 83; CHR$ 48; CHR$ 48; CHR$ 48; CHR$ 49; CHR$ 49.
A 0-bit value returned in line 40 calls for printing a dot-space, which again could be written as PRINT CHR$ 27; CHR$ 49. The printer buffer accumulates all the data for a given bit-row until the horizontal scan, y, reaches 0. Line 50 then dumps the buffer contents and calls for a line-feed increment of 1/144″.
Now suppose we want to enlarge the printout from the minimal size produced by this routine as given. All we need to do is re-define our UDG character to, say, 2 dots X 2 dots which would be be 03h plus 03h and revise the bit-graphics command to read the next two bytes instead of the single byte as bit-graphic codes. This makes Line 38 PRINT “^1BS0002^03^03”; and line 48 PRINT “^1B2”;.
Changing the line 30 command to read three bytes as bit-graphic code and making the third byte to be 00h (which started this whole thing for me!) will widen each horizontal increment by one empty dot-space. Changing the LF increment in line 5 to 2/144″ will adjust the vertical linearity accordingly. The number of dot-spaces defined by line 40 for a 0-bit must always equal the total number of character- bytes in line 30 in order to register properly, i.e. “^1B3” in this case.
A UNIVERSAL COPY ROUTINE
For a screen-dump COPY routine that will work with any printer driver and either dot-matrix or formed- type printers, the following listing may be used. Line 5 is set up using the C. Itoh 8510AP control codes for proportional pitch and a 3/144″ line-feed. These should be revised for your printer to set the character-pitch to proportional or the maximum number of characters-per-inch and a very small line-feed increment.
Line 10 gives the vertical scan and Line 20 FOR y=0 TO 255 will give a full-width horizontal scan of the display (actually of DFILE1). However, unless your printer adjusts to very small spaces between printed period (.) characters in proportional mode it may be necessary to limit the scan to something like FOR y=0 TO 182 to prevent overprinting. LOAD your printer driver software and enter CLS: LIST: GO TO 5 to get a screen-dump COPY of the listing itself.
2 PRINT "12345678901234567890 123456789012": REM Full-width
3 PLOT 50,120: CIRCLE 50,120, 50: REM Linearity test
5 LPRINT CHR$ 27; CHR$ 88; CHR$ 27: CHR$ 84; CHR$ 48; CHR$ 51
10 FOR x=175 TO 0 STEP-1
20 FOR y=0 TO 182
30 IF POINT (y,x) THEN LPRINT "."
40 IF NOT POINT (y,x) THEN LPRINT " ";
50 IF y=0 THEN LPRINT
60 NEXT y
70 NEXT x
Products
Downloadable Media
Image Gallery
Source Code
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.