Dump that Screen!

Authors

Publication

Pub Details

Date

Pages

See all articles from SyncWare News v1

If you took the trouble to enter an alternate conversion table as described in the last issue, you already have the most of what it takes to do a screen dump. The BASIC “DEMO” listing below, shows the required subroutine at lines 7000-7120. Whenever you want a copy of the screen printed out, GOSUB 7000 and the routine will look at each row in the display file and POKE that value’s ASCII equivalent into the ASCII buffer at 16514. The last character (at 16546) is POKEd to zero as a terminator. LPRINT CHR$ 6 sends the line to the printer.

First, in order to get graphics dumps, we have to change the iine feed length (distance between lines vertically) as the graphics characters won’t meet with the standard 1/6″ line feed. To make each line exactly meet the next on Gemini-10, feed has to be changed to 1/12″, This can be accomplished with the control sequence “ESC 3 n.” This translates to 9B, 33, N (hex) or 155, 51, N (dec), and changes the line feed to N/144 inches, Taking what we learned in the last installment, it isn’t difficult to come up with printer control commands to do this.

Take a look at line 8110. We’re simply letting P$ = the desired control sequence, in decimal. First, we send sequence 155, 35 (dec) or “ESC #” which makes Gemini 10 “accept eighth bit ‘as is’ from host computer,” which may not be necessary with your machine or with the 10X. After this is the sequence 155, 51, 12 which sets line feed to 12/144ths or 1/12″. Simply use CHR$ XXX + … to concatenate the sequence into the string, as line 8110 shows, you can combine several control operations as long as you start each with 155 (9Bh) or 27 (1Bh) =ESC. Then, jump to 9000 with GOTO PC, and the values in the string are POKEd into the 16514 buffer.

LPRINT CHR$ 6 and the double CHR$ 155 terminator (prevents spurious line feed) sends the codes and sets the printer to the desired mode. You can insert your own most often used control codes, then just GOSUB to actuate. Some examples are given which may or may not be agreeable with your machine, so check the manual. The CHR$ 0 terminator after each sequence is really not necessary, as the routine at line 9040 does this for you. Some printer manuals (e.g. for Gemini 10X) don’t give decimal values, so you’ll have to translate from hex.

Manuals are, of course, oriented around ASCII codes, so for example, to set 12 cpi the given sequence might be “ESC B 2,” Somewhere though, you should find the hex (and sometime decimal) equivalents, ie. 27 (or 155), 66, 2, Many other approaches are possible, including more sophisticated routines using variables like ESC=27 etc., so you can use the ASCII sequences directly. Our programming here is only one way of doing it, and you’re certainly encouraged to experiment and improve.

For dumping screens of text or numerical values, use COPY; if you try to mix text with our graphic screen dump the result will look “squished” as characters will run into each other vertically. Note also that printers don’t have the grey and half-grey Sinclair characters, but you can modify your ASCII conversion table to print any desired printer character in their place. (E.g., the right triangle graphics that is available on most printers). You could also redefine the graphics as other characters for specialized printouts. POKEing the appropriate value into the conversion table is all it takes.

If you’re into experimenting with machine code you might try to re-code the screen dump in assembly; it’s not really vital, since the BASIC version is quick enough (in FAST mode) to outrun most printers. RUN the demo after making any printer-specific changes. As you see, it works just fine. (If it doesn’t you might have a problem in your conversion table or printer-specific commands.) Experiment, try various possibilities and experiment more! You can only stand to learn.

Products

 

Downloadable Media

 
Scroll to Top