YOUR COMPUTER (DEC. 1984) Page 192 SHADE COPY I J Abbott, Donecaster, South Yorkshire. SHADE COPY IS a routine for the 16/48K Spectrum connected to a Sinclair ZX or Alphacom 32 printer. It has two advantages over the Spectrum Copy command. First, it allows you to copy all — including the bottom two lines — or any part of the screen. Secondly, it provides three modes of operation, namely normal, inverse and shaded copy. Instead of transferring ink or paper dots from the screen to the printer, the shading routine looks at the affecting Ink and Paper attributes — not the Bright or Flash attributes — and converts the dots into one of eight shading patterns corresponding to their colours before sending to the printer. The parameters for the routine are specified in the same command as the USR call rather than being Poked in separately. The routine can be activated by a command such as: Randomise mode OR first And depth <>USR copy where Mode, First and Depth are numeric expressions and Copy is the address of the routine. Randomise whould be replaced by "Let dummy = " if your program uses the RND function. The syntax of the command may be distinctly meaningless, but as far as the Spectrum is concerned, it is a perfectly valid expression and gets through the syntax check satisfactorily. If the sub-expressions Mode, First or Depth contain any comparison or logical operators then they may need to be enclosed in parentheses. Since the operators Or, And and <> are in increasing order of priority, the value of Mode, First and Depth have been placed on the calculator stack by the time the USR Copy is reached. The routine reads these values off the calculator stack. Mode can take the following values: 0 : normal mode 1 : inverse mode 2 : shaded mode First can take values in the range 0 to 191 and specifies the first line of pixels to be handled, zero being top line of the display. Depth specifies the number of pixel lines to be handled. To get the routine into the machine, type in the longer-than-average hex loader program which is fairly fool-proof and quite fun to use — as hex loaders go — and should speed up the task of entering the data. Alternatively, a shorter loader program could be used. If you typed it in, save it as it may be useful for entering other hex dumps in the same fairly common format. Now run the loader program and enter the hex and the checksums. The program will then save the code so have a tape ready. Although the code was entered at address 32289 — for the benefit of 16K owners; how come you bought a printer before a RAM expansion? — in fact the code is fully relocatable and will load and work at any address above RAMtop — 48K owners breathe a sigh of relief. The routine is 311 bytes long and uses the printer buffer as a work area. The colour demo program shows the shading patterns used to represent colours and the screen$ demo program dumps a screen$ file in each mode for comparison. 2020, This text and type-in copied by Ignacio Prini Garcia (Spain)