!0.......^.........^.........^..

!B

\H11\H07\H10\H01         EVERY PICTURE          

\H11\H07\H10\H01         TELLS A STORY          



!2.......^.........^.........^.........^.........^.........^....

Anyone can be an artist on the Spectrum - it's just a matter of

 co-ordination. Let Chris Somerville tell you where to draw the

                     line.

!1.......^.........^.........^.........^........



Everyone must remember using a pantograph at one

time  or  another  ... but for those who  don't,

it's a mechanical instrument used to translate a

copy  of  a  drawing  to  any  scale. It may  be

cheating  to  use a pantograph but if, like  me,

you  don't have the artistic flair of  Rembrandt

then  it's  a  worthwhile  principle to keep  in

mind.



!0.......^.........^.........^..

ALTERNATIVE ART

!1.......^.........^.........^.........^........

Now there are many excellent programs that allow

you  to  create screen graphics by  manipulating

the    cursor   on-screen.   Unfortunately,  not

everyone's  endowed with the necessary  artistic

talent  that's  needed  to draw directly to  the

screen   -  whether  you're  using  a  keyboard,

joystick or light pen to control the cursor.

  There's  another  method  of  transferring  an

original  drawing  to the screen, and that's  to

trace  the picture on to a piece of  transparent

plastic material and tape it on the screen as  a

drawing guide. Trouble is, the original  drawing

can't  be  bigger  than your TV screen, and  the

distortion caused by the thickness of the screen

precludes accurate work.

  There  are, of course, mechanical/  electronic

graph  pads  and digi-tracers, ranging in  price

from  \H6050  to over \H60100. These, however,  cannot

cope with large sized drawings; certainly, a pop

poster  or  large scale map would be way  beyond

them.



!0.......^.........^.........^..

!B

SQUARING UP

!1.......^.........^.........^.........^........

The program included in this article allows  you

to   transfer  any  drawing  -  a  map,  a  book

illustration,  or whatever - in scaled  outline,

regardless of size. The only restriction on size

is  that the graphic you wish to enter must  lie

in the same proportions as the computer  screen;

this  means  that  any  picture, or part of  the

same,  that  you  intend  transferring  must  be

roughly  in the proportions three units wide  to

two units high.

  Having  chosen  your subject, you now need  to

overlay it with a grid of squares; on  something

like  a map these are already there -  providing

the  necessary  grid references. In most  cases,

though, you'll need to draw a pattern of squares

in pencil over the original illustration. A more

flexible  system,  and  one  that'll  save  your

drawings from being covered with squares, is  to

draw the grid on an acetate sheet (obtained from

any good stationer or art shop - just ask for  a

few pieces of overhead projector film). This can

then be placed over the drawing; you should  use

a fine line marker pen to square up the  acetate

sheet - I'd suggest the Staedtler Lumocolour 313

Permanent.

  The  grid  should be numbered from the  bottom

left-hand  corner, both vertically (Y-axis)  and

horizontally  (X-axis).  Normally, it's best  to

number the co-ordinates of the bottom  left-hand

corner as X=0, Y=0 (or simply 0,0); if you  have

a  grid  numbered in some other fashion - a  map

for example - or if you're using only a  portion

of  a  larger  grid,  it  doesn't matter as  the

program adjusts the co-ordinates and scales  the

square to match the screen.



!0.......^.........^.........^..

!B

YOU GET THE PICTURE

!1.......^.........^.........^.........^........

Once  you've  run  the  program you'll be  asked

whether you require a printout of the final plot

and  draw  positions  of your creation; you  may

need  these  for  inclusion in another  program.

(It's  worth  noting  that  these  are  not  the

co-ordinates as you enter them, but rather their

positions  after  translation.)  If  you  answer

'Yes'  to this option, you'll need to have  your

printer  (ZX Printer, Alphacom 32, or any  other

printer that recognises LPRINT) connected.

  You'll  then  be  asked  to enter the X and  Y

co-ordinates of the bottom left and bottom right

of  the  X-axis. The program will then work  out

the scale, and tell you how many squares high it

