                        ZOOM

                         ZOOM

                          ZOOM



    Mark Jones takes you up, up and away... with this

      instant enlarger for the bleary-eyed Spectrum.



Zoom is an easy to use machine-code utility and allows the

user to enlarge to full screen size the area of the screen

enclosed within a window. This window can be varied in size

from 8-256 pixels wide and from 3-192 pixels high. When in

Magnify mode the magnified area can be viewed continuously

as the window is moved. Since the magnified area can also

itself be magnified, using the same window, infinite magni-

fication is possible, even if of doubtful use. The routine

does not magnify the colour but produces the magnification

in the current permanent attribute colour.

  The routine accesses various Basic variables for its

parameters. This means you do not have to bother Poking any

numbers, but just use a Let statement. If you call the

routine without having assigned the following variables a

"2 Variable not found" error will be given.

  The machine code has comprehensive error checking. Zoom

will not allow XPos or YPos to be values that make a part

of the window go off screen. If, say, XPos was 270, an

illegal screen co-ordinate, Zoom would give XPos a new

value that ensured that the window was entirely on the

screen. This value would vary with the size of the window.

The width of the window can have values between 0 and 5,

the depth can have values between 0 and 6. If the variables

Width or Depth have values that are too big Zoom will

change the value to the maximum permissible value. Likewise

if either has a negative value Zoom will replace the value

with 0. The width and depth numbers correspond to the

following window sizes:

        Width         Depth

    0   256 pixels    192 pixels

    1   128            96

    2    64            48

    3    32            24

    4    16            12

    5     8             6

    6     -             3

Thus to have a window size 64 pixels by 12 pixels, Width

would be 2 and depth would be 4. If you wish to see an

example of Zoom error correcting, load up Zoom code and

then run the following lines of Basic.

    10 LET xpos=260: LET ypos=-10

    20 LET width=6: LET depth=-5

Having run the program type

        RANDOMIZE USR 50000

This will draw the Zoom window. In this case you will see a

very tall, thin window. If you now type PRINT XPos,YPos,

Width,Depth you will find that Width=5, Depth=0, XPos=248

and YPos=192. Since XPos and YPos denote the top left cor-

ner of the window, YPos has been made 192 since the window

is 192 pixels high, i.e., this is the first value of YPos

above -10 that allows the window to appear/sit on the

screen. XPos has been rounded down until the window is on

the screen, in this case 256-window width.

  The algorithm used for Zoom takes each line of the

window, places it in a buffer and keeps on doubling it in

width until it is 32 bytes wide. It then puts the 32-byte

buffer down on the screen - 192/(window y size) - times.

The initial form of the screen is saved at 32768 and the

magnified image is formed on the normal screen, i.e., at

16384. To create Zoom, type in program A and then save it.

Now try running it, if you have no errors, then save the

code. The code can be used independently of program B; this

program is provided to help you use Zoom.



  Basic program commands.



 A ... Clear main screen and back-up.

 B ... Move back-up screen down to current window screen.

 L ... Load with new back-up screen.

 m ... Magnify area under window until new key press.

 M ... Continuously magnify. View can be moved around using

       normal direction keys.

 N ... Retrieve back-up screen.

 P ... Make magnified image current window screen.

 s ... Alter window movement step size.

 x ... Increase window width.

 X ... Decrease window width.

 y ... Increase window depth.

 Y ... Decrease window depth.



  Machine-code routines.



 Address

 50000  XOR current window onto screen. Doing this twice

        will delete the window

 50003  Move screen from 32768 to 16384

 50011  Move screen from 16384 to 32768

 50019  Move screen from 39680 to 16384

 50027  Move screen from 16384 to 39680

 50039  Magnify area under window

   The area 50708-50800 is used as workspace by Zoom and

 should be left clear.

 32768-39679 Used to store screen during magnification.

 39680-46591 Used to store back-up screen.



  Variables.

 XPos....... X co-ordinate of window

 YPos....... Y co-ordinate of window

 Width...... Width of window 0-5

 Depth...... Depth of window 0-6

