Personal Computer News


QL Routine Hooks Up To Epson Printer

 
Published in Personal Computer News #110

To dump a screen from the QL to a printer, try this program. The escape codes are for the Brother HR5, but they work with most Epson-compatible printers. Although the program is written in SuperBasic, it performs at an adequate speed because it prints horizontally instead of vertically.

The routine only copies a screen area the same size as window 1. Line 170 works out which 16-bit word to look at. 180 bitwise ORs the two bytes to the red and green ones. In Mode 4, white red and green areas will become solid, in Mode 8, white and magenta will be solid, the rest of the colours being shaded.

I. G. Booth, Warrington, Cheshire


100 DEFine PROCedure dump
110 OPEN#10,ser1:BAUD 9600
120 PRINT#10;CHR$(27);"A";CHR$(8);
130 FOR loop1=1 TO 112 STEP 2
140 PRINT#10,CHR$(13)
150 PRINT#10,CHR$(27);"L";CHR$(144);CHR$(1);
160 FOR loop2=199 TO 0 STEP -1
170 s=loop2*128*133127+loop1
180 t=PEEK(s):|PEEK(s+1)
190 PRINT#10,CHR$(t);CHR$(t);
200 END FOR loop2
210 END FOR loop1
220 END DEFine
1000 DIR mdv_1

I. G. Booth