can  allow the picture to be (so that the  whole

of  the  picture  can be fitted to scale on  the

TV's  screen).  If  the  maximum  height of  the

picture  area fits in with your scaled  drawing,

then  you  can  continue; if it doesn't,  you'll

have to start again, juggling the X-axis to suit

(increasing the number of squares in the  X-axis

proportionally  increases the number of  squares

in the Y-axis).

  Now  you've  decided  on  the  correct  scale,

you'll be given a number to remember - this acts

as  an  escape  number bringing you back to  the

menu at any time. Normally, the number allocated

to  this  will  be  '999' (just like the  police

emergency number), but if '999' is a number that

you  could tap in as a co-ordinate, the  program

will  assign  you a different escape number.  If

you have trouble with numbers, write it down  so

you  won't  forget it at a vital moment in  your

artistic creation.



!0.......^.........^.........^..

!B

THE FINAL TOUCHES

!1.......^.........^.........^.........^........

I'd   suggest   that  once  you've  scaled  your

picture,  you  save  it to tape. You could  then

re-load   it  into  one  of  the  many  graphics

packages (Melbourne Draw, for instance) and play

around with colour, fill in the outlines, and so

on.

  This  program is not intended to compete  with

other graphics programs, but it's hoped that  it

will  prove a useful addition to the  facilities

they  offer. The program will operate with  both

the 16K and 48K Spectrum; 48K owners may like to

elaborate  their  version  with  a 'Paint  Fill'

option,  or even a cursor controlled  'touch-up'

routine   for   correcting   minor  errors.  Any

additional routines would need to be entered  as

subroutines  and  called from lines 290 to  294.

The menu, k$, would also have to he altered (see

lines  8000  to 8070) to incorporate  additional

command letters.

  Geographical maps prove eminently suitable for

display  on-screen, but any artwork that can  he

seen as a series of outlines (rather than tones)

can  be  treated  effectively. Book covers,  pop

posters  and comic book illustrations all  offer

possible   material.  Even  photographs  can  be

tackled  after  a  fashion - just make sure  you

choose   only  those  prints  that  have  strong

contrast,  that is ones that have bold areas  of

black  and  white.  The  best way to approach  a

photo  is  to  trace  around  the bold areas  of

contrast  -  reducing  the  photo  to a sort  of

contour  map showing the light and dark areas  -

and  then square up and enter it as an  ordinary

outline  drawing.  The  outlines  can  later  be

filled in, using one of the commercial  graphics

packages,     to     give    an  'impressionist'

interpretation of the original photograph.

  But by far the best way to tackle the  program

is  to  just  wade in and start drawing. I'm  no

artist,  but  I'm  well  proud  of  some  of  my

creations ...



!0.......^.........^.........^..

\H11\H07\H10\H00SPECTRUM PANTOGRAPH             

!2.......^.........^.........^.........^.........^.........^....

Once you've typed in the listing and RUN it, have a look through

the menu options available with the package; the various options

are tabulated on the last page of this article.



!0.......^.........^.........^..

   5 CLEAR 30548

  10 RESTORE : FOR i=USR "A" TO

USR "A"+11: READ a: POKE i,a: NE

XT i

  20 DATA 17,0,72,33,86,119,1,0,

8,237,176,201

!2.......^.........^.........^.........^.........^.........^....

Lines 5-20       Clear memory for the program and POKE the data

                 required for the user-defined graphic.



!0.......^.........^.........^..

  25 GO SUB 8000

  30 LET code=USR "A"

  50 GO TO 100

!2.......^.........^.........^.........^.........^.........^....

Lines 25-50      Set the variable 'code' and jump to the 'start'

                 routine.



!0.......^.........^.........^..

  60 POKE code+1,0: POKE code+2,

72: POKE code+4,86: POKE code+5,

119: RANDOMIZE USR code: RETURN

: REM reprint

  70 POKE code+1,86: POKE code+2

,119: POKE code+4,0: POKE code+5

,72: RANDOMIZE USR code: RETURN

: REM copy middle block

  80 IF print=1 THEN  LPRINT "PL

OT ";x;",";y

  85 RETURN

  90 IF print=1 THEN  LPRINT "DR

AW ";x;",";y

  95 RETURN

  97 IF print=1 THEN  LPRINT "CO

RRECTION": LPRINT "PLOT ";cx;","

;cy

  98 RETURN

!2.......^.........^.........^.........^.........^.........^....

Lines 60-98      Set up the printer routines.



!0.......^.........^.........^..

 100 PAPER 6: INK 0: BORDER 7: C

LS

 101 LET print=0: LET cflag=0: L

ET xcor=0: LET ycor=0

 102 PRINT AT 10,0;" DO YOU REQU

IRE A PRINTOUT OF    THE CO-ORDI

NATES ?": PRINT " ENTER Y(Yes) o

r N (No)": PRINT '" NB: PRINTER

MUST BE ATTACHED.": INPUT i$: IF

 i$="Y" THEN  LET print=1

!2.......^.........^.........^.........^.........^.........^....

Lines 100-102    Set up the start variables and 'printer toggle'

                 variable.



!0.......^.........^.........^..

 103 CLS

 105 PRINT '" YOUR DRAWING CAN B

E OVERLAID    WITH A GRID OF SQU

ARES OF ANY   CONVENIENT SIZE. T

HESE SHOULD   BE NUMBERED UP AND

 ACROSS FROM  THE BOTTOM LEFT CO

RNER."

 106 PRINT '" THE NUMBERS ACROSS

 ARE THE          ""X"" CO-ORDIN

ATES": PRINT " THE NUMBERS UPWAR

DS ARE THE         ""Y"" CO-ORDI

NATES": PRINT '" ""X"" CO-ORDINA

TES (ACROSS) ARE": PRINT " ALWAY

S ENTERED FIRST."

!2.......^.........^.........^.........^.........^.........^....

Lines 103-106    Print up some brief instructions on-screen.



!0.......^.........^.........^..

 107 PRINT '' PAPER 7;" PLEASE E

NTER THE X AND Y        CO-ORDIN

ATES OF THE BOTTOM      LEFT HAN

D CORNER.              ": PLOT 2

,2: DRAW 0,171: DRAW 251,0: DRAW

 0,-171: DRAW -251,0

 108 INPUT "X = ";xcor;" Y = ";y

cor

 109 CLS

!2.......^.........^.........^.........^.........^.........^....

Lines 107-109    Request the first set of X and Y coordinates.



!0.......^.........^.........^..

 110 LET ux=0: LET uy=0

 150 PRINT '" NOW ENTER THE X CO

-ORDINATE OF  THE BOTTOM RIGHT H

AND CORNER."

 160 INPUT "X = ";tux: LET tux=t

ux-xcor: IF tux<=ux THEN  BEEP .

1,60: GO TO 160

!2.......^.........^.........^.........^.........^.........^....

Lines 110-160    Request the second set of X and Y coordinates.



!0.......^.........^.........^..

 170 LET tuy=(tux-ux)*175/(255-u

y)

 175 LET ttuy=tuy+ycor: LET ttux

=tux+xcor

 176 CLS

 180 PRINT ''''''"     TOP RIGHT

 CORNER WILL BE              ";t

tux;" ACROSS": PRINT "          

  ";ttuy;" UP"

 190 PRINT ' PAPER 7;"      IS T

HAT SATISFACTORY?          PRESS

 Y (Yes) or N (No)    "

 200 IF INKEY$<>"" THEN  GO TO 2

00

 210 LET i$=INKEY$: IF i$="" THE

N  GO TO 210

 220 IF i$="n" OR i$="N" THEN  G

O TO 1

!2.......^.........^.........^.........^.........^.........^....

Lines 170-220    Print the grid size, and ask if the size is

                 suitable for the illustration you wish to copy

                 on-screen.



!0.......^.........^.........^..

 225 LET prop=175/tuy

 230 LET escape=0: IF ux<=0 OR u

y<=0 THEN  LET escape=999

 235 IF tux>=escape THEN  LET es

cape=INT (tux+10)

 240 PRINT '"      PLEASE REMEMB

ER                 THIS NUMBER "

; BRIGHT 1;escape

 250 PRINT "      WHICH WILL RET

URN YOU           TO THE MENU"

 255 LET escape=escape+xcor

 260 PRINT AT 21,0;"   PRESS ANY

 LETTER TO START"

 265 IF INKEY$<>"" THEN  GO TO 2

65

 270 LET i$=INKEY$: IF i$="" THE

N  GO TO 270

 280 CLS

!2.......^.........^.........^.........^.........^.........^....

Lines 225-280    Evaluate and print the escape number.



!0.......^.........^.........^..

 290 POKE 23658,8: GO SUB 70: PR

INT AT 8,0;k$: INPUT "MENU INSTR

UCTION LETTER? "

 291 IF INKEY$<>"" THEN  GO TO 2

91

 293 LET m$=INKEY$: IF m$="" THE

N  GO TO 293

!2.......^.........^.........^.........^.........^.........^....

Lines 290-293    This routine marks the beginning of the main

                 program.



!0.......^.........^.........^..

 294 IF m$<>"W" AND m$<>"J" AND

m$<>"R" AND m$<>"K" AND m$<>"D"

AND m$<>"C" AND m$<>"S" AND m$<>

"L" AND m$<>"P" AND m$<>"F" THEN

  GO TO 291

!2.......^.........^.........^.........^.........^.........^....

Line 294         Checks to see if the menu input is valid.



!0.......^.........^.........^..

 296 GO SUB 60

 297 IF m$="R" THEN  GO TO 460

 298 IF m$="J" THEN  LET print=1

: GO TO 1010

 300 IF m$="C" OR m$="c" THEN  L

ET cflag=1: PLOT  OVER 1;cx,cy:

LET x=cex: GO TO 1070

 310 IF m$="D" THEN  GO TO 1000

 315 IF m$="K" THEN  LET print=0

: GO TO 1010

 320 IF m$="P" THEN  COPY : GO T

O 290

 330 GO TO (CODE m$*10)+9000

!2.......^.........^.........^.........^.........^.........^....

Lines 296-330    Send the program to the relevant subroutine 

                 depending on which key you pressed.



!0.......^.........^.........^..

 400 FOR i=1  TO LEN x$: IF CODE

 x$(i)<>46 AND CODE x$(i)<48 OR

CODE x$>57 THEN  LET x=ux-1: RET

URN

 405 NEXT i

 410 LET x=VAL x$: RETURN

 420 FOR i=1  TO LEN y$: IF CODE

 y$(i)<>46 AND CODE y$(i)<48 OR

CODE y$>57 THEN  LET y=uy-1: RET

URN

 425 NEXT i

 430 LET y=VAL y$: RETURN

 455 STOP

 460 INPUT "ARE YOU SURE? Y or N

 ";i$: IF i$="Y" THEN  RUN

 470 GO TO 290

1000 REM PLOT ROUTINE

1010 INPUT "START POINT ACROSS="

;x$: GO SUB 400: LET x=x-xcor: I

F x<ux OR x>tux AND x<>escape-xc

or-xcor THEN  BEEP 1,55: GO TO 1

010

1011 IF x=escape-xcor-xcor THEN

 GO TO 290

1012 INPUT "START POINT UPWARDS=

";y$: GO SUB 420: LET y=y-ycor:

IF y<uy OR y>tuy THEN  BEEP 1,55

: GO TO 1011

1015 LET x=x*prop

1020 LET y=y*prop

1030 PLOT x,y: LET oldx=x: LET o

ldy=y: GO SUB 80

1040 INPUT "NEXT POINT ACROSS ";

x$: GO SUB 400: LET x=x-xcor: IF

 x<ux OR x>tux AND x<>escape-xco

r-xcor THEN  BEEP 1,55: GO TO 10

40

1045 IF x=escape-xcor-xcor THEN

 GO TO 290

1046 INPUT "NEXT POINT UPWARDS "

;y$: GO SUB 420: LET y=y-ycor: I

F y<uy OR y>tuy THEN  BEEP 1,55:

GO TO 1046

1050 LET x=x*prop: LET x=x-oldx

1060 LET y=y*prop: LET y=y-oldy

1065 LET cx=oldx: LET cy=oldy

1066 LET cex=x

1070 DRAW  OVER 1;x,y: LET oldx=

PEEK 23677: LET oldy=PEEK 23678:

 IF cflag=1 THEN  PLOT cx,cy: LE

T oldx=cx: LET oldy=cy: LET cfla

g=0: GO SUB 97: GO TO 1080

1071 GO SUB 90

1080 GO TO 1040

!2.......^.........^.........^.........^.........^.........^....

Lines 400-1080   Contain the subroutines for all the menu

                 options.



!0.......^.........^.........^..

8000 LET k$="\H8b\H83\H83\H83\H83\H83\H83\H83\H83\H83\H83\H83\H83\H83\H83\H83\H83\H83\H83

\H83\H83\H83\H83\H83\H83\H83\H83\H83\H83\H83\H83\H87"

8010 LET k$=k$+"\H8a R = RESTART  J

 = START LPRINT\H85"

8020 LET k$=k$+"\H8a P = COPY  K =

CANCEL LPRINT  \H85"

8040 LET k$=k$+"\H8a C = CANCEL LAS

T LINE DRAWN   \H85"

8050 LET k$=k$+"\H8a S = SAVE THE P

ICTURE TO TAPE \H85"

8060 LET k$=k$+"\H8a L = LOAD A PIC

TURE FROM TAPE \H85"

8065 LET k$=k$+"\H8a D=DRAW    W=WO

RDS   F=FINISH \H85"

8070 LET k$=k$+"\H8e\H8c\H8c\H8c\H8c\H8c\H8c\H8c\H8c\H8c\H8c\H8c\H8c\H8c\H8c\H8c

\H8c\H8c\H8c\H8c\H8c\H8c\H8c\H8c\H8c\H8c\H8c\H8c\H8c\H8c\H8c\H8d"

8080 RETURN

9494 STOP

9495 INPUT i$: IF i$<>"KAMTIN" T

HEN  RUN

9496 STOP

9700 CLS : PRINT AT 10,0; PAPER

7; INK 2;"    \H7f 1984 CHRIS SOMER

VILLE     ": PRINT AT 20,0;"    

    PRESS R TO RESTART": PRINT "

        PRESS C TO CLEAR"

9710 IF INKEY$<>"" THEN  GO TO 9

710

9720 LET i$=INKEY$: IF i$="" THE

N  GO TO 9720

9730 IF i$="C" THEN  RANDOMIZE U

SR 0

9740 RUN

!2.......^.........^.........^.........^.........^.........^....

Lines 8000-9740  Print up the menu table on-screen requesting 

                 the option you want to use.



!0.......^.........^.........^..

9760 INPUT "PICTURE NAME ?";i$:

IF LEN i$>10 THEN  GO TO 9760

9770 LOAD i$SCREEN$ : GO TO 290

9830 INPUT "PICTURE NAME =";i$:

IF LEN i$>10 THEN  GO TO 9830

9840 SAVE i$SCREEN$ : GO TO 290

!2.......^.........^.........^.........^.........^.........^....

Lines 9760-9840  Contain the 'load' and 'save' routines.



!0.......^.........^.........^..

9870 INPUT "LINE(0-21)=";l$;"ROW

(0-31)=";r$: FOR i=1 TO LEN r$:

IF CODE r$(i)<48 OR CODE r$(i)>5

7 THEN  BEEP .5,55: GO TO 9870

9871 NEXT i

9872 FOR i=1 TO LEN l$: IF CODE

l$(i)<48 OR CODE l$(i)>57 THEN

BEEP .5,55: GO TO 9870

9873 NEXT i

9874 LET r=VAL r$: LET l=VAL l$:

 IF l<0 OR l>21 OR r<0 OR r>31 T

HEN  BEEP 1,55: GO TO 9870

9875 INPUT "TEXT=";t$: PRINT  OV

ER 1;AT l,r;t$: INPUT "IS THAT O

K Y? N?";i$: IF i$="N" THEN  PRI

NT  OVER 1;AT l,r;t$: GO TO 9870

9878 GO TO 290

!2.......^.........^.........^.........^.........^.........^....

Lines 9870-9878  Provide the 'test printing' subroutine.



!0.......^.........^.........^..

9980 SAVE "D" LINE 1

9982 SAVE "D" LINE 1

9983 STOP

!2.......^.........^.........^.........^.........^.........^....

Lines 9980-9983  Save two copies of the program.

!0.......^.........^.........^..

!B



\H11\H07\H10\H00          MENU OPTIONS          

!2.......^.........^.........^.........^.........^.........^....

KEY COMMENT

 C  Pressing 'C' (the 'CORRECTION' key) simply deletes the

    previous drawing position. Thus, if you make a mistake, you

    can return to the menu, press 'C' and continue where you

    left off.

 D  Once you press 'D' (the 'DRAW' key) you'll be asked to

    provide the coordinates of the starting position, and of

    each subsequent position you want to draw a line to. It's

    rather like those 'join the dots' mystery pictures in

    childrens' books, only in this case you're specifying where

    each dot is to go and the Spectrum's connecting them

    together. It's unlikely that all the points you'll want to

    draw to will fall conveniently on your grid lines, but the

    program will happily accept positions like X=1222.5, Y=16.8.

    At this point, it's worth making a note that when you're

    planning the initial grid of squares, the finer your grid

    the more detail you can introduce to the final on-screen

    drawing. On the other hand, if all you're after is a broad

    outline, then a relatively small number of large squares

    should suffice. Once you reach the end of a line and want to

    move on to a new starting position, simply type in the

    escape number and return to the menu to start over. (Unlike

    the normal Spectrum DRAW procedure, there's no calculation

    involved - you read off the coordinates for each point

    that's connected on the original drawing and it'll be

    reproduced to the scale you want.)

 F  Press this key when you want to stop using the program.

J/K These two keys are used to activate ('J') or cancel ('K')

    the instruction to print out coordinates to the printer.

 L  This command loads back a previously saved picture. If

    you're planning to load back a partially finished picture,

    you'll have to enter the original coordinates applicable

    before you can continue drawing.

 P  The 'P' key allows you to print the picture on-screen to the

    ZX Printer (or any other printer that accepts the COPY

    command).

 R  This key is used to restart the program once you've finished

    with one drawing and want to start on another.

 S  Making use of the SAVE SCREEN$ function, the 'S' key saves

    the screen picture to cassette.

 W  The 'W' key allows you to print a text label at any speci-

    fied position on the screen. This function uses the screen

    PRINT AT positions for line (0 to 21) and row (0 to 31).

!1.......^.........^.........^.........^........

!B



--

from Your Spectrum #11 (Feb.1985)

--

!$

