If MZZ=22 and Mouse Key=1 Then I=Point(X Screen(X Mouse),Y Screen(Y Mouse)) : Proc ZCOLBAR : Ink I
If X<14 or X>145 or Y<30 or Y>161 Then Goto NULL
Draw TX,TY To TX1,TY1
Wend
SET=0
Until A$=" "
FINISHED:
Put Block 1
End Proc
'
' Nothing in the next procedure
'
Procedure F14
If T<>14 Then Paste Bob XB,YB,BO Else Goto FINISHED
Paste Bob 305,114,35
XB=305 : YB=114 : BO=13 : T=14
FINISHED:
End Proc
'
' Nothing in the next procedure
'
Procedure F15
If T<>15 Then Paste Bob XB,YB,BO Else Goto FINISHED
Paste Bob 292,127,73
XB=292 : YB=127 : BO=72 : T=15
If PAGE=0 Then Change Mouse 3 : On Error Proc SWERROR : Spack 0 To 14 : Unpack 15 To 0 : PAGE=1 : Proc SETUPSCREEN : Change Mouse 2
FINISHED:
End Proc
'
' Nothing in the next procedure
'
Procedure F16
If T<>16 Then Paste Bob XB,YB,BO Else Goto FINISHED
Paste Bob 305,127,40
XB=305 : YB=127 : BO=17 : T=16
If PAGE=1 Then Change Mouse 3 : On Error Proc SWERROR : Spack 0 To 15 : Unpack 14 To 0 : PAGE=0 : Proc SETUPSCREEN : Change Mouse 2
FINISHED:
End Proc
'
' Next comes the procedure that belongs to the 'UNDO' button. It's very
' simple, just copying screen 1 to the current drawing screen - screen 0
' whenver it is called
'
Procedure FUNDO
'
' We check here if the last procedure called was this one, and if not
' we paste the un-highlighted bob on the menu bar for the last used pro-
' cedure.
'
'
' Now we paste the highlighted bob for this procedure on the menu bar.
'
Paste Bob 292,140,36
'
'
' Label the 'doing' part of this procedure next.
'
BEGIN:
'
' And set the skip variable to one. The tells the procedure that checks
' the various screen zones that this procedure has been used and not to
' come here again until some kind of drawing operation has been done that
' will justify coming here again.
'
SKIP=1
'
' Then we copy the drawing area from screen 1 back to screen 0. The numbers
' just tell the computer ONLY to copy to drawing area and not the title and
' menu bars.
'
Screen Copy 1,1,11,290,263 To 0,1,11
'
' Then we bring the newly copied image to the front of the display with the
' next line.
'
Screen To Front 0
Paste Bob 292,140,14
'
' And end the procedure ...
'
End Proc
'
' Next up is the screen clearing procedure and this must be the simplest
' ever. It simply uses the AMOS command 'Cls' with the dimensions of our
' drawing area to clear both screen 0 and 1.
'
Procedure FCLS
'
' I wont bother boring you with the next lines as we've gone over them
' seventeen times already and these are no different.
'
Paste Bob 305,140,37
BEGIN:
'
' Here we just set the graphics pointer to screen 0 and then clear it
' will the 'Cls' command and the dimensions of our screen.
'
Screen 0 : Cls 0,1,11 To 290,263
'
' Same again for screen 1
'
Screen 1 : Cls 0,1,11 To 290,263
'
' And reset the graphics pointer back to screen 0 for further drawing.
'
Screen 0
'
' We paste the un-highlighted bob for this procedure on the menu bar our
' selves, because this procedure ends immediately.
'
Paste Bob 305,140,15
'
' And end it with the next line.
'
End Proc
'
'
' Down here is the procedures that actually do something, the ones that
' do the hard work. All of procedures above are just responsible for
' calling the ones down here. Some do seem a little daunting, but as before
' if you stick with me as we plough through them, you'll soon see that there
' is nothing in them that will bring out a sweat. As it goes, Easypaint
' was a very simple program to write, the hardest part being writing this
' documentation! So don't lose heart now.
'
Procedure RAYLINE
While Mouse Key=0
X=X Screen(X Mouse) : Y=Y Screen(Y Mouse)
Wend
BEGIN:
While Mouse Key=1
X1=X Screen(X Mouse) : Y1=Y Screen(Y Mouse)
Wend
Draw X,Y To X1,Y1
X=X Screen(X Mouse) : Y=Y Screen(Y Mouse)
If Mouse Key=2 Then Goto FINISHED
Goto BEGIN
FINISHED:
End Proc
Procedure AIRBRUSH
PROG=20
BEGIN:
Repeat
If Mouse Key=2 or Mouse Zone<>0 Then Goto FINISHED
If Mouse Zone=22 and Mouse Key=1
I=Point(X Screen(X Mouse),Y Screen(Y Mouse))
Ink I
Proc ZCOLBAR
End If
Until Mouse Key<>0
_SCOPY
While Mouse Key=1
If Mouse Zone<>0 and Mouse Zone<>22 Then Goto FINISHED
X1=Rnd(10) : Y1=Rnd(10)
X=X Screen(X Mouse) : Y=Y Screen(Y Mouse)
If X<6 or X>284 or Y<16 or Y>257 Then Goto BEGIN
Ink I : Plot X-5+X1,Y-5+Y1
If DENSITY=0 Then Goto FINISHED Else For LOP=1000 To DENSITY*10 Step -1 : Next LOP
MIDDLE:
Wend
Goto BEGIN
FINISHED:
End Proc
'
' Here's the cross-hairs procedure - those horizontal and vertical lines
' that cross through the mouse pointer. Again, extremely easy to implement.
'
Procedure CROSSHAIRS
'
' First of all we don't want the cross-hairs to be writing over any of the
' users graphics so we set the drawing mode to XOR. This is the term also
' known as 'Exclusive Or', loosely translated means that anything drawn twice
' in the same place will be removed without harming existing graphics.
'
Gr Writing 2
'
' And we mark the actual 'doing' part of this procedure with the popular
' label 'Begin'
'
BEGIN:
'
' Now we load the X and Y variable with the current mouse position on the
' screen because we will need these positions to draw our cross-hairs.
'
X=X Screen(X Mouse) : Y=Y Screen(Y Mouse)
'
' Next up comes a check on variables. First we check the X variable to see
' if it is less than 0 or greater than 289. The numbers are the left and
' right borders of the drawing area, and if the X variable exceeds either one
' then we dont want to past that point do we, otherwise the menu bar and top
' title line will become all messy! Otherwise we jump to the FINISHED label
' if the next line checks out.
'
' If X<0 or X>289 Then Goto FINISHED
'
' Same now for the Y variable. Remember the Y variable holds the vertical
' position of the mouse, so we check if Y is less than 12 (the top of the
' drawing area) or greater than 263 (the bottom of the drawing area). If
' either proves to be true then we jump to the FINISHED label to end this
' procedure. You could just Run this program now to see the effect when
' the cross-hairs are switched on and you leave the drawing area.
'
If Y<12 or Y>263 Then Goto FINISHED
'
' Now we simply draw to straight lines using the position of the mouse we
' just put into the variables X and Y. First we draw the vertical line the
' size of the screen X pixels horizontally. Note that there is a graphic
' description of these two lines in the notes supplied in the package, look
' under Easypaint.
'
Draw X,13 To X,263
'
' Then we draw the horizontal line the size of the drawing area using the
' Y variable as a starting point.
'
Draw 0,Y To 289,Y
'
' Another label now. This one preceeds the next line for a good purpose.
' If the user stops moving the mouse then we dont want to keep drawing the
' cross-hairs all the time do we ? Not only is it pointless but it also
' generated an annoying flicker, this label stops this by giving this
' procedure somewhere to go without re-drawing the lines.
'
BEGIN2:
'
' Here's the check that will see if the mouse is stationary. It does this
' by checking the current position of the mouse with the last positions we
' previously stored in X and Y. If both match then we jump to the above
' label. Since this is a potentially close loop we must also check for the
' mouse to leave to drawing area
'
If Mouse Zone<>0 or Mouse Key=1 Then Goto BEGIN3 :
If X Screen(X Mouse)=X and Y Screen(Y Mouse)=Y Then Goto BEGIN2
BEGIN3:
'
' Next is a wait for a vertical blank. This is the time it takes the
' beam in your TV or monitor to return to the top of the picture to start
' burning phospur again. Pointless info maybe, but it helps to reduce the
' flicker when drawing the cross-hairs.
'
Wait Vbl
'
' And now we draw the cross-hairs again, exactly the same as before to remove
' them from the display. We are still in XOR mode so nothing will be
' destroyed on the users picture.
'
Draw X,12 To X,263
Draw 0,Y To 289,Y
'
' And we set the drawing mode back to normal with the next command
'
Gr Writing 1
'
' We still use the FINISHED label to mark the end of this procedure should
' any line above want to end.
'
FINISHED:
'
' Of course, 'End Proc' tells the computer that this is the end of this
' procedure. NOTE, you will have probably noticed that this procedure only
' draws the cross-hairs once and then ends, it is the reponsibility of other
' procedure to call this procedure in their main loop, as I'm sure you can
' remember !
'
End Proc
'
' Now the smallest procedure in this program, three lines that simply copy
' an exact image of the drawing area into screen 1.
'
Procedure _SCOPY
'
' The next line does the copying, the numbers are the co-ordinates of the
' drawing area. A screen chart is available in the notes that accompany
' this program, and don't forget that command formats can be found in the
' AMOS user guide you got with your AMOS package.
'
Screen Copy 0,1,11,290,263 To 1,1,11
'
' Now we set the graphics pointer back to Screen 0, just to make sure that
' our drawing operations will take place on our drawing, and not some spare
' screen.
'
Screen 0
'
' And end this procedure.
'
End Proc
'
' Another small procedure now. This one prints the co-ordinates of the
' mouse on the top menu bar.
'
Procedure COORDS
'
' We start by loading the co-ordinates of the mouse into the variables XX
' and YY.
'
XX=X Screen(X Mouse)
YY=Y Screen(Y Mouse)
'
' The next line may seem a little alien ? What we are doing is loading the
' variable C$ with a string conversion of the variables XX and YY. Why ?
' Well we need to convert the numeric variables into strings because of the
' way we need to display the information with the 'Text' command. It's best
' to put the information into a single string variable (C$) than have lots
' of conditions in the 'Text' command, otherwise we will have lots and lots
' of hassle.
'
C$=Str$(XX)+" "+Str$(YY)+" "
'
' Now we set the ink colour to 0 (black) regardless of the ink colour the
' program is currently using. We use the 'Text' command instead of a 'Print'
' for the benefit of being able to position our text to the nearest pixel
' rather than character position. The numbers the pixel position on the
' top title bar.
'
Gr Writing 1 : Ink 0 : Text 232,7,C$
'
' And end the procedure.
'
End Proc
'
' The next three procedure are used to read the pull-down menus. It may
' help you to understand what each one is doing by reading the notes
' supplied for the Easy Paint program that explain the menu' layout.
' Due to the length of the program lines, it has also been necessary for
' this and other reasons to explain these procedures in the notes. I
' apologise for any inconvenience this may cause, but I'm sure you'll
' see it is the better way of doing it.
'
Procedure MENCHECK1
'
' The way pull down menus are created is a bit like a family tree, with
' each option having options leading from it, and those also having options
' leading from them. We can check which option has been selected by using
' the 'Choice' command with a value in brackets denoting which part of the
' 'tree' we want to read. So the next line reads each tree into three
' variables A, B and C. More information is available in the AMOS manual
' and the notes supplies with this program
'
A=Choice(1) : B=Choice(2) : C=Choice(3)
'
' Now we come to read the variables to find which menu option has been
' selected, there is no quick way around this, so each option has to be
' read individually. What we do know though, is that we wouldn't be in
' this procedure unless an option had been selected from the Picture
' menu. Remember a long while back at the start of this program we set
' up an interrupt that read the pull-down menus full time ? Well, we also
' told the computer to jump to the respective procedures, these being
' MENCHECK1, MENCHECK2 and MENCHECK3 which relate to the menu options of
' 'Picture', 'Brush' and 'Prefs'. It's really quite pointless explaining
' every line as you can see what is being done, the variables A, B and C
' hold numbers that relate to the option selected. We just check these
' numbers and jump to the procedure that relates that option.
'
' The FILESELECTOR has three types to it - LOAD, SAVE and DELETE, the number
' in brackets holds the type we wish to use.
'
If A=1 and B=1 Then Proc FILESELECTOR[1] : Screen 0
If A=1 and B=2 Then Proc FILESELECTOR[2] : Screen 0
If A=1 and B=3 Then Proc FILESELECTOR[3] : Screen 0
'
' The procedure SELECTPALETTE is the palette selector.
'
If A=1 and B=4 and C=1 Then Proc SELECTPALETTE
'
' The procedure DEFPALETTE is responsible for setting the pallete back to
' its default values.
'
If A=1 and B=4 and C=2 Then Proc DEFPALETTE
'
' The next 6 lines are much larger than this display so you may need to
' scroll the display to read them fully. The next two are used to copy
' the spare page between the memory banks and screen 0. The 'Spack'
' command is used to compress a screen display into a given memory bank
'
If A=1 and B=5 and C=1 and PAGE=0 Then Change Mouse 3 : On Error Proc SWERROR : Spack 0 To 14 : Unpack 15 To 0 : PAGE=1 : Proc SETUPSCREEN : Change Mouse 2 : Goto FINISHED
If A=1 and B=5 and C=1 and PAGE=1 Then Change Mouse 3 : On Error Proc SWERROR : Spack 0 To 15 : Unpack 14 To 0 : PAGE=0 : Proc SETUPSCREEN : Change Mouse 2 : Goto FINISHED
If A=1 and B=5 and C=2 and PAGE=0 Then Change Mouse 3 : Spack 0 To 15 : Proc SETUPSCREEN : PAGE=1 : Change Mouse 2 : Goto FINISHED
If A=1 and B=5 and C=2 and PAGE=1 Then Change Mouse 3 : Spack 0 To 14 : Proc SETUPSCREEN : PAGE=0 : Change Mouse 2 : Goto FINISHED
If A=1 and B=5 and C=3 and PAGE=0 Then Change Mouse 3 : Erase 15 : Proc SETUPSCREEN : Change Mouse 2 : Goto FINISHED
If A=1 and B=5 and C=3 and PAGE=1 Then Change Mouse 3 : Erase 14 : Proc SETUPSCREEN : Change Mouse 2 : Goto FINISHED
If A=1 and B=6 Then Edit
FINISHED:
On Menu On
End Proc
Procedure MENCHECK2
A=Choice(1) : B=Choice(2) : C=Choice(3)
If A=2 and B=1 and C=1 and BY1>BY Then Proc BHALF
If A=2 and B=1 and C=2 and BY1>BY Then Proc BDOUBLE
If A=2 and B=1 and C=3 and BY1>BY Then Proc BDOUBLEHORIZ
If A=2 and B=1 and C=4 and BY1>BY Then Proc BDOUBLEVERT
If A=2 and B=2 and C=1 and HFLIP=0 Then HFLIP=1 : Goto FINISHED
If A=2 and B=2 and C=1 and HFLIP=1 Then HFLIP=0 : Goto FINISHED
If A=2 and B=2 and C=2 and VFLIP=0 Then VFLIP=1 : Goto FINISHED
If A=2 and B=2 and C=2 and VFLIP=1 Then VFLIP=0 : Goto FINISHED
If A=2 and B=3 and C=1 Then Proc FLIP180
FINISHED:
On Menu On
End Proc
Procedure MENCHECK3
A=Choice(1) : B=Choice(2) : C=Choice(3)
If A=3 and B=1 Then Bell : If COORDS=0 Then COORDS=1 Else COORDS=0 : Text 232,7," "
If A=3 and B=2 Then Proc AIRPOWER
On Menu On
End Proc
'
' Next comes a small procedure that simply amends variables and has nothing
' at all to do with any graphic operations straight to the screen. What we
' are doing inside this procedure is simply switching variable quantities
' if our conditions are met - if either HFLIP or VFLIP = 1 then we set them
' to 0. Likewise if either equal 0 when we enter this procedure then we set
' them to 1. The variables themselves are fairly self explanatry, HFLIP
' holds a value that tells us if the current brush is flipped (1) or not
' horizontally, and VFLIP holds a value that tells us if the current brush
' is also flipped (1) or not vertically. Not much else really.
'
Procedure FLIP180
If HFLIP=0 Then HFLIP=1 : Goto BEGIN
If HFLIP=1 Then HFLIP=0 : Goto BEGIN
BEGIN:
If VFLIP=0 Then VFLIP=1 : Goto FINISHED
If VFLIP=1 Then VFLIP=0 : Goto FINISHED
FINISHED:
End Proc
'
' Here is the procedure that reads the directory of a disc into the array
' we dimensioned a long time ago at the start of this program. Nothing at
' all special in here apart from a couple of AMOS commands you might not be
' familiar with - 'Dir First$()' and 'Dir Next$'. I'll explain them as
' we come to them.
'
Procedure GDIR
'
' Taking the next variables in order, the first is simply a counter used by
' this procedure and the zone checking procedure to show that this procedure
' has been called succesfully, the same for the next variable. The variable
' XX is used to hold the start point in the array FAME$ that the directory
' will be loaded into.
'
FRESH=1
XYZ=1
XX=1
'
' Okay, the first of the AMOS commands. What 'Dir First$()' does is to
' first check the path (Disk Drive) it will look at, we simply tell it to
' look at the current path held in the command 'Dir$' - this is always
' loaded with some information because AMOS itself reads this variable when
' you click on the file selector. Then it reads the length and name of the
' first file on the disk ('Dir$') and puts it into the array FAME$ at
' position 1 (the variable XX holds this value). This command - 'Dir First$'
' also loads the entire directory into memory, which we then need to read
' into our array with the next few lines
'
FAME$(XX)=Dir First$(Dir$)
'
' So we start a simple 'For/Next' Loop using the same counter variable as
' before (XX) with a start value of 2. Remember that the first position of
' the FAME$ array was filled in the previous line
'
For XX=2 To 50
'
' And we use the command 'Dir Next$' to read each directory listing from
' memory and store it in the FAME$ array.
'
FAME$(XX)=Dir Next$
'
' And we increment the XX variable in the loop with the next command.
'
Next XX
'
' Before the command that will end this procedure I should point out that
' this procedure will only read 50 directory entries from any disc, this
' can be easily altered by changing the value at the start of this program
' that dimensions the FAME$ array, and then altering the above loop to this
' new value.
'
End Proc
'
' Yes you've guessed it, I've even used a procedure to move the path into
' a sub-directory, they are just so convenient! Again though, nothing
' difficult here apart from the first line, but then, that's nothing really
' hard as you'll see ...
'
Procedure UPATH
'
' Okay, from the beginning you see the variable PATH2$, this is where we
' will set the string variable which will eventually tell the computer which
' path we want to enter and is only temporary. Next comes the 'Mid$' command
' that we use to snatch pieces of a string variable with. A little insight
' would be useful here ... when the user clicks on a directory in the file
' selector, this procedure checks which line the user has clicked and just
' grabs the whole line from the FAME$ array, the problem with that is that
' whatever it grabs also has things such as the length of the file held in
' the string, so we need to strip this info out so we just have the name of
' the directory and nothing else - not even spaces. We also don't want the
' asterixes that are displayed on the file selector (*) before a directory
' listing. So knowing this we know we want to start at the second character
' of our string (to miss the *) and grab the whole string up to the 27th
' character, as this is the width of the file selectors display, then we can
' be sure of getting all the information. Also, the part of the next line
' that reads thus - (FAME$(XYZ+LINE-2) can be explained thus, thus !! XYZ
' is simply a dumb variable that holds a value of 1 full time and does
' nothing else. The variable LINE is the line position on the file selector
' of which the user has selected a directory, by subtracting 2 from this
' variable we get the position in the array of the directory!
'
PATH2$=Mid$(FAME$(XYZ+LINE-2),2,27)
'
' Now we set a loop that will move through 1 to 27 so we can check each
' character of the PATH2$ variable for spaces. If we find a space then we
' mark the postion in the KI variable and end the loop. Remember, this is
' is so can remove any spaces from the string before we ask the computer to
' read the directory from our variable.
'
For LOP=1 To 27
PL$=Mid$(PATH2$,LOP,1)
If PL$=" " Then KI=LOP : LOP=27
Next LOP
'
' Next we set the variable PATH$ with the final draft of our task by using
' a value of KI-1 so we dont have any spaces at all in the string.
'
PATH$=Mid$(PATH2$,1,KI-1)
'
' Then we need to set the actual directory that AMOS uses to our string
' while also adding the oblique character (/) so AMOS knows it is to access
' a directory and nothing else.
'
Dir$=Dir$+PATH$+"/"
'
' Then get the directory again by calling the GDIR procedure.
'
Proc GDIR
'
' And end this fucking twat of a procedure.
'
End Proc
'
' I can tell you that documenting this next baby wasn't exactly my idea of
' a thrilling time, but please don't be put off. This is the main body of
' the fileselector and can load, save, delete and rename files so it's not
' that long for what it does, and it isn't really difficult to grasp.
' Note that to call the various functions Load/Save/Delete you need to pass
' a number 1,2 or 3 into this procedure by using the TYPE variable.
'
Procedure FILESELECTOR[TYPE]
'
' We use a spare screen for the file selectors display so as not to over
' complicate things with trillions of zones and windows all over the place
' The next line does this screen opening.
'
Screen Open 3,320,276,64,Lowres : Paper 0 : Curs Off : Flash Off : Cls
'
' And we load the sprite palette
'
Get Sprite Palette
'
' Bring the screen to the front
'
Screen To Front 3
'
' And set the drawing pointer to here.
'
Screen 3
'
' Next we reserve the screen zones that will be used for the various buttons
' and displays.
'
Reserve Zone 20
'
' And set the FRESH variable to 0 to tell us that this procedure has just
' been freshly called.
'
FRESH=0
'
' We have reserved the zones so now we need to tell the computer at which
' co-ordinates to set the zones. All the co-ordinates are held in the
' data statements.
'
For LOP=1 To 20
Read A,B,C,D
Set Zone LOP,A,B To C,D
Next LOP
Data 254,55,265,68,253,137,265,150,77,158,257,168,77,174,257,184
Data 82,189,133,201,149,189,200,201,212,189,263,200,18,189,69,201
Data 16,55,247,62,16,64,247,70,16,72,247,78,16,80,247,86,16,88,247,94
Data 16,96,247,102,16,104,247,110,16,112,247,118,16,120,247,126
Data 16,128,247,134,16,136,247,142,16,144,247,150
'
' Now we draw the boxes and bars that make up the components of the file
' selector.
'
Ink 1
Bar 12,35 To 268,156
Ink 0 : Draw 12,50 To 268,50
Draw 12,155 To 268,155
Ink 0 : Bar 252,53 To 267,152
Ink 1
Bar 12,156 To 268,205
Ink 0 : Bar 77,158 To 257,168
Ink 0 : Bar 77,174 To 257,184
Box 14,53 To 250,152
'
' As I said earlier, this procedure is configurable to Save/Load/Delete
' so here we check the TYPE variable and display the relevant title.
'
If TYPE=1 Then Locate 10,5 : Paper 1 : Pen 0 : Print " Load Picture"
If TYPE=2 Then Locate 10,5 : Paper 1 : Pen 0 : Print " Save Picture"
If TYPE=3 Then Locate 10,5 : Paper 1 : Pen 0 : Print " Delete Picture"
'
' Next we just print the other information on the file selector.
'
Locate 2,20 : Print "Drawer"
Locate 2,22 : Print "File"
Locate 2,7 : Pen 31 : Print "<DEV> DF0:"
Locate 2,8 : Print "<DEV> DF1:"
'
' I know some people will say its bad practice to use blitter objects (bobs)
' for the various buttons in this program, but I belive it is best to show
' the method in which the buttons are animated. Of course you could just
' XOR a box over the buttons to show a depression. None-the-less, this
' is what the next lines are doing, pasting bobs on the file selector to act
' as buttons. You could go into direct mode now and paste the bobs yourself
' to see what is happening, the bobs are listed in the supplied notes.
'
Paste Bob 254,56,43
Paste Bob 254,137,44
Paste Bob 18,189,48
Paste Bob 82,189,47
'
' We check the TYPE variable again here so we know which key bob to paste.
' By key bob, I mean Save/Load/Delete buttons, the others remain constant.
'
If TYPE=1 Then Paste Bob 149,189,46
If TYPE=2 Then Paste Bob 149,189,59
If TYPE=3 Then Paste Bob 149,189,60
Paste Bob 212,189,45
'
' Now we label the proper part of this procedure.
'
BEGIN:
'
' Next we print the current path in the proper box on the file selector as
' well as a number of spaces (with the Space$() command) to remove any
' excess characters that may appear from time to time with different
' directories.
'
Locate 10,20 : Paper 0 : Print Dir$+Space$(20-Len(Dir$)) : Paper 1
'
' So now we need to start scanning the mouse until the user presses a
' button. We will use a 'Repeat/Until' loop for this, all the while
' loading the MZONE variable with the current mouse zone.
'
Repeat
MZONE=Mouse Zone
Until Mouse Key<>0
'
' Now we need to check which zone, if any, the user selected, and then
' jump to the program or procedure that we require. We can quickly check
' to see if the user has selected a function like 'Load' by checking the
' MZONE variable for a value greater than 8, because all the zones other
' than files are in zones less than 8. The FRESH variable holds a value
' which we can check to see if the selection requires a fresh directory.
'
If MZONE>8 and FRESH=0 Then Gosub INIT : Goto BEGIN
If MZONE>8 and FRESH=1 Then Gosub INIT2 : Goto BEGIN
'
' If the value in MZONE was not trapped above then we know that MZONE will
' hold a value less than 8, so we can use the next command to jump to the
' correct label relative to the value of MZONE
'
On MZONE Gosub A,B,C,D,G,F,E,H
'
' And if the user clicked the mouse on a null zone then we jump back to the
' BEGIN label to begin checking again.
'
Goto BEGIN
'
'
A:
'
' ## Scroll Directory Display Up ##
'
' Here we simply paste a highlighted bob while the mouse key is being
' pressed.
'
Paste Bob 254,56,49
While Mouse Key=1 : Wend
Paste Bob 254,56,43
If COUNT=1 Then Goto FINISHED
'
' Decrement the count variable which is used by the PDIR procedure as a
' start point at which to display the directory in the file selector
'
Dec COUNT : Proc PDIR
FINISHED:
Return
'
B:
'
' ## Scroll Directory Display Down ##
'
' Here we simply paste a highlighted bob while the mouse key is being
' pressed.
'
Paste Bob 254,137,50
While Mouse Key=1 : Wend
Paste Bob 254,137,44
'
' Check in here if there is anything in FAME$ to be displayed if we scroll
' the display.
'
If FAME$(COUNT+12)="" Then Goto FINISHED1
'
' And increment the COUNT variable ready for the ...
'
Inc COUNT
'
' PDIR procedure to display the scrolled listing
'
Proc PDIR
FINISHED1:
Return
'
C:
'
' We have left this blank for you to experiment with, it's not vital though
' as the user can still select a drawer by clicking on the 'Discs' button
'
Return
'
D:
'
' This is used to manually enter a filename for saves & stuff. It simply
' calls the LININPUT procedure with the number in brackets representing
' X position, Y position and input length. This procedure passes the result
' out in the variable FIN$...
'
Proc LININPUT[10,22,22]
'
' So we load our variable that holds filenames - FILENAME$ - with FIN$ - the
' result of the line input from the last line.
'
FILENAME$=FIN$
'
' And return.
'
Return
'
E:
'
' This is the 'Cancel' button subroutine. It simply pastes a highlighted
' bob while the mouse key is being pressed and then jumps to the FINALEND
' label to end this procedure.
'
Paste Bob 212,189,51
While Mouse Key=1 : Wend
Paste Bob 212,189,45
Goto FINALEND
Return
'
F:
'
' This subroutine is a little more complex because it has to handle three
' functions - Load/Save/Delete.
'
If TYPE=1 Then Paste Bob 149,189,52
If TYPE=2 Then Paste Bob 149,189,65
If TYPE=3 Then Paste Bob 149,189,66
While Mouse Key=1 : Wend
If TYPE=1 Then Paste Bob 149,189,46
If TYPE=2 Then Paste Bob 149,189,59
If TYPE=3 Then Paste Bob 149,189,60
'
' So here is the first function - Load. Simply it loads an Iff picture into
' screen 0 using the path of 'Dir$' and the filename in FILENAME$.
'
If TYPE=1
Screen 0 : Load Iff Dir$+FILENAME$
'
' Then we set up the main screen display again, menu bar,title bar and screen
' zones, in case the picture exceeds the drawing area dimensions
'
Proc SETUPSCREEN
' And end this procedure by jumping to the FINALEND label
'
Goto FINALEND
End If
'
' Now if the TYPE equals 2 (Save) we need to save the current screen, as
' before using 'Dir$' and our FILENAME$. The two 'Bar' commands simply
' clear out any out of date information from the file-selector. As before
' we set the screen up again and end this procedure by jumping to the
' FINALEND procedure.
'
If TYPE=2
Screen 0
Ink 0
Bar 0,0 To 317,9
Bar 292,10 To 316,263
Save Iff Dir$+FILENAME$
Proc SETUPSCREEN
Goto FINALEND :
End If
'
' Finally we check the TYPE variable to see if we need anything deleting.
' Using the 'Kill' command to delete the required file and the 'Space$()'
' to clear out the text boxes.
'
If TYPE=3
Kill Dir$+FILENAME$
For LINE=7 To 18
Locate 2,LINE
Paper 1 : Print Space$(29)
Next LINE
Locate 10,22 : Print Space$(22)
'
' Then we get the directory again and print it out to show the user that
' the task has been carried out successfully.
'
Proc GDIR
Proc PDIR
End If
Return
'
G:
'
' In here we cater for the need to rename any file.
'
Paste Bob 82,189,53
While Mouse Key=1 : Wend
Paste Bob 82,189,47
'
' You can't rename nothing, so the next line checks the current filename
' held in the FILENAME$ variable, and if nothing exists then we exit this
' subroutine (NOT this procedure) by jumping to the GEND label.
'
If FILENAME$="" Then Goto GEND
'
' Quickly draw the rename box. Try it !!!
'
Ink 1 : Bar 12,210 To 268,245
Ink 0 : Bar 22,230 To 266-8,241
Draw 12,226 To 267,226
'
' And display the name of the file to be renamed, limiting the display
' to a maximum of 18 characters with the 'Mid$' command so we dont run
' off the box !
'
Locate 3,27 : Paper 1 : Print "Rename '";Mid$(FILENAME$,1,18);"' as -"
'
' Then we call the line input procedure at 3,29 (X column/Y column) with
' an input length of29 characters.
'
Proc LININPUT[3,29,29]
'
' Then rename the file to the new name held in FIN$ - remember that FIN$
' holds the input we got from the LININPUT procedure.
'
Rename FILENAME$ To FIN$
'
' Remove the rename box from the screen now by drawing a black bar over the
' top of it. Crude but effective!
'
Ink 0 : Bar 12,210 To 268,245
'
' And now we clear out the old directory display by pasting a bar over that
' as well!
'
Ink 1 : Bar 16,55 To 247,150
'
' And clear out the filename box with 22 spaces
'
Locate 10,22 : Pen 0 : Paper 0 : Print Space$(22) : Paper 1 :
'
' Then we get a new directory and print it out
'
Proc GDIR
Proc PDIR
GEND:
Return
'
H:
'
' This subroutine does nothing except print device names(disk drives) on
' the file selectors display, no checks are made to see if the devices
' exist - perhaps you could check and only display the correct drives!
'
Paste Bob 18,189,54
While Mouse Key=1 : Wend
Paste Bob 18,189,48
'
' This next loop is only used to clear out any directory listing that may
' be displayed on the file selector by simply print spaces in the hole
'
For LINE=7 To 18
Locate 2,LINE
Print Space$(29)
Next LINE
Locate 2,7 : Pen 23 : Print "<DEV> DF0:"
Locate 2,8 : Print "<DEV> DF1:"
FRESH=0
Return
Goto 2222
'
'
' The next subroutine is called further up in this procedure when the user
' clicks on a directory listing to display that directory listing in the
' 'file' text box. It also does a check on the first character of the
' listing for an asterix (*) that denotes a sub-directory, and if it finds
' one it will get the new sub-directory or folder, by calling the PARDIR
' subroutine.
'
INIT2:
FILENAME$=Mid$(FAME$((MZONE-9)+COUNT),1,29)-" "
If Mid$(FILENAME$,1,1)="*" Then Gosub PARDIR : Return
Locate 10,22 : Paper 0 : Print FILENAME$+Space$(22-Len(FILENAME$))
Return
'
' Here the next subroutine actually gets the sub-directory listing and
' displays it on the screen. I wont waste your time by explaining what we
' have already gone over, because we have, and there's nothing at all hard
' here.
'
PARDIR:
L$=Mid$(FILENAME$,2,29)-" "
L$=L$+"/"
FILENAME$=L$
Dir$=FILENAME$
For LINE=7 To 18
Locate 2,LINE
Print Space$(29)
Next LINE
Proc GDIR
Proc PDIR
Return
'
' This next sub-routine is called when the file-selector is in a fresh state
' and only the devices are displayed. It checks which mouse zone was clicked
' and then sets the current directory to that drive. Then we get a new
' directory and print it on the file-selector.
'
INIT:
If MZONE=9 Then Dir$="df0:"
If MZONE=10 Then Dir$="df1:"
Proc GDIR
Proc PDIR
Return
'
'
FINALEND:
'
' We will need to close this screen when this procedure has finished to save
' memory, so we do it now.
'
Screen Close 3
'
' And then bring our drawing screen back to the front of the display.
'
Screen To Front 0
'
' And then end this procedure.
'
End Proc
'
' The next procedure is the one that does the printing of the selected
' directory on the screen.
'
Procedure PDIR
'
' First we load the contents of the COUNT variable into the COUNT1 variable
' because we don't want to change the contents of COUNT. If we did things
' would get very messy because COUNT holds the point in the array at which
' the current directory is displayed on the screen
'
COUNT1=COUNT
'
' And now we simply set a simple loop to count 11 positions. We use the
' values 7 to 18 so we can just take the position of the loop to print at
' the correct vertical position
'
For LINE=7 To 18
'
' When printing the contents of the array note that we are filtering only
' the first 29 characters with the 'Mid$' command so we dont print more than
' the width of the file selector.
'
Locate 2,LINE : Paper 1 : Print Mid$(FAME$(COUNT1),1,29)
'
' And then we increment the COUNT1 variable next, which is used to retrieve
' the correct listing in the array FAME$
'
Inc COUNT1
'
' Then end the loop
'
Next LINE
'
' And the whole procedure!
'
End Proc
'
' Next up is the procedure that places the palette selector on the screen
' Unfortunately, it is fairly long and uses a lot of numbers in places, and
' we do some poking about in memory. On the whole though, fairly simple
' and good for experience.
'
Procedure SELECTPALETTE
'
' First we need to set up a few variables
'
Shared FC,BC,REZ,NCOLS,XS,TPAL,TPAL()
Dim RGB(31)
CL1=0 : CL2=NCOLS : SC=Screen
'
' And then open a screen on which to display out palette selector
'
Screen Open 3,320,160,32,Lowres
Curs Off : Flash Off : Get Palette 0 : Cls 0
'
' Then set the drawing pointer to the new screen
'
Screen 3
Wait Vbl
'
' We will be needing some zones for the variuos buttons and colour areas
' so we reserve them zones now.
'
Reserve Zone 43
'
' Now we come to draw the actual palette selector on the screen with an
' assortment of bars and boxes, this also draws in the coloured bars that
' can be clicked on to select a colour to be changed. I won't document
' these lines because they are just mostly screen co-ordinate calculations
' and would be near impossible to understand. The best way is to just try
' them out in direct mode to see what goes where. I also thought it was a
' good idea to set up the zones around the colour boxes as they were being
' drawn so that we know exactly where the zones are going. You will also
' notice a couple of maths commands - 'Mod' and 'Min', don't be put off by
' them, they are just tame little babies! Let me explain here what they do
' so you don't have to go hunting through your AMOS User Guide, and as it
' happens, the 'Mod' function was not shown in my User Guide!
'
' 'mod' is a command or function that will give you the remainder of a
' division. e.g. A=7 mod 3 will place a value of 1 in the variable A.
' A=50 mod 4 will place a value of 2 into the variable A, nothing fancy
' but it can come in useful, if as in this procedure, you need to know the
' remainder of a calculation.
'
' 'Min' on the other hand is listed in the AMOS User Guide. This function
' places the smallest value of two expressions into a variable. The
' expressions can be strings or numbers, but we only number the numbers.
' e.g. A=Min(2,1) will place a value of 1 in the variable A, because 1 was
' the smallest value in our expression. A=Min(50,150) will place a value of
' 50 in the variable A. Simple! There is also an exact opposite of this
' command - 'Max'. Do please remember them as they can come in useful.
'
Ink 0,0
Bar 13,8 To 217,159
Ink FC,BC
Bar 8,3 To 212,159
Ink BC,FC
Box 9,4 To 211,158
Box 12,108 To 208,155
Ink BC,FC
A=0
Repeat
Bar 15+A*20,6 To 30+A*20,104
Set Zone A+1,15+A*20,6 To 30+A*20,104
Inc A
Until A=3
A=0
Repeat
Draw 10,6+A*6 To 75,6+A*6
Inc A
Until A=17
A=CL1
Repeat
Ink A,A : X=A mod 8 : Y=A/8
Bar X*16+80,Y*16+8 To X*16+95,Y*16+23
Set Zone A+4,X*16+80,Y*16+8 To X*16+95,Y*16+23
RGB(A)=Colour(A)
Inc A :
Until A>=Min(32,CL2)
Ink BC,FC
Box 79,7 To 96+16*X,24+16*Y
'
' It's here that we paste the bobs that represent our buttons.
'
Paste Bob 85,90,45
Paste Bob 151,90,55
Paste Bob 24,137,56
Paste Bob 84,137,57
Paste Bob 144,137,58
'
' And print a title above them
'
Locate 2,15 : Print "Preset Palette Selection"
'
' Then we set up some zones around our buttons.
'
Set Zone 36,80,90 To 140,100
Set Zone 37,152,90 To 202,100
Set Zone 41,24,137 To 74,149
Set Zone 42,84,137 To 134,149
Set Zone 43,144,137 To 184,149
Ink SELCOL
Bar 195,78 To 201,87
Ink BC : Box 194,77 To 202,88
RGB2[SELCOL]
'
' Now we start the main program loop, which will cycle until the variable
' OK does not equal 0.
'
OK=0
While OK=0
'
' Now we have another 'While/Wend' loop that will cycle until the user
' presses a key. Then the rest of the line loads the YM variable with the
' Y co-ordinate of the mouse, and Z with the mouse zone at the time of
' clicking
'
While Mouse Key=0 : Wend : YM=Y Screen(Y Mouse) : Z=Mouse Zone
'
' Now we come to check to Z variable in turn. First checking for a value
' of 41.
'
If Z=41
'
' Firstly we paste the highlighted bob for the rainbow button because we
' know the left mouse key has been pressed
'
Paste Bob 24,137,62
'
' Then we immediately start another loop that wait for the left mouse key
' to be released. When it is released we paste an un-highlighted bob over
' the last.
'
While Mouse Key=1 : Wend : Paste Bob 24,137,56
'
' Now this next command holds the key to this function - creating a rainbow
' palette. This is immensely easy, I simply loaded Photon Paint 2 (sorry EA)
' and wrote down the values for the range of colours I thought best
' represented a rainbow. Then, as this program is strictly 64 colours (EHB)
' I just put those numbers in the next line - 32 colours, becuase Extra Half
' bright only generates the other 32 from the first 32. Please note that the
' next line is considerably larger than the display and can be scrolled.
' This procedure halfs the size of the current brush by using the 'Zoom'
' command to make an image on a seperate screen, and then grabbing the
' brush again from the new co-ordinates. Variable descriptions are listed
' in the supplied variable table
'
Procedure BHALF
Screen Open 3,320,256,64,Lowres : Cls 0
Get Sprite Palette
Screen Open 4,320,256,64,Lowres : Cls 0
Get Sprite Palette
Screen 3 : Paste Bob BX,BY,80
Zoom 3,BX,BY,BX1,BY1 To 4,BX,BY,BX1/2+BX/2,BY1/2+BY/2
Get Bob 4,80,BX,BY To BX1/2+BX/2,BY1/2+BY/2
Screen Close 4
Screen Close 3
End Proc
'
' This procedure doubles the size of the current brush by using the 'Zoom'
' command to make an image on a seperate screen, and then grabbing the
' brush again from the new co-ordinates. Variable descriptions are listed
' in the supplied variable table
'
Procedure BDOUBLE
Screen Open 3,320,256,64,Lowres : Cls 0
Get Sprite Palette
Screen Open 4,320,256,64,Lowres : Cls 0
Get Sprite Palette
Screen 3 : Paste Bob 0,0,80
Zoom 3,0,0,BX1-BX,BY1-BY To 4,0,0,BX1*2-BX*2,BY1*2-BY*2
Get Bob 4,80,0,0 To BX1*2-BX*2,BY1*2-BY*2
Screen Close 4
Screen Close 3
End Proc
'
' This procedure doubles the size of the current brush horizontally by
' using the 'Zoom' command to make an image on a seperate screen, and then
' grabbing the brush again from the new co-ordinates. Variable descriptions
' are listed in the supplied variable table
'
Procedure BDOUBLEHORIZ
Screen Open 3,320,256,64,Lowres : Cls 0
Get Sprite Palette
Screen Open 4,320,256,64,Lowres : Cls 0
Get Sprite Palette
Screen 3 : Paste Bob 0,0,80
Zoom 3,0,0,BX1-BX,BY1-BY To 4,0,0,BX1*2-BX*2,BY1-BY
Get Bob 4,80,0,0 To BX1*2-BX*2,BY1-BY
Screen Close 4
Screen Close 3
End Proc
'
' This procedure doubles the size of the current brush vertically by
' using the 'Zoom' command to make an image on a seperate screen, and then
' grabbing the brush again from the new co-ordinates. Variable descriptions
' are listed in the supplied variable table
'
'
Procedure BDOUBLEVERT
Screen Open 3,320,256,64,Lowres : Cls 0
Get Sprite Palette
Screen Open 4,320,256,64,Lowres : Cls 0
Get Sprite Palette
Screen 3 : Paste Bob 0,0,80
Zoom 3,0,0,BX1-BX,BY1-BY To 4,0,0,BX1-BX,BY1*2-BY*2
Get Bob 4,80,0,0 To BX1-BX,BY1*2-BY*2
Screen Close 4
Screen Close 3
End Proc
'
' This next procedure allows us to input any information at any position on
' the screen and of any set length - the variables we pass into it as A,
' B and LEANTH
'
Procedure LININPUT[A,B,LEANTH]
'
' We start by setting the paper colour to 0 and locating the text cursor at
' the positions we passed into this procedure - A and B, and then printing
' LEANTH number of spaces at this position to clear any text that may have
' already been there.
'
Paper 0 : Locate A,B : Print Space$(LEANTH)
'
' Then wait half a second
'
Wait 25
'
' And clear the keyboard buffer. Reason ? Well, everytime you press a key
' on the keyboard, regardless of whether you are in this procedure or not,
' the key press gets put into a buffer ( a piece of memory ), and when we
' then read this buffer we get old information - which we don't want.
'
Clear Key
'
' When this procedure has finished it places the information the user input
' into the variable FIN$ so it can be read by the calling procedure. We
' also clear this variable for the same reasons by loading it with nothing
'
FIN$=""
'
' Now we relocate the text cursor to our location variables.
'
Locate A,B
'
' And set up our main loop to cycle until the required number of characters
' have been input.
'
For LOP=A To LEANTH+A
'
' We will also use the next label to jump back to in the event we do not
' need or want to increment the main loop,e.g if the delete key is pressed
'
LINE1:
'
' Now we read the keyboard input into the N$ variable. Inkey$ will only grab
' one key press at a time.
'
N$=Inkey$
'
' I have also taken any mouse key as a return press, so we can check that if
' a mouse key has been pressed then we need to end this loop by jumping to
' the LINE2 label
'
If Mouse Key<>0 Then Goto LINE2 :
'
' Whereas if the N$ variable is empty we know that no key has been pressed
' so we jump back to the LINE1 label until a key IS pressed !
'
If N$="" Then Goto LINE1 :
'
' So here we know a key has been pressed and we need to know if it is an
' important key like Delete/Back Space or Return. The next line gets an
' ASCII value of N$(the pressed key) and checks for a value of 8 which we
' know represents the delete key. If this test is true then we need to
' print a space over the previous charater on the display, and then delete it
' from the FIN$ variable that holds the complete input. We must also
' decrement the loop after checking that it is greater than the A variable
'
If Asc(N$)=8 and LOP>A Then LOP=LOP-1 : Locate LOP,B : Print " " : FIN$=Mid$(FIN$,1,Len(FIN$)-1) : Goto LINE1
'
' Again we check the ASCII value of N$ for a content of 13. If the test is
' true then we know the return key has been pressed to end the input, now we
' must jump to the LINE2 label
'
If Asc(N$)=13 Then Goto LINE2
'
' Next we can check if the loop (LOP) is less than LEANTH+A (LEANTH+A giving
' us the correct user specified input length) and if this test is true we can
' add the last keypress (N$) to our output variable (FIN$)
If LOP<LEANTH+A Then FIN$=FIN$+N$
'
' Now if the loop counter is equal the the maximum user specified input
' length then we will have to decrement the loop counter so as not to
' exceed the correct input length.
'
If LOP=LEANTH+A Then LOP=LOP-1
'
' Then we display the last keypress LOP columns in and B Rows down.
'
Locate LOP,B : Print N$
'
' We can also remember the last keypress by placing it into the LAST$
' variable.
'
LAST$=N$
'
' Then we can send the loop back again
'
Next LOP
'
LINE2:
'
' Before we end we must place the last inputted character onto the end of
' our output string as the main program will not have had time to do this
'
If LOP=LEANTH+A Then FIN$=FIN$+LAST$
'
' And then end this procedure.
'
End Proc
'
' Next is a three liner that simply returns the program to the next
' instruction after an error is generated
'
Procedure SWERROR
'
' The following command takes care of this for us.
'
Resume Next
'
End Proc
'
' And the next procedure does all the drawing of the main drawing screen,
' pasting the buttons, setting zones and drawing the title bar.
'
Procedure SETUPSCREEN
'
' First we reserve the zones that will be used by the buttons on the menu
' bar
'
Reserve Zone 25
'
' Then we draw the top title bar ...
'
Ink 1 : Bar 0,0 To 316,9
Ink 3 : Draw 0,0 To 0,9
Ink 3 : Draw 0,0 To 316,0
Ink 2 : Draw 0,9 To 316,9
Ink 2 : Draw 316,9 To 316,0
'
' And display the programs name
'
If PAGE=0 Then PAGE$="Default " Else PAGE$="Scribble"
Ink 0 : Text 7,7,"EasyPaint "+PAGE$
'
' Paste Menu Bobs and set up the respective zones
'
Paste Bob 292,11,1
Set Zone 1,292,11 To 318,35
W=2
For Y=36 To 140 Step 13
For X=292 To 305 Step 13
Set Zone W,X,Y To X+13,Y+13
Read Z
Paste Bob X,Y,Z
Inc W
Next X
Next Y
'
' I used a data statement here for order of bobs pasted
'
Data 2,3,6,7,4,5,16,9,10,11,18,8,12,13,72,17,14,15
IK=0
Set Zone 22,292,166 To 312,258
Ink 60 : Bar 291,165 To 316,260
Box 0,10 To 290,263 : Rem drawing area perimeter
'
' And here is a couple of loops (nested) that draw the coloured boxes on to
' the menu bar
'
For X=292 To 312 Step 6
For Y=166 To 258 Step 6
Ink IK
Inc IK
Bar X,Y To X+5,Y+5
Next Y
Next X
XB=-20 : YB=-20 : BO=2
Proc ZCOLBAR
'
' That's it folks
'
End Proc
'
' The final procedure !!!!! Hey, I know - It's been great, but let me just
' explain. This procedure checks the zones of each button on the menu bar
' and then calls the relevant procedure. If you read the variable table
' you'll find that there is no need for more than what I've put in the
' procedure. It is simply checking the contents of variables and changeing
' some accordingly.
'
Procedure CHECKZONES
'
' But first we cycle through a loop until the left mouse key is pressed
'
Repeat
'
' While checing in here if the crosshairs have been activated and then
' jumping to the crosshairs procedure if they have.
'
If CROSS=1 Then Proc CROSSHAIRS
Z=Mouse Zone
Until Mouse Key=1
'
11 If Z=2 Then PROG=2
22 If Z=3 and PROG=3 and F2TYPE=0 Then F2TYPE=1 : PROG=3 : Goto 55
If Z=3 and PROG=3 and F2TYPE=1 Then F2TYPE=0 : PROG=3 : Goto 55
If Z=3 and PROG<>3 Then F2TYPE=0 : PROG=3
If Z=4 Then PROG=4
If Z=5 Then PROG=5
77 If Z=6 and PROG=6 and F5TYPE=0 Then F5TYPE=1 : PROG=6 : Goto 88
If Z=6 and PROG=6 and F5TYPE=1 Then F5TYPE=0 : PROG=6 : Goto 88
If Z=6 and PROG<>6 Then F5TYPE=0 : PROG=6
88 If Z=7 and PROG=7 and F6TYPE=0 Then F6TYPE=1 : PROG=7 : Goto 99
If Z=7 and PROG=7 and F6TYPE=1 Then F6TYPE=0 : PROG=7 : Goto 99
If Z=7 and PROG<>7 Then F6TYPE=0 : PROG=7
99 If Z=8 and PROG=8 and F7TYPE=0 Then F7TYPE=1 : PROG=8 : Goto 55
If Z=8 and PROG=8 and F7TYPE=1 Then F7TYPE=0 : PROG=8 : Goto 55
If Z=8 and PROG<>8 Then F7TYPE=0 : PROG=8
55 If Z=9 and PROG=9 and F8TYPE=0 Then F8TYPE=1 : PROG=9 : Goto 66
If Z=9 and PROG=9 and F8TYPE=1 Then F8TYPE=0 : PROG=9 : Goto 66
If Z=9 and PROG<>9 Then F8TYPE=0 : PROG=9
66 If Z=12 Then PROG=12
If Z<>18 and Z<>0 Then Screen Copy 0,0,11,289,263 To 1,0,11
If Z=22 Then I=Point(X Screen(X Mouse),Y Screen(Y Mouse)) : Ink I
Wait 3
If Z<13 and PROG<>0 and Z<>10 and Z<>11 Then Z=PROG
If Z=0 and PROG=20 Then Z=PROG
Proc ZCOLBAR
On Z Proc CHECKZONES,FREHANDDOT,CONTINUOUSFREEHAND,STRAIGHTLINE,F4,FCIRCLE,FBOX,FELLIPSE,FPOLYGON,FCROSS,F10,FFILL,FBRUSHCUTTER,F13,F14,F15,F16,FUNDO,FCLS,AIRBRUSH
End Proc
'
'
'
Procedure FASTZOOM
MP=4 : Rem magnification power!
Dreg(1)=MP
Dreg(2)=WIDTH : Dreg(3)=HEIGHT
Dreg(4)=16 : Dreg(5)=32 : Rem these two hold the top left co-ords of the zoom too box
Dreg(6)=32 : Dreg(7)=32 : Rem these hold the size of the zoom too box, the values are double each single pixel