POPULAR COMPUTING WEEKLY - Vol. 5 No 22 (29 May - 4 June 1986)
==============================================================

Programming: Spectrum



SCREEN COPIES

by Stuart Nicholls


Most Centronics printer interfaces include a routine that allows high
resolution screen copies to be produced. However, in many cases these
copies are too small to see all the detail. This is the case with my
Shinwa printer and Kempston interface. To correct this I have written
my own routines to produce 2 x size as well as 1 x size copies of all
24 screen lines.

This is not as straightforward as it first appears. An Epson RX80
printer, for example, only allows 480 bit images per line in single
bit image mode. This is the mode that gives the correct height/width
combinations for a screen copy, and, as there are 256 pixels across
the Spectrum display file, when producing 2 x size copies one needs 512
bit images per line. Another problem occurs when trying to 'point' the
Edit lines to find the state of eight vertical pixels.

These two problems fortunately have the same answer, namely to rotate
the copy 90 degrees clockwise to put the short side of the copy across
the paper instead of down the paper.

We now require only 192 x 2 = 384 bit images per line, and, what is
more useful, it allows us to use display file addresses directly to
find the state of eight vertical pixels.

If we look at a routine for single size copies you will see that we can
start at the bottom of the left hand column. Peek the byte value and
transmit it directly to the printer as eight pixels, thus requiring no
juggling of values associated with horizontal copying. We can move up
the column one byte at a time until we reach the top then advance the
paper by 8/72 spacing and continue on to the next column. This process
is fast enough to write a program in Basic to demonstrate the principle
(see List 1). This program is slow but still usable.

You will notice that this BASIC program has its own printer interface
routine (GOSUB 20) and does not use LPRINT. This is because values
above 127 when LPRINTed are modified by my Kempston software into
keywords thus corrupting the data.

The 2 x size copy routine is based on the same principle but this time
each column is scanned twice. The first time to print bits 7 to 4 (as
77665544), the second time to print the bits 3 to 0 (as 33221100).

To enter the machine code for these routines use LIST 2 which will also
save the code as "Copy" CODE 64000,299. Remember, before reloading the
code, enter CLEAR 63999.

To produce 1 x size copies use RAND USR 64222 and for 2 x size
copies use RAND USR 64000. A BREAK routine is included in the
code. but is only active at the end of a screen line. This has been
done to avoid problems with partial bit image data being sent to the
printer. If BREAK is used in the BASIC program then the printer will
probably require switching off to re-initialize.

Finally, these routines may need slight modification for other
printer/interface combinations.


--------------------

Submitted by Ignacio Prini (Spain) in 24-July-2020.
