home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 401-425 / apd425 / sources / ampp.amos / ampp.amosSourceCode next >
AMOS Source Code  |  1991-09-09  |  52KB  |  1,896 lines

  1. '  This is the original AmPP V0.9. I release it again on this disk 
  2. '  so that you may see what a vast improvement AmPP2 is, if in nothing else
  3. '  but the coding!!!   
  4.  
  5.  
  6. '
  7. '     The (Am)os (P)ainting (P)ackage,   AmPP    by Mark Burbidge. 
  8. '                    Version 0.9 
  9. '
  10. '    This is my second Amos program, my first was AMOS-BROT, 
  11. '  which came packaged with the ConvFormat Utility also.   
  12. '  
  13. '  This pre-release was finished in under a week, on the 23rd August 1991
  14. '  It has all features enabled except text and magnify.
  15. '
  16. '  Actually, I never got around to releasing it as I got a job in
  17. '  September, went to University in October (Birmingham, Physics) and
  18. '  have only just come back. As a 'new user' to my own program (it's 
  19. '  a long time) I've ironed out some little foibles, and will release
  20. '  this version, all release notes the same inc. Version number. 
  21. '
  22. '  AmPP, as with my previous release AMOS-BROT and CONVFORMAT is freely
  23. '  distributable, as long as all Docs and Rem statements remain intact.  
  24. '  It can be updated as long as the original is included in your release.
  25. '  The `disk' in `diskware' means that if you use it then send me a disk   
  26. '  with some Public Domain on it. I'll send your disk back A.S.A.P. with 
  27. '  some other PD. NO OBLIGATION. NO PIRATES. Archive the disk where possible.  
  28. '  Please specify archiving program. 
  29. '
  30. '  My Address is 107 Heron Rd. Larkfield, Kent, ME 20 6JL. 
  31. '
  32. '               signed 
  33. '
  34. '                      Mark Burbidge.    
  35. '
  36. '
  37. '  
  38. '  UPDATERS ONLY - Always work on a backup of this source. 
  39. '
  40. '  The Panel icons and About screen are in permenant banks, ie they are  
  41. '  saved with the program. If you change the panel/about, LEAVE MY CREDIT, then
  42. '  change ABOT and PANEL to false initially,  take away the comma from the   
  43. '  reserve below, and also remove the comma for the CLEARMEM   
  44. '  Run the program, change it all back, as below, and then save it off.
  45. '  The Banks will be saved too. Panel.abk must be taken from a picture by
  46. '  the GET ICON command, to work without program modification. 
  47. '
  48. '  If you do need to do the above, if you change the ToolBox, then don't 
  49. '  forget to run ALL sections whose memory banks are to be saved with the  
  50. '  program, the the first version you should call the ABOUT procedure. 
  51. '  If you fail to do this, when you change the parameters back as described
  52. '  and usually a few sessions later, you will get an error when the procedure
  53. '  is run. In the case of ABOUT the error occurs on the line Unpack 10 to 2
  54. '
  55. Set Buffer 15
  56. Auto View Off 
  57. Default 
  58. Palette 0,0
  59. Auto View On 
  60. 'CLEARMEM
  61. 'Reserve As Data 10,7060 
  62. Reserve As Work 9,15000 : Rem **** This mustn't be REM 
  63. Rem ****** Global Variables *******
  64. Flash Off 
  65. Global WIDTH,HEIGHT,CLR,CURCOL,PALFOR,PALBAK,INITFOR,INITBAK,REQON,MSTORE
  66. Global CLGO,OPEN,CLPAL,TTOOLS,PANEL,CURROP,FIN,PAL,NOW,FXIT,WONCE,BUT,ABOT
  67. Global VDIV,HDIV,BON,DPT,IT,INBOB,ST_AMAL,AMLON,FX,CLRSB
  68. WIDTH=320 : HEIGHT=256 : CLR=16 : MSTORE=2 : NOW=False : OPEN=False
  69. CURCOL=2 : ABOT=True : PANEL=True : FIN=False : CURROP=1 : CLPAL=True
  70. CLGO=False : BON=True : DPT=5 : IT=20 : INBOB=False : AMLON=False
  71. ST_AMAL=False : OLOP=1 : FX=False : CLRSB=Colour(0)
  72. INITFOR=0 : INITBAK=2 : Rem ** Done this way so DEFPAL returns to original** 
  73. PALFOR=INITFOR : PALBAK=INITBAK : REQON=True : TTOOLS=True : WONCE=True
  74. '
  75. '
  76. Rem ***** Program Start *****
  77. REQON=False
  78. SCRMODE
  79. Limit Mouse 
  80. REQON=True
  81. DEFMENU
  82. TTOOLBOX
  83. Change Mouse MSTORE
  84. Rem ****** I realise much of this should be in a procedure, so what? *** 
  85. Repeat 
  86.    If NOW
  87.       If Not CLPAL
  88.          Reserve Zone 17
  89.       End If 
  90.    End If 
  91.    OK=False
  92.    If CLPAL
  93.       If CLGO
  94.          OK=True
  95.          CLGO=False
  96.          If TTOOLS
  97.             NOW=True
  98.          End If 
  99.          Reserve Zone 17+CLR
  100.       End If 
  101.    End If 
  102.    If NOW : Rem ****** Set up Panel icons ****** 
  103.       Menu Off 
  104.       NOW=False
  105.       TP=229
  106.       If WIDTH>320
  107.          SCL=2
  108.       Else 
  109.          SCL=1
  110.       End If 
  111.       If Not PAL
  112.          TP=TP-64
  113.       End If 
  114.       For T=1 To 6
  115.          Set Zone T,SCL*(223+(T-1)*16),TP To SCL*(222+T*16),TP+15
  116.          Set Zone T+6,SCL*(223+(T-1)*16),TP+16 To SCL*(222+T*16),TP+31
  117.       Next T
  118.       Set Zone 13,1,TP+2 To SCL*10,TP+10
  119.       Set Zone 14,125*SCL,TP To 180*SCL,HEIGHT
  120.       Set Zone 15,1,TP+20 To SCL*10,HEIGHT-2
  121.       Set Zone 16,179,TP+20 To SCL*187,HEIGHT-2
  122.       Set Zone 17,188,TP+20 To SCL*196,HEIGHT-2
  123.       Menu On 
  124.    End If 
  125.    If OK
  126.       Menu Off 
  127.       For I=0 To CLR-1
  128.          XP=1+(I mod VDIV)*(80/VDIV)
  129.          YP=1+(I/VDIV)*(80/HDIV)
  130.          Ink I
  131.          XP2=XP+(80/VDIV)-2
  132.          YP2=YP+(80/HDIV)-2
  133.          Set Zone I+18,XP,YP To XP2,YP2
  134.       Next I
  135.       Menu On 
  136.    End If 
  137.    Rem ********* end of the `procedure' stuff ***** 
  138.    Rem ********* Now for the stuff which should be here ***** 
  139.    Rem ********* The above isn't executed every loop ****** 
  140.    Rem ********* only when the panel or colour box is turned on ******  
  141.    BUT=Mouse Key
  142.    BUTTON=False
  143.    If BUT=1
  144.       BUTTON=True
  145.    Else 
  146.       If BUT>2
  147.          BUTTON=True : Rem Done like this to allow for 3rd button 
  148.       End If : Rem If available. Instead of right and left.(line & filled)  
  149.    End If 
  150.    If BUTTON : Rem  **** If Mouse used used then go to Panel testing**  
  151.       Z=Mouse Zone : Rem *** and drawing control procedure ***
  152.       TESTALL[Z]
  153.    End If 
  154.    FXIT=Choice : Rem Here's that fix again, to make more than one menu work 
  155.    If FXIT
  156.       ACTION
  157.    End If 
  158.    Screen 0
  159.    If INBOB
  160.       If AMLON or Not(OLOP=CURROP)
  161.          If Not(CURROP=11)
  162.             Bob Update Off : Bob Clear : AMLON=False : ST_AMAL=True
  163.          Else 
  164.             If CURROP=11
  165.                If ST_AMAL
  166.                   If FX
  167.                      Bob Draw : Bob Update On 
  168.                   Else 
  169.                      Bob 1,X Screen(X Mouse),Y Screen(Y Mouse),1
  170.                      Channel 1 To Bob 1
  171.                      G$="AU (I R0<>XS(0,XM) J U I R1<>YS(0,YM) J U X U:"
  172.                      G$=G$+"L R0=XS(0,XM);"
  173.                      G$=G$+"L R1=YS(0,YM); D M) M: M R0-X,R1-Y,1 W;"
  174.                      Amal 1,G$ : Amal On : FX=True
  175.                   End If 
  176.                   AMLON=True
  177.                   ST_AMAL=False
  178.                End If 
  179.             End If 
  180.          End If 
  181.       End If 
  182.    End If 
  183.    OLOP=CURROP
  184. Until FIN
  185. If PANEL
  186.    Reserve Zone 
  187. End If 
  188. If INBOB
  189.    Erase 1
  190. End If 
  191. Erase 9
  192. '
  193. '
  194. '
  195. '
  196. '
  197. '
  198. '
  199. Edit 
  200. Rem **** Procedures **** 
  201. Procedure CLPALETTE
  202.    '
  203.    ' This procedure draws that colourbox, you know that one that you can
  204.    ' In the top left. It also wipes it again, depending on CLPAL. OPEN is 
  205.    ' Global. Initilaised to false at the start. Not accessed elsewhere. 
  206.    '
  207.    Screen 0
  208.    If AMLON
  209.       Bob Update Off 
  210.       Bob Clear 
  211.    End If 
  212.    If CLPAL
  213.       ' Draw the colourbox 
  214.       If Not OPEN
  215.          OPEN=True
  216.          Get Cblock 1,0,0,96,81
  217.          Curs Off 
  218.          Flash Off 
  219.       End If 
  220.       ' Flag to indicate DO COLOURBOX ZONES
  221.       CLGO=True
  222.       Ink PALBAK
  223.       Box 0,0 To 80,80
  224.       Box 80,0 To 88,80
  225.       Ink CURCOL
  226.       Bar 81,1 To 87,79
  227.       Ink PALBAK
  228.       ' I know the next bit is used more than once and should be in a proc 
  229.       ' if it bothers you, you do it, I don't care!
  230.       If CLR=2
  231.          HLINE=2
  232.          VLINE=3
  233.       Else 
  234.          If CLR<16
  235.             HLINE=3
  236.             If CLR=4
  237.                VLINE=3
  238.             Else 
  239.                VLINE=5
  240.             End If 
  241.          Else 
  242.             HLINE=5
  243.             If CLR=16
  244.                VLINE=5
  245.             Else 
  246.                If CLR=32
  247.                   VLINE=9
  248.                Else 
  249.                   VLINE=17
  250.                End If 
  251.             End If 
  252.          End If 
  253.       End If 
  254.       HDIV=HLINE-1
  255.       VDIV=VLINE-1
  256.       For I=0 To HDIV
  257.          Draw 0,I*(80/HDIV) To 80,I*(80/HDIV)
  258.       Next I
  259.       For I=0 To VDIV
  260.          Draw I*(80/VDIV),0 To I*(80/VDIV),80
  261.       Next I
  262.       For I=0 To CLR-1
  263.          XP=1+(I mod VDIV)*(80/VDIV)
  264.          YP=1+(I/VDIV)*(80/HDIV)
  265.          Ink I
  266.          XP2=XP+(80/VDIV)-2
  267.          YP2=YP+(80/HDIV)-2
  268.          Bar XP,YP To XP2,YP2
  269.       Next I
  270.    Else 
  271.       ' Wipe the colourbox 
  272.       CLGO=False
  273.       If OPEN
  274.          Put Cblock 1
  275.          Del Cblock 1
  276.          OPEN=False
  277.       End If 
  278.    End If 
  279.    If AMLON
  280.       Bob Draw 
  281.       Bob Update On 
  282.    End If 
  283. End Proc
  284. Procedure CLPAN
  285.    '
  286.    ' Get rid of the Tollbox. Once is a safeguard, to stop the Screenclose 
  287.    ' being called twice. Did it several times in developement. Shouldn't
  288.    ' happen now though, but I've left it to save upgraders some grief.
  289.    ' Upgraders say thank you!!  Oh by the way. If you Upgrade this program you
  290.    ' MUST DISTRIBUTE the original source unaltered, ie this program, and the
  291.    ' accompanying Docs with your release. 
  292.    '
  293.    If PANEL and Not TTOOLS
  294.       If Not WONCE : Rem *** safeguard against calling twice, causing error *** 
  295.          WONCE=True : Rem ** Pronounced Once *** 
  296.          Screen 0
  297.          Reserve Zone 
  298.          NOW=False
  299.          Screen Close 2
  300.       End If 
  301.    End If 
  302. End Proc
  303. Procedure TTOOLBOX
  304.    '
  305.    ' Display or get rid of that toolbox 
  306.    ' The Exist bit is used when the bank hasn't been saved with the prog. 
  307.    ' PANEL must be initialised to false if this is the case. See the first  
  308.    ' lot of REM statements
  309.    '
  310.    If PANEL or Exist("sources:graphics/panel.abk")
  311.       If TTOOLS
  312.          NOW=True
  313.          WONCE=False
  314.          Screen Open 2,320,30,16,Lowres
  315.          Screen 2
  316.          HERE=270
  317.          If Not PAL
  318.             HERE=HERE-56
  319.          End If 
  320.          Screen Display 2,,HERE,,
  321.          Curs Off 
  322.          Flash Off 
  323.          If Not PANEL
  324.             Load "sources:graphics/panel.abk",2
  325.             PANEL=True
  326.          End If 
  327.          Get Icon Palette 
  328.          Paste Icon 0,0,1
  329.          Colour 0,CLRSB
  330.          CLPALETTE
  331.          TESTALL[CURROP]
  332.       Else 
  333.          CLPALETTE
  334.          NOW=False
  335.          CLPAN
  336.       End If 
  337.    Else 
  338.       TTOOLS=False
  339.       REQ["File Missing","Graphics","Panel.abk"]
  340.    End If 
  341.    DEFMENU
  342. End Proc
  343. Procedure SHICON
  344.    '
  345.    ' This proc displays the selected icon over the top of the Toolbox 
  346.    ' Called only from Testall 
  347.    '
  348.    Paste Icon 203,15,2
  349.    Screen 0
  350. End Proc
  351. Procedure TESTALL[GAD]
  352.    '
  353.    ' This tests the gadgets and calls procedures for the Toolbox. 
  354.    ' It's the Toolbox equivalent of ACTION
  355.    '
  356.    Menu Off 
  357.    Clear Key 
  358.    If Not CLPAL
  359.       If GAD>17
  360.          GAD=0
  361.       End If 
  362.    End If 
  363.    GADGET=GAD>0
  364.    GADGET=GAD<13 and GADGET
  365.    If GADGET
  366.       If TTOOLS
  367.          GADG=True
  368.          CURROP=GAD
  369.          If BON
  370.             Bell 
  371.          End If 
  372.          Screen 2
  373.          Ink 3
  374.          Get Icon 2,2,223+((GAD-1) mod 6)*16,((GAD-1)/6)*16 To 223+(((GAD-1) mod 6)+1)*16,14+((GAD-1)/6)*16
  375.          SHICON
  376.       End If 
  377.    Else 
  378.       If GAD=13
  379.          TTOOLS= Not TTOOLS
  380.          If TTOOLS
  381.             Menu$(1,8)="Toolbox off   <help>"
  382.          Else 
  383.             Menu$(1,8)="Toolbox on    <help>"
  384.          End If 
  385.          TTOOLBOX
  386.       Else 
  387.          If GAD=14
  388.             ABOUT
  389.          Else 
  390.             If GAD=15
  391.                CLPAL= Not CLPAL
  392.                CLPALETTE
  393.                If CLPAL
  394.                   Menu$(1,9)="Colourbox Off   C   "
  395.                Else 
  396.                   Menu$(1,9)="Colourbox On    C   "
  397.                End If 
  398.             Else 
  399.                If GAD=16
  400.                   CLPAL=False
  401.                   TTOOLS=False
  402.                   TTOOLBOX
  403.                   SCRMODE
  404.                   CLPAL=True
  405.                   TTOOLS=True
  406.                   TTOOLBOX
  407.                Else 
  408.                   If GAD=17
  409.                      PAL
  410.                      OPEN=False
  411.                      TTOOLBOX
  412.                   Else 
  413.                      If GAD=0
  414.                         Screen 0
  415.                         If(CURROP=1) or(CURROP=7)
  416.                            SKETCH[CURROP]
  417.                         End If 
  418.                         If CURROP=2
  419.                            BBOX
  420.                         End If 
  421.                         If CURROP=3
  422.                            EELLIPSE
  423.                         End If 
  424.                         If CURROP=4
  425.                            SPRAY
  426.                         End If 
  427.                         If CURROP=5
  428.                            CUT
  429.                         End If 
  430.                         If CURROP=8
  431.                            CCIRCLE
  432.                         End If 
  433.                         If CURROP=9
  434.                            FFILL
  435.                         End If 
  436.                         If CURROP=10
  437.                            LINE
  438.                         End If 
  439.                         If CURROP=11
  440.                            PPASTE
  441.                         End If 
  442.                         If CURROP=5
  443.                            CURROP=11
  444.                            TTOOLBOX
  445.                         End If 
  446.                      Else 
  447.                         If CLPAL
  448.                            CURCOL=GAD-18
  449.                            If OPEN
  450.                               Ink CURCOL
  451.                               Screen 0
  452.                               Bar 81,1 To 87,79
  453.                            End If 
  454.                         End If 
  455.                      End If 
  456.                   End If 
  457.                End If 
  458.             End If 
  459.          End If 
  460.       End If 
  461.    End If 
  462.    Repeat : Rem **** Program moves faster than fingers.
  463.    Until Mouse Key=0 : Rem *** Allow fingers to catch up. 
  464.    CLPALETTE
  465.    Menu On 
  466. End Proc
  467. Procedure DEFMENU
  468.    '
  469.    ' Defines the menu 
  470.    '
  471.    Screen 0
  472.    Menu$(1)="General  "
  473.    Menu$(1,1)="Clear Screen  <esc> "
  474.    Menu Key(1,1) To 69
  475.    Menu$(1,2)="--------------------"
  476.    Menu Inactive(1,2)
  477.    Menu$(1,3)="Load Picture    L   "
  478.    Menu Key(1,3) To 40
  479.    Menu$(1,4)="Save Picture    S   "
  480.    Menu Key(1,4) To 33
  481.    Menu$(1,5)="--------------------"
  482.    Menu Inactive(1,5)
  483.    Menu$(1,6)="Screen Mode     M   "
  484.    Menu Key(1,6) To 55
  485.    Menu$(1,7)="Palette         P   "
  486.    Menu Key(1,7) To 25
  487.    If TTOOLS
  488.       Menu$(1,8)="Toolbox off   <help>"
  489.    Else 
  490.       Menu$(1,8)="Toolbox on    <help>"
  491.    End If 
  492.    Menu Key(1,8) To 95
  493.    If CLPAL
  494.       Menu$(1,9)="Colourbox Off   C   "
  495.    Else 
  496.       Menu$(1,9)="Colourbox On    C   "
  497.    End If 
  498.    Menu Key(1,9) To 51
  499.    Menu$(1,10)="About           A   "
  500.    Menu Key(1,10) To 32
  501.    If BON
  502.       Menu$(1,11)="Bell off        B   "
  503.    Else 
  504.       Menu$(1,11)="Bell on         B   "
  505.    End If 
  506.    Menu Key(1,11) To 53
  507.    Menu$(1,12)="-------------------"
  508.    Menu Inactive(1,12)
  509.    Menu$(1,13)="Quit            Q   "
  510.    Menu Key(1,13) To 16
  511.    Menu$(2)="Panel  "
  512.    Menu$(2,1)="  Sketch  "
  513.    Menu$(2,2)="  Draw    "
  514.    Menu$(2,3)="  Box     "
  515.    Menu$(2,4)="  Circle  "
  516.    Menu$(2,5)="  Ellipse "
  517.    Menu$(2,6)="  Fill    "
  518.    Menu$(2,7)="  Spray   "
  519.    Menu$(2,8)="  Line    "
  520.    Menu$(2,9)="  Cut     "
  521.    Menu$(2,10)="  Paste   "
  522.    Menu$(2,11)="  Zoom    "
  523.    Menu$(2,12)="  Text    "
  524.    Menu$(2,13)="----------------"
  525.    Menu Inactive(2,13)
  526.    Menu$(2,14)="  Arrow   "
  527.    Menu$(2,15)="  Cross   "
  528.    Menu$(2,16)="----------------"
  529.    Menu Inactive(2,16)
  530.    Menu$(2,17)="Spray Size  "+Str$(IT)
  531.    Menu$(2,18)="   Density  "+Str$(DPT)
  532.    Menu On 
  533.    On Menu Proc ACTION
  534.    On Menu On 
  535. End Proc
  536. Procedure CLEARMEM
  537.    '
  538.    ' Clears all memory banks. 
  539.    ' IMPORTANT - Only call when you wish to use a new Toolbox panel 
  540.    ' as described in the initial REM statements. I should have included 
  541.    ' The original Panel file under the name Panel.bak if you need to renew
  542.    ' it.
  543.    '
  544.    For I=1 To 15
  545.       If Length(I)>0
  546.          Erase I
  547.       End If 
  548.    Next I
  549. End Proc
  550. Procedure CHNGVARY[MX]
  551.    Menu Off 
  552.    C1=Colour(1)
  553.    C2=Colour(2)
  554.    Colour 1,$0
  555.    Colour 2,$FFF
  556.    Get Block 1,0,0,WIDTH,16
  557.    Set Slider 1,2,1,1,1,2,1,2
  558.    OLD=-10
  559.    Repeat 
  560.       If Not(OLD=VARY)
  561.          Wait Vbl 
  562.          Hslider 0,0 To WIDTH-100.0,15,50,VARY,1
  563.       End If 
  564.       OLD=VARY
  565.       VARY=50*(((X Screen(X Mouse))/(WIDTH-100.0)))
  566.       If VARY<1
  567.          VARY=1
  568.       End If 
  569.       If VARY>MX
  570.          VARY=MX
  571.       End If 
  572.       Locate X Text(WIDTH-90.0),1
  573.       Print VARY; : Print "  "
  574.    Until Mouse Key>0
  575.    Set Pattern 0
  576.    Put Block 1
  577.    Del Block 1
  578.    Colour 1,C1
  579.    Colour 2,C2
  580.    Menu On 
  581. End Proc[VARY]
  582. Procedure SKETCH[TYPE]
  583.    '
  584.    ' Sketches 
  585.    '
  586.    TMPL=CLPAL
  587.    If TMPL
  588.       CLPAL=False
  589.       CLPALETTE
  590.    End If 
  591.    Ink CURCOL
  592.    X1=X Screen(X Mouse)
  593.    Y1=Y Screen(Y Mouse)
  594.    Repeat 
  595.       Wait Vbl 
  596.       X2=X Mouse : Y2=Y Mouse
  597.       X2=X Screen(X2) : Y2=Y Screen(Y2)
  598.       If TYPE=1
  599.          Plot X2,Y2
  600.       Else 
  601.          Draw X1,Y1 To X2,Y2
  602.          X1=X2
  603.          Y1=Y2
  604.       End If 
  605.    Until Mouse Key=0
  606.    If TMPL
  607.       CLPAL=True
  608.       CLPALETTE
  609.    End If 
  610. End Proc
  611. Procedure BBOX
  612.    '
  613.    ' Does boxes. If you just use the left button they are hollow
  614.    ' but if while drawing your hollow box you press the right button
  615.    ' and then release the left followed by the right you get a solid box. 
  616.    ' You SHOULD also get a solid box if you use the third mouse button
  617.    ' I haven't been able to test this, I don't have three buttons 
  618.    '
  619.    TMPL=CLPAL
  620.    If TMPL
  621.       CLPAL=False
  622.       CLPALETTE
  623.    End If 
  624.    Gr Writing 2
  625.    XB1=X Screen(X Mouse)
  626.    YB1=Y Screen(Y Mouse)
  627.    XB2=X Screen(X Mouse)
  628.    YB2=Y Screen(Y Mouse)
  629.    C=Colour(2)
  630.    Colour 2,$FFF
  631.    Ink 2
  632.    Box XB1,YB1 To XB2,YB2
  633.    Repeat 
  634.       OLDX2=XB2
  635.       OLDY2=YB2
  636.       XB2=X Screen(X Mouse)
  637.       YB2=Y Screen(Y Mouse)
  638.       Box XB1,YB1 To OLDX2,OLDY2
  639.       Box XB1,YB1 To XB2,YB2
  640.       B=Mouse Key
  641.       If Not(B=0)
  642.          BUT=B
  643.       End If 
  644.    Until B=0
  645.    Box XB1,YB1 To XB2,YB2
  646.    Gr Writing 1
  647.    Colour 2,C
  648.    Ink CURCOL
  649.    If XB1>XB2
  650.       Swap XB1,XB2
  651.    End If 
  652.    If YB1>YB2
  653.       Swap YB1,YB2
  654.    End If 
  655.    If BUT=1
  656.       Box XB1,YB1 To XB2,YB2
  657.    Else 
  658.       Bar XB1,YB1 To XB2,YB2
  659.    End If 
  660.    If TMPL
  661.       CLPAL=True
  662.       CLPALETTE
  663.    End If 
  664. End Proc
  665. Procedure CCIRCLE
  666.    '
  667.    ' Draws Circles
  668.    '
  669.    TMPL=CLPAL
  670.    If TMPL
  671.       CLPAL=False
  672.       CLPALETTE
  673.    End If 
  674.    Gr Writing 2
  675.    XB1=X Screen(X Mouse)
  676.    YB1=Y Screen(Y Mouse)
  677.    XB2=X Screen(X Mouse)
  678.    YB2=Y Screen(Y Mouse)
  679.    C=Colour(2)
  680.    Colour 2,$FFF
  681.    Ink 2
  682.    DIF2=(YB2-YB1)*(YB2-YB1)+(XB2-XB1)*(XB2-XB1)
  683.    DIF=Sqr(DIF2)
  684.    If DIF=0
  685.       DIF=1
  686.    End If 
  687.    Repeat 
  688.       OLDDIF=DIF
  689.       XB2=X Screen(X Mouse)
  690.       YB2=Y Screen(Y Mouse)
  691.       DIF=(YB2-YB1)*(YB2-YB1)+(XB2-XB1)*(XB2-XB1)
  692.       DIF=Sqr(DIF)
  693.       If DIF=0
  694.          DIF=1
  695.       End If 
  696.       If OLDDIF=DIF
  697.          Circle XB1,YB1,OLDDIF
  698.          Circle XB1,YB1,DIF
  699.       End If 
  700.       B=Mouse Key
  701.       If Not(B=0)
  702.          BUT=B
  703.       End If 
  704.    Until B=0
  705.    Gr Writing 1
  706.    Colour 2,C
  707.    Ink CURCOL
  708.    If DIF=0
  709.       Plot XB1,XB2
  710.    Else 
  711.       Circle XB1,YB1,DIF
  712.    End If 
  713.    If TMPL
  714.       CLPAL=True
  715.       CLPALETTE
  716.    End If 
  717. End Proc
  718. Procedure EELLIPSE
  719.    '
  720.    ' Draws Ellipses 
  721.    '
  722.    TMPL=CLPAL
  723.    If TMPL
  724.       CLPAL=False
  725.       CLPALETTE
  726.    End If 
  727.    BUT=Mouse Click : Rem ***** Clear Bits ***** 
  728.    Gr Writing 2
  729.    XB1=X Screen(X Mouse)
  730.    YB1=Y Screen(Y Mouse)
  731.    XB2=X Screen(X Mouse)
  732.    YB2=Y Screen(Y Mouse)
  733.    R1=Sqr((XB2-XB1)*(XB2-XB1))
  734.    R2=Sqr((YB2-YB1)*(YB2-YB1))
  735.    C=Colour(2)
  736.    Colour 2,$FFF
  737.    Ink 2
  738.    If R1=0
  739.       R1=1
  740.    End If 
  741.    If R2=0
  742.       R2=1
  743.    End If 
  744.    Ellipse XB1,YB1,R1,R2
  745.    Repeat 
  746.       OLDR1=R1
  747.       OLDR2=R2
  748.       XB2=X Screen(X Mouse)
  749.       YB2=Y Screen(Y Mouse)
  750.       R1=Sqr((XB2-XB1)*(XB2-XB1))
  751.       R2=Sqr((YB2-YB1)*(YB2-YB1))
  752.       If R1=0
  753.          R1=1
  754.       End If 
  755.       If R2=0
  756.          R2=1
  757.       End If 
  758.       If(R1=OLDR1) and(R2=OLDR2)
  759.       Else 
  760.          Ellipse XB1,YB1,OLDR1,OLDR2
  761.          Ellipse XB1,YB1,R1,R2
  762.       End If 
  763.       B=Mouse Key
  764.       If Not(B=0)
  765.          BUT=B
  766.       End If 
  767.    Until B=0
  768.    Gr Writing 1
  769.    Colour 2,C
  770.    Ink CURCOL
  771.    Ellipse XB1,YB1,R1,R2
  772.    If TMPL
  773.       CLPAL=True
  774.       CLPALETTE
  775.    End If 
  776. End Proc
  777. Procedure FFILL
  778.    '
  779.    ' Fills areas
  780.    '
  781.    TMPL=CLPAL
  782.    If TMPL
  783.       CLPAL=False
  784.       CLPALETTE
  785.    End If 
  786.    A=X Mouse : B=Y Mouse
  787.    A=X Screen(A) : B=Y Screen(B)
  788.    Ink CURCOL
  789.    Paint A,B,1
  790.    If TMPL
  791.       CLPAL=True
  792.       CLPALETTE
  793.    End If 
  794. End Proc
  795. Procedure SPRAY
  796.    '
  797.    ' Spraycan. IT and DPT are globals controlling the density and size of the   
  798.    ' spray. I may add a facility to alter these. If you use the right 
  799.    ' button (or the third if available - untested) then you get a star  
  800.    ' star spray. If I work out how to read the colour of a single pixel 
  801.    ' onscreen then I'll change the star spray into a mix. 
  802.    '
  803.    TMPL=CLPAL
  804.    If TMPL
  805.       CLPAL=False
  806.       CLPALETTE
  807.    End If 
  808.    Repeat 
  809.       Wait Vbl : X1=X Mouse : Y1=Y Mouse
  810.       X1=X Screen(X1) : Y1=Y Screen(Y1) : BU=Mouse Key
  811.       If BU>0
  812.          For I=1 To DPT
  813.             Ink CURCOL
  814.             A=Rnd(IT) : B=Rnd(360) : B#=B*Pi# : B#=B#/180
  815.             If BU=1
  816.                Plot X1+A*Cos(B#),Y1+A*Sin(B#)
  817.             Else 
  818.                CL1=Point(X1-A*Cos(B#),Y1-A*Sin(B#)) : CL2=Point(X1+A*Cos(B#),Y1+A*Sin(B#))
  819.                If(CL1*CL2)>0.0
  820.                   Plot X1+A*Cos(B#),Y1+A*Sin(B#),CL1
  821.                   Plot X1-A*Cos(B#),Y1-A*Sin(B#),CL2
  822.                End If 
  823.                'Draw X1,Y1 To X1+A*Cos(B#),Y1+A*Sin(B#) 
  824.             End If 
  825.          Next I
  826.       End If 
  827.    Until BU=0
  828.    If TMPL
  829.       CLPAL=True
  830.       CLPALETTE
  831.    End If 
  832. End Proc
  833. Procedure LINE
  834.    '
  835.    ' Draws Straight lines 
  836.    ' If you tap the right button whilst preparing your line, (or use your 
  837.    ' third button from the off- again untested) you get a fan effect. 
  838.    ' This is active when the left button is pressed, inactive when it isn't 
  839.    ' Because FAN is an extended operation and it is very easy to draw on  
  840.    ' the colourbox using this operation only to find the screen unaffected  
  841.    ' The colourbox can be switched on and off in FAN mode using the C key.
  842.    ' Colours can be changed by clicking on the appropriate colour in the
  843.    ' Colourbox with THE RIGHT MOUSEBUTTON. This is a major anomaly with 
  844.    ' the rest of AmPP, but isn't too much hassle. 
  845.    '
  846.    TEMP=CLPAL
  847.    Gr Writing 2
  848.    XB1=X Screen(X Mouse)
  849.    YB1=Y Screen(Y Mouse)
  850.    XB2=X Screen(X Mouse)
  851.    YB2=Y Screen(Y Mouse)
  852.    C=Colour(2)
  853.    Colour 2,$FFF
  854.    Ink 2
  855.    Draw XB1,YB1 To XB2,YB2
  856.    Repeat 
  857.       OLDX2=XB2
  858.       OLDY2=YB2
  859.       XB2=X Screen(X Mouse)
  860.       YB2=Y Screen(Y Mouse)
  861.       Draw XB1,YB1 To OLDX2,OLDY2
  862.       Draw XB1,YB1 To XB2,YB2
  863.       B=Mouse Key
  864.       If B>1
  865.          Draw XB1,YB1 To XB2,YB2
  866.          Repeat 
  867.          Until Mouse Key<2
  868.          TEST=False
  869.          Repeat 
  870.             OLDX2=XB2
  871.             OLDY2=YB2
  872.             XB2=X Mouse : YB2=Y Mouse
  873.             XB2=X Screen(XB2) : YB2=Y Screen(YB2)
  874.             B=Mouse Key
  875.             If B=1
  876.                If PALON
  877.                   CLPAL=False
  878.                   CLPALETTE
  879.                   PALON=CLPAL
  880.                End If 
  881.             Else 
  882.                If Not PALON
  883.                   CLPAL=TEMP
  884.                   If CLPAL
  885.                      CLPALETTE
  886.                      PALON=CLPAL
  887.                   End If 
  888.                End If 
  889.             End If 
  890.             If Upper$(Inkey$)="C"
  891.                CLPAL= Not CLPAL
  892.                TEMP=CLPAL
  893.                CLPALETTE
  894.             End If 
  895.             If B>1
  896.                Z=Mouse Zone
  897.                FINI=(Z=0)
  898.                If Not FINI
  899.                   If Z>17
  900.                      If OPEN
  901.                         CURCOL=Z-18
  902.                         Screen 0
  903.                         Ink CURCOL
  904.                         Bar 81,1 To 87,79
  905.                      End If 
  906.                   End If 
  907.                End If 
  908.             End If 
  909.             If B=0
  910.                Gr Writing 2
  911.                If TEST
  912.                   Draw XB1,YB1 To OLDX2,OLDY2
  913.                End If 
  914.                Draw XB1,YB1 To XB2,YB2
  915.                TEST=True
  916.                Gr Writing 1
  917.             Else 
  918.                If TEST
  919.                   Gr Writing 2
  920.                   Draw XB1,YB1 To OLDX2,OLDY2
  921.                End If 
  922.                TEST=False
  923.                Gr Writing 1
  924.                Ink CURCOL
  925.                If Z<18
  926.                   Draw XB1,YB1 To XB2,YB2
  927.                Else 
  928.                   Z=0
  929.                End If 
  930.             End If 
  931.          Until FINI
  932.          B=0
  933.       End If 
  934.    Until B=0
  935.    Gr Writing 1
  936.    Colour 2,C
  937.    Ink CURCOL
  938.    Draw XB1,YB1 To XB2,YB2
  939.    CLPAL=TEMP
  940.    CLPALETTE
  941. End Proc
  942. Procedure CUT
  943.    '
  944.    ' Cuts out BOBS for use with PPaste  
  945.    '
  946.    If INBOB
  947.       Bob Update Off 
  948.       Bob Clear 
  949.    End If 
  950.    Gr Writing 2
  951.    XB1=X Screen(X Mouse)
  952.    YB1=Y Screen(Y Mouse)
  953.    XB2=X Screen(X Mouse)
  954.    YB2=Y Screen(Y Mouse)
  955.    C=Colour(2)
  956.    Colour 2,$FFF
  957.    Ink 2
  958.    Box XB1,YB1 To XB2,YB2
  959.    Repeat 
  960.       OLDX2=XB2
  961.       OLDY2=YB2
  962.       XB2=X Screen(X Mouse)
  963.       YB2=Y Screen(Y Mouse)
  964.       Box XB1,YB1 To OLDX2,OLDY2
  965.       Box XB1,YB1 To XB2,YB2
  966.       B=Mouse Key
  967.       If Not(B=0)
  968.          BUT=B
  969.       End If 
  970.    Until B=0
  971.    Box XB1,YB1 To XB2,YB2
  972.    Plot XB1,YB1 : Rem **** Stops a dot in top left of cut
  973.    Gr Writing 1
  974.    Colour 2,C
  975.    Ink CURCOL
  976.    If XB1>XB2
  977.       Swap XB1,XB2
  978.    End If 
  979.    If YB1>YB2
  980.       Swap YB1,YB2
  981.    End If 
  982.    Get Bob 1,XB1,YB1 To XB2+1,YB2+1
  983.    INBOB=True
  984.    ST_AMAL=True
  985.    AMLON=False
  986.    Hot Spot 1,17
  987. End Proc
  988. Procedure PPASTE
  989.    '
  990.    ' Pastes the bobs. 
  991.    ' I did have a really good AMAL program to make the BOB follow the mouse 
  992.    ' when in PASTE mode. but due to the screen saving I got wierd effects 
  993.    ' Pasting the BOBS. The solution is to turn off the AMAL program, and
  994.    ' then paste the BOB and turn it back on. Who knows? By the time 
  995.    ' you read this I might have done it. If I do, I'll leave this message.
  996.    ' what am I saying? If I delete this message you'll be none the wiser! 
  997.    '
  998.    ' I decided to leave the message!!! (as a word to the wise)  
  999.    TMPL=CLPAL
  1000.    If TMPL
  1001.       CLPAL=False
  1002.       CLPALETTE
  1003.    End If 
  1004.    If INBOB
  1005.       Repeat 
  1006.          Put Bob 1
  1007.       Until Mouse Key=0
  1008.    Else 
  1009.       Bell 10
  1010.    End If 
  1011.    AMLON=True
  1012.    If TMPL
  1013.       CLPAL=True
  1014.       CLPALETTE
  1015.    End If 
  1016. End Proc
  1017. Procedure ZOOOM
  1018.    Bell 10
  1019.    ' Not implemeted in pre-release. In time I want to do a fully
  1020.    ' featured zoom function. But, hey, it's only taken me a week to get 
  1021.    ' This far. It's only two and a half weeks since I started programming 
  1022.    ' AMOS in earnest. The Zoom might take a little longer to appear as
  1023.    ' my freetime is about to vanish!. 
  1024.    '  
  1025.    ' I got AMOS at the last Computer shopper show in the winter, for about
  1026.    ' 25 Pounds. Sure I'd tinkered with it, entered a few listings but never 
  1027.    ' got that far, as my A-Levels were looming ever nearer etc. But now 
  1028.    ' they're over, I'm going to Uni in October, and I couldn't get a  
  1029.    ' temporary job for the summer ( who says the recessions over? ).
  1030.    ' So I sat down a couple of weeks ago, and it's easier than I thought, 
  1031.    ' not sitting down stupid, AMOS. Okay, I can't do without the manual,
  1032.    ' buts that's because each command has more parameters than Gorbachev has
  1033.    ' supporters. (topical, eh? He got his Job back TODAY, 22rd Aug 1991)  
  1034.    ' But I've got a job coming up soon, and that's why I've left this 
  1035.    ' open-ended with a pre-release. Sorry.  
  1036.    '
  1037. End Proc
  1038. Procedure TTEXT
  1039.    '
  1040.    ' See Zooom
  1041.    '
  1042.    ' It's not that this procedure would be too time consuming It's just that
  1043.    ' I can't think of a nice way to do it. Y'see, I can't add another menu
  1044.    ' for Fonts as this would take me of the edge of a lowres screen, and
  1045.    ' text can't be entered directly on the screen as I have no UNDO.
  1046.    ' I need a window or something to edit the text FIRST. 
  1047.    ' Basically, I can't be bothered, but the main prob is choosing the fonts. 
  1048.    ' Anyway, what are you complaining about, No Text? Stop wibbling, you've 
  1049.    ' got a Painting Oackage you didn't have yesterday, and how much did 
  1050.    ' it cost you? Next to nothing, I'll bet. Oh yeah, and a postage stamp.
  1051.    ' Postage stamp? Yup, to send that PD disk to me, (see diskware), I  
  1052.    ' didn't count the disk price in the cost as you get it back, with some
  1053.    ' other stuff on it!!!  Oh, you only get it back if I get your address 
  1054.    ' as well. Mine is 107 Heron Rd. Larkfield, Kent, England. See top of file 
  1055.    '
  1056. End Proc
  1057. Procedure ACTION
  1058.    '
  1059.    ' Process menus
  1060.    ' FXIT is used in a Bug fix of AMOS 1.2, I must tell Mandarin about that 
  1061.    ' and the suspected bug when Input is used with a real variable. 
  1062.    ' Amos_Brot V1.0 uses input, and it crashes periodically, the program  
  1063.    ' does not seem to move on from the input call. (all that follows it is
  1064.    ' another input!)
  1065.    '
  1066.    BUT=0
  1067.    If Choice or FXIT
  1068.       FXIT=False
  1069.       TEMP=TTOOLS
  1070.       TTOOLS=False
  1071.       TTOOLBOX
  1072.       TTOOLS=TEMP
  1073.       If Choice(1)=1
  1074.          If Choice(2)=1
  1075.             REQ["Clear Screen?","Yes","No"]
  1076.             If Left$(Param$,1)="Y"
  1077.                Screen 0
  1078.                TEMP=CLPAL
  1079.                CLPAL=False
  1080.                CLPALETTE
  1081.                CLPAL=TEMP
  1082.                If AMLON
  1083.                   Bob Update Off 
  1084.                   Bob Clear 
  1085.                End If 
  1086.                Cls 0
  1087.                If AMLON
  1088.                   Bob Draw 
  1089.                   Bob Update On 
  1090.                End If 
  1091.                CLPALETTE
  1092.             End If 
  1093.          End If 
  1094.          If Choice(2)=3
  1095.             LPIC
  1096.          End If 
  1097.          If Choice(2)=4
  1098.             SPIC
  1099.          End If 
  1100.          If Choice(2)=6
  1101.             SCRMODE
  1102.          End If 
  1103.          If Choice(2)=7
  1104.             PAL
  1105.          End If 
  1106.          If Choice(2)=8
  1107.             TTOOLS= Not TTOOLS
  1108.          End If 
  1109.          If Choice(2)=9
  1110.             CLPAL= Not CLPAL
  1111.          End If 
  1112.          If Choice(2)=10
  1113.             ABOUT
  1114.          End If 
  1115.          If Choice(2)=11
  1116.             BON= Not BON
  1117.          End If 
  1118.          If Choice(2)=13
  1119.             REQ["Positive?","Yes","No"]
  1120.             If Left$(Param$,1)="Y"
  1121.                FIN=True
  1122.             End If 
  1123.          End If 
  1124.       Else 
  1125.          If Choice(1)=2
  1126.             If Choice(2)=1
  1127.                CURROP=1
  1128.             End If 
  1129.             If Choice(2)=2
  1130.                CURROP=7
  1131.             End If 
  1132.             If Choice(2)=3
  1133.                CURROP=2
  1134.             End If 
  1135.             If Choice(2)=4
  1136.                CURROP=8
  1137.             End If 
  1138.             If Choice(2)=5
  1139.                CURROP=3
  1140.             End If 
  1141.             If Choice(2)=6
  1142.                CURROP=9
  1143.             End If 
  1144.             If Choice(2)=7
  1145.                CURROP=4
  1146.             End If 
  1147.             If Choice(2)=8
  1148.                CURROP=10
  1149.             End If 
  1150.             If Choice(2)=9
  1151.                CURROP=5
  1152.             End If 
  1153.             If Choice(2)=10
  1154.                CURROP=11
  1155.             End If 
  1156.             If Choice(2)=11
  1157.                CURROP=6
  1158.             End If 
  1159.             If Choice(2)=12
  1160.                CURROP=12
  1161.             End If 
  1162.             If Choice(2)=14
  1163.                MSTORE=1
  1164.             End If 
  1165.             If Choice(2)=15
  1166.                MSTORE=2
  1167.             End If 
  1168.             If Choice(2)=17
  1169.                CHNGVARY[50]
  1170.                IT=Param
  1171.             End If 
  1172.             If Choice(2)=18
  1173.                CHNGVARY[50]
  1174.                DPT=Param
  1175.             End If 
  1176.             Change Mouse MSTORE
  1177.          End If 
  1178.       End If 
  1179.       Screen 0
  1180.       TTOOLBOX
  1181.    End If 
  1182.    DEFMENU
  1183.    Clear Key 
  1184.    On Menu On 
  1185. End Proc
  1186. Procedure ABOUT
  1187.    '
  1188.    ' Show my details to all those who haven't got AMOS to read these REMS 
  1189.    ' Updaters may add there own credit screens if my credit screen comes
  1190.    ' up first and unaltered. If you update the prog send your RAMOS disk
  1191.    ' to me, you'll get it back, with info on your version number ( we don't 
  1192.    ' want different programs knocking around with identical version numbers!) 
  1193.    ' I'll use a letter system, a big renovation might go from 1.0 to 1.1  
  1194.    ' or 1.0f say, a smaller revision might get less of a leap due to being  
  1195.    ' slotted between other updates. 
  1196.    '
  1197.    ' Anyone sending a disk under Diskware will receive the latest/best  
  1198.    ' revision (or both) if available. 
  1199.    '
  1200.    Boom 
  1201.    Hide 
  1202.    TEMP=TTOOLS
  1203.    TTOOLS=False
  1204.    TTOOLBOX
  1205.    TTOOLS=TEMP
  1206.    Menu Off 
  1207.    Clear Key 
  1208.    If ABOT or Exist("Sources:Graphics/About.ABK")
  1209.       If Not ABOT
  1210.          Load "Sources:Graphics/About.abk",10
  1211.          ABOT=True
  1212.       End If 
  1213.       Unpack 10 To 5
  1214.       'Screen Open 1,160,187,16,Lowres 
  1215.       'screen Display 1,220,60,,'
  1216.       Repeat 
  1217.          FINI=(Mouse Key=1)
  1218.          K$=Inkey$
  1219.          If Not(K$="")
  1220.             FINI=True
  1221.          End If 
  1222.       Until FINI
  1223.       Screen Close 5
  1224.    Else 
  1225.    End If 
  1226.    Show 
  1227.    Clear Key 
  1228.    Menu On 
  1229.    TTOOLBOX
  1230. End Proc
  1231. Procedure LPIC
  1232.    '
  1233.    ' Loads a picture
  1234.    '
  1235.    T=REQON
  1236.    AML=AMLON
  1237.    AMLON=False
  1238.    If AML
  1239.       Amal Freeze 
  1240.       Bob Clear 
  1241.       Amal Off 
  1242.    End If 
  1243.    TMP=CLPAL : CLPAL=False : CLPALETTE
  1244.    TEMP=TTOOLS : TTOOLS=False : TTOOLBOX : TTOOLS=TEMP : CLPAL=TMP
  1245.    F$=Fsel$("**.**","","(AM)os (P)ainting (P)ackage "," Load a Picture")
  1246.    If Not F$=""
  1247.       If Upper$(Right$(F$,3))="PCK"
  1248.          Load F$,9
  1249.          Unpack 9 To 0
  1250.       Else 
  1251.          Load Iff F$,0
  1252.       End If 
  1253.       If Screen Colour<65
  1254.          If Screen Width mod 320=0
  1255.             If(Screen Height=200) or(Screen Height=256)
  1256.                HEIGHT=Screen Height
  1257.                PAL=(HEIGHT=256)
  1258.                WIDTH=Screen Width
  1259.                CLR=Screen Colour
  1260.             Else 
  1261.                REQ["Screen size is iffy","Oh","Bugger!"]
  1262.                REQON=False
  1263.                SCRMODE
  1264.             End If 
  1265.          Else 
  1266.             Cls 0
  1267.             REQ["Screen size is iffy","Oh","Bugger!"]
  1268.             REQON=False
  1269.             SCRMODE
  1270.          End If 
  1271.       Else 
  1272.          REQ["HAM not supported","Oh","No!"]
  1273.          REQON=False
  1274.          SCRMODE
  1275.          Cls 0
  1276.       End If 
  1277.    End If 
  1278.    REQON=T
  1279.    TTOOLBOX
  1280.    If AML
  1281.       Bob 1,X Screen(X Mouse),Y Screen(Y Mouse),1
  1282.       Channel 1 To Bob 1
  1283.       G$="AU (I R0<>XS(0,XM) J U I R1<>YS(0,YM) J U X U:"
  1284.       G$=G$+"L R0=XS(0,XM);"
  1285.       G$=G$+"L R1=YS(0,YM); D M) M: M R0-X,R1-Y,1 W;"
  1286.       Amal 1,G$
  1287.       Amal On 
  1288.    End If 
  1289.    AMLON=AML
  1290. End Proc
  1291. Procedure SPIC
  1292.    '
  1293.    ' Saves a picture
  1294.    '
  1295.    If AMLON
  1296.       Amal Freeze 
  1297.       Bob Clear 
  1298.       Amal Off 
  1299.    End If 
  1300.    TMP=CLPAL : CLPAL=False : CLPALETTE
  1301.    TEMP=TTOOLS : TTOOLS=False : TTOOLBOX : TTOOLS=TEMP : CLPAL=TMP
  1302.    F$=Fsel$("**.**","","(AM)os (P)ainting (P)ackage "," Load a Picture")
  1303.    If Not F$=""
  1304.       STAN=(Upper$(Right$(F$,3))="IFF")
  1305.       PCK=(Upper$(Right$(F$,3))="PCK")
  1306.       If Not(STAN or PCK)
  1307.          REQ["File Format?","Iff","Pck"]
  1308.          If Upper$(Left$(Param$,1))="I"
  1309.             F$=F$+".IFF"
  1310.             STAN=True
  1311.          Else 
  1312.             F$=F$+".PCK"
  1313.             PCK=True
  1314.          End If 
  1315.       End If 
  1316.       If PCK
  1317.          REQ["Hold on a mo","Okay","Matey"]
  1318.          Hide 
  1319.          Spack 0 To 9
  1320.          Save F$,9
  1321.          Show 
  1322.       Else 
  1323.          REQ["Iff Compression?","Yup","No thanks."]
  1324.          If Upper$(Left$(Param$,1))="Y"
  1325.             COMP=1
  1326.          Else 
  1327.             COMP=0
  1328.          End If 
  1329.          Save Iff F$,COMP
  1330.       End If 
  1331.    End If 
  1332.    If AMLON
  1333.       Bob 1,X Screen(X Mouse),Y Screen(Y Mouse),1
  1334.       Channel 1 To Bob 1
  1335.       G$="AU (I R0<>XS(0,XM) J U I R1<>YS(0,YM) J U X U:"
  1336.       G$=G$+"L R0=XS(0,XM);"
  1337.       G$=G$+"L R1=YS(0,YM); D M) M: M R0-X,R1-Y,1 W;"
  1338.       Amal 1,G$
  1339.       Amal On 
  1340.    End If 
  1341.    TTOOLBOX
  1342. End Proc
  1343. Procedure SCRMODE
  1344.    '  
  1345.    ' Changes the screen MOde. C'mon Mandarin, where's interlace?
  1346.    '
  1347.    Clear Key 
  1348.    Menu Off 
  1349.    REQ["Change Screen?","Yes","No"]
  1350.    If Left$(Param$,1)="Y"
  1351.       Change Mouse 1
  1352.       Limit Mouse 
  1353.       If HEIGHT=256
  1354.          PAL=True
  1355.       End If 
  1356.       ZNNUM=11
  1357.       INBOB=False
  1358.       WDT=320
  1359.       HTH=150
  1360.       WDT=WDT
  1361.       HTH=HTH
  1362.       FINISHED=False
  1363.       Screen Open 1,WDT+16,HTH+8,2,Lowres
  1364.       Flash Off 
  1365.       Curs Off 
  1366.       Palette $0,$DDD
  1367.       Cls 1
  1368.       Paper 1
  1369.       Pen 0
  1370.       Reserve Zone ZNNUM
  1371.       If PAL
  1372.          RES$="256"
  1373.       Else 
  1374.          RES$="200"
  1375.       End If 
  1376.       PAL$=Border$(Zone$("Pal.",1),1)
  1377.       NTSC$=Border$(Zone$("Ntsc.",2),1)
  1378.       LOW$=Border$(Zone$("320x"+RES$,3),1)
  1379.       HI$=Border$(Zone$("640x"+RES$,4),1)
  1380.       TWO$=Border$(Zone$(" 2 ",5),1)
  1381.       FUR$=Border$(Zone$(" 4 ",6),1)
  1382.       AYT$=Border$(Zone$(" 8 ",7),1)
  1383.       SXT$=Border$(Zone$("16 ",8),1)
  1384.       TRT$=Border$(Zone$("32 ",9),1)
  1385.       SXF$=Border$(Zone$("EHB",10),1)
  1386.       FIN$=Border$(Zone$("Okay.",11),1)
  1387.       L=11 : G=6 : T=3 : S=3
  1388.       Locate L,T : Print PAL$
  1389.       Locate L+6,T : Print NTSC$
  1390.       Locate L,T+2*S : Print LOW$
  1391.       Locate L,T+3*S : Print HI$
  1392.       Locate L+14,T : Print TWO$
  1393.       Locate L+14+G,T : Print SXT$
  1394.       Locate L+14,T+S : Print FUR$
  1395.       Locate L+14+G,T+S : Print TRT$
  1396.       Locate L+14,T+2*S : Print AYT$
  1397.       Locate L+14+G,T+2*S : Print SXF$
  1398.       Locate L+15,T+3*S : Print FIN$
  1399.       Locate L,T+4*S
  1400.       Print Str$(WIDTH)+"x"+RES$+"  "+Str$(CLR)+" colours. ";
  1401.       Repeat 
  1402.          K$=Inkey$
  1403.          If Mouse Key=1
  1404.             Locate L,T+4*S
  1405.             Print Str$(WIDTH)+"x"+RES$+"  "+Str$(CLR)+" colours. "
  1406.             Z=Mouse Zone
  1407.             If Z>0
  1408.                If Z<ZNNUM+1
  1409.                   If Z<3
  1410.                      If Z=1
  1411.                         PAL=True
  1412.                      Else 
  1413.                         PAL=False
  1414.                      End If 
  1415.                      If PAL
  1416.                         RES$="256"
  1417.                      Else 
  1418.                         RES$="200"
  1419.                      End If 
  1420.                      LOW$=Border$(Zone$("320x"+RES$,3),1)
  1421.                      HI$=Border$(Zone$("640x"+RES$,4),1)
  1422.                      Locate L+X,T+2*S : Print LOW$
  1423.                      Locate L+X,T+3*S : Print HI$
  1424.                   End If 
  1425.                   If Z=3
  1426.                      WIDTH=320
  1427.                   End If 
  1428.                   If Z=4
  1429.                      WIDTH=640
  1430.                      If CLR>16
  1431.                         CLR=16
  1432.                      End If 
  1433.                   End If 
  1434.                   If(Z>4) and(Z<11)
  1435.                      I=Z-4
  1436.                      CLR=1
  1437.                      For P=1 To I
  1438.                         CLR=2*CLR
  1439.                      Next P
  1440.                      If CLR>16
  1441.                         WIDTH=320
  1442.                      End If 
  1443.                   End If 
  1444.                   If Z=11
  1445.                      FINISHED=True
  1446.                   End If 
  1447.                End If 
  1448.             End If 
  1449.          End If 
  1450.          If Not K$=""
  1451.             FINISHED=True
  1452.          End If 
  1453.       Until FINISHED
  1454.       Reserve Zone 
  1455.       Screen Close 1
  1456.       If PAL
  1457.          HEIGHT=256
  1458.       Else 
  1459.          HEIGHT=200
  1460.       End If 
  1461.       If WIDTH=320
  1462.          Screen Open 0,WIDTH,HEIGHT,CLR,Lowres
  1463.       Else 
  1464.          Screen Open 0,WIDTH,HEIGHT,CLR,Hires
  1465.       End If 
  1466.       Curs Off 
  1467.       Flash Off 
  1468.       Cls 0
  1469.       DEFPAL
  1470.    End If 
  1471.    Menu On 
  1472.    Change Mouse MSTORE
  1473.    Screen To Back 0
  1474.    Limit Mouse 128,42 To 127+WIDTH,41+HEIGHT
  1475. End Proc
  1476. Procedure REQ[MS$,V1$,V2$]
  1477.    Clear Key 
  1478.    Rem *************************************
  1479.    Rem **      REQUEST BOX CONTROLLER     **  
  1480.    Rem *************************************
  1481.    Rem **   PLEASE MAKE V1$ YOUR DEFAULT  **
  1482.    Rem **   This will be returned if the  **
  1483.    Rem **      boxes are turned off,      **
  1484.    Rem **   MS$ is the box message, the   **          
  1485.    Rem **         two are gadgets         **
  1486.    Rem *************************************
  1487.    If REQON
  1488.       If AMLON
  1489.          Amal Freeze 
  1490.          Bob Clear 
  1491.          Amal Off 
  1492.       End If 
  1493.       REQBOX[MS$,V1$,V2$]
  1494.       If AMLON
  1495.          Bob 1,X Screen(X Mouse),Y Screen(Y Mouse),1
  1496.          Channel 1 To Bob 1
  1497.          G$="AU (I R0<>XS(0,XM) J U I R1<>YS(0,YM) J U X U:"
  1498.          G$=G$+"L R0=XS(0,XM);"
  1499.          G$=G$+"L R1=YS(0,YM); D M) M: M R0-X,R1-Y,1 W;"
  1500.          Amal 1,G$
  1501.          Amal On 
  1502.       End If 
  1503.       V$=Param$
  1504.    Else 
  1505.       V$=V1$
  1506.    End If 
  1507.    Clear Key 
  1508. End Proc[V$]
  1509. Procedure REQBOX[MES$,G1$,G2$]
  1510.    '  
  1511.    ' Actual request Box 
  1512.    '
  1513.    Rem ******************** 
  1514.    Rem ** Use my Colours ** 
  1515.    Rem ******************** 
  1516.    C1=Colour(1)
  1517.    C2=Colour(2)
  1518.    Colour 1,$A40
  1519.    Colour 2,$FFF
  1520.    If CLR>2
  1521.       Pen 2
  1522.       Paper 1
  1523.    Else 
  1524.       Pen 1
  1525.       Paper 0
  1526.    End If 
  1527.    Rem *********************************
  1528.    Rem ***    Do that Request Box    ***
  1529.    Rem *********************************
  1530.    Change Mouse 1
  1531.    A$=Left$(G1$,1) : Rem **** Work out first letters **** 
  1532.    B$=Left$(G2$,1) : Rem **** in gadgets ***
  1533.    If Asc(A$)>96 Then A$=Chr$(Asc(A$)-32) : Rem ***Convert case ***
  1534.    If Asc(B$)>96 Then B$=Chr$(Asc(B$)-32) : Rem *** myself *** 
  1535.    I=Len(MES$)+6 : Rem *** Work out title length ***
  1536.    If I<(Len(G1$+G2$)+9) Then I=(Len(G1$+G2$)+9) : Rem ** see if it's **
  1537.    Rem ******* Longer than the gadget lengths ******
  1538.    J=I*8 : Rem Hash together a block save 
  1539.    K=J/16
  1540.    If Not(J=K*16)
  1541.       J=J+8
  1542.    End If 
  1543.    J=J+16 : Rem to be sure of size 
  1544.    Rem *********************************************************
  1545.    Rem ** I used the blocks as they are quicker than windsave **
  1546.    Rem ** I know on page 101 it says to create a Dummy window **
  1547.    Rem ** But how? and if you could open the dummy window,    **
  1548.    Rem ** without affecting the screen why didn't it do that  **
  1549.    Rem **                     anyway?                         **
  1550.    Rem *********************************************************
  1551.    Get Block 1,0,0,J,80
  1552.    Wind Open 1,0,0,I,8,1 : Rem ***Save background open box ***
  1553.    Curs Off 
  1554.    Flash Off 
  1555.    Reserve Zone 2 : Rem ****reserve two Zones***** 
  1556.    Window 1
  1557.    Title Top MES$ : Rem ****Put in the box title***
  1558.    Locate 2,3
  1559.    Print Border$(Zone$(G1$,1),1) : Rem **** Add the gadgets *** 
  1560.    T=I-Len(G2$)-4 : Rem *** Find posn of right gadget ***
  1561.    Locate T,3
  1562.    Print Border$(Zone$(G2$,2),1)
  1563.    Repeat : Rem ***Wait for a response or a keypress ****
  1564.       I=Mouse Key : Rem *** Keypress only works if first letters *** 
  1565.       OK=((I=1) or(I=3)) : Rem *** are different ***
  1566.       A=Mouse Zone
  1567.       INZ=((1=A) or(2=A))
  1568.       If Not(A$=B$)
  1569.          X$=Inkey$
  1570.          If Asc(X$)>96
  1571.             X$=Chr$(Asc(X$)-32)
  1572.          End If 
  1573.          LETT=((X$=A$) or(X$=B$))
  1574.          If LETT
  1575.             If X$=A$
  1576.                A=1
  1577.             Else 
  1578.                A=2
  1579.             End If 
  1580.          End If 
  1581.       End If 
  1582.    Until LETT or(OK and INZ)
  1583.    Wind Close 
  1584.    Rem *************************
  1585.    Rem ** Put Background Back **
  1586.    Rem *************************
  1587.    Put Block 1
  1588.    Del Block 1
  1589.    Reset Zone 1
  1590.    Reset Zone 2
  1591.    If A=1
  1592.       A$=G1$
  1593.    Else 
  1594.       A$=G2$
  1595.    End If 
  1596.    Colour 1,C1
  1597.    Colour 2,C2
  1598.    Change Mouse MSTORE
  1599.    Rem ***** Return the selected variable ***** 
  1600. End Proc[A$]
  1601. Procedure PAL
  1602.    '
  1603.    ' Do Palette, procedure has been changed by neccesity since AMOS_BROT
  1604.    ' But you wouldn't know it would you?
  1605.    '
  1606.    Rem ************************************************** 
  1607.    Rem ** I worked out how to do this all on my own   *** 
  1608.    Rem ** I'm quite proud of it, even if it is clumsy ***   
  1609.    Rem ************************************************** 
  1610.    Rem ** This version is uodated to that found in    *** 
  1611.    Rem ** Amos Brot in that it now operates up to 64  *** 
  1612.    Rem ** Colours *************************************** 
  1613.    Rem ************************************************** 
  1614.    TEMP=CLPAL
  1615.    CLPAL=False
  1616.    CLPALETTE
  1617.    CLPAL=True
  1618.    Clear Key 
  1619.    Volume 10
  1620.    Change Mouse 1
  1621.    Menu Off 
  1622.    STX=0
  1623.    STY=0
  1624.    WDT=304
  1625.    HTH=104
  1626.    Get Cblock 1,0,0,WDT+16,HTH+8
  1627.    Curs Off 
  1628.    Reserve Zone CLR+8
  1629.    Repeat 
  1630.       K$=Inkey$
  1631.       FINISHED=False
  1632.       CHNGPAL=False
  1633.       Flash Off 
  1634.       Curs Off 
  1635.       Ink PALFOR
  1636.       Set Pattern 0
  1637.       Box STX,STY To STX+WDT,STY+HTH
  1638.       Ink PALBAK
  1639.       Bar STX+1,STY+1 To STX+WDT-1,STY+HTH-1
  1640.       Ink PALFOR
  1641.       GP=8
  1642.       DIFX=WDT/2-GP*2
  1643.       DIFY=HTH/2-GP/2
  1644.       DIFX=DIFX-(DIFX mod 8) : Rem ** to ensure even boxes ** 
  1645.       DIFY=DIFY-(DIFY mod 4)
  1646.       XSTART=WDT/2+GP+STX
  1647.       YSTART=STY+GP/2
  1648.       Box XSTART,YSTART To XSTART+DIFX,YSTART+DIFY
  1649.       If CLR=2
  1650.          HLINE=2
  1651.          VLINE=3
  1652.       Else 
  1653.          If CLR<16
  1654.             HLINE=3
  1655.             If CLR=4
  1656.                VLINE=3
  1657.             Else 
  1658.                VLINE=5
  1659.             End If 
  1660.          Else 
  1661.             HLINE=5
  1662.             If CLR=16
  1663.                VLINE=5
  1664.             Else 
  1665.                If CLR=32
  1666.                   VLINE=9
  1667.                Else 
  1668.                   VLINE=17
  1669.                End If 
  1670.             End If 
  1671.          End If 
  1672.       End If 
  1673.       HDIV=HLINE-1
  1674.       VDIV=VLINE-1
  1675.       For I=0 To HDIV
  1676.          Draw XSTART,YSTART+I*(DIFY/HDIV) To XSTART+DIFX,YSTART+I*(DIFY/HDIV)
  1677.       Next I
  1678.       For I=0 To VDIV
  1679.          Draw XSTART+I*(DIFX/VDIV),YSTART To XSTART+I*(DIFX/VDIV),YSTART+DIFY
  1680.       Next I
  1681.       For I=0 To CLR-1
  1682.          XP=XSTART+1+(I mod VDIV)*(DIFX/VDIV)
  1683.          YP=YSTART+1+(I/VDIV)*(DIFY/HDIV)
  1684.          Ink I
  1685.          XP2=XP+(DIFX/VDIV)-2
  1686.          YP2=YP+(DIFY/HDIV)-2
  1687.          Bar XP,YP To XP2,YP2
  1688.          Set Zone I+1,XP,YP To XP2,YP2
  1689.       Next I
  1690.       X1=STX+WDT-DIFX/3-GP
  1691.       Y1=YSTART+DIFY+2
  1692.       X2=XSTART+DIFX
  1693.       Y2=STY+HTH-3
  1694.       Ink PALFOR
  1695.       Box X1,Y1 To X2,Y2
  1696.       Ink CURCOL
  1697.       Bar(X1+1),(Y1+1) To(X2-1),(Y2-1)
  1698.       Pen PALFOR
  1699.       Locate X Text(XSTART),Y Text(YSTART+GP+DIFY)
  1700.       Paper PALBAK
  1701.       Print Border$(Zone$("Swap",CLR+1),1);Cright$;Cright$;Border$(Zone$("Use",CLR+2),1)
  1702.       Locate X Text(STX+2*GP),Y Text(YSTART+4*GP+DIFY)
  1703.       FO$=Border$(Zone$("Foreground",CLR+3),1)
  1704.       BA$=Border$(Zone$("Background",CLR+4),1)
  1705.       RE$=Border$(Zone$("Reset",CLR+5),1)
  1706.       Print FO$;Cright$;Cright$;BA$;Cright$;Cright$;RE$
  1707.       C=Colour(CURCOL)
  1708.       BLUE=C mod 16
  1709.       GREEN=(C/16) mod 16
  1710.       RED=(C/256) mod 16
  1711.       T1=STY+GP
  1712.       GAP=30
  1713.       STGP=20
  1714.       Set Zone CLR+6,STX+STGP,T1 To STX+STGP+GAP,YSTART+2*GP+DIFY
  1715.       Set Zone CLR+7,STX+STGP+GAP+GP,T1 To STX+STGP+GP+2*GAP,YSTART+2*GP+DIFY
  1716.       Set Zone CLR+8,STX+STGP+2*GAP+2*GP,T1 To STX+STGP+2*GP+3*GAP,YSTART+2*GP+DIFY
  1717.       VSLIDE[STX+STGP,T1,STX+STGP+GAP,YSTART+2*GP+DIFY,RED]
  1718.       VSLIDE[STX+STGP+GAP+GP,T1,STX+STGP+GP+2*GAP,YSTART+2*GP+DIFY,GREEN]
  1719.       VSLIDE[STX+STGP+2*GAP+2*GP,T1,STX+STGP+2*GP+3*GAP,YSTART+2*GP+DIFY,BLUE]
  1720.       Repeat 
  1721.          FINISHED=False
  1722.          CHNGPAL=False
  1723.          Z=Mouse Zone
  1724.          K=Mouse Key
  1725.          If K=1
  1726.             If(Z<CLR+1) and(Z>0)
  1727.                Set Pattern 0
  1728.                CURCOL=Z-1
  1729.                C=Colour(CURCOL)
  1730.                Ink CURCOL
  1731.                Bar(X1+1),(Y1+1) To(X2-1),(Y2-1)
  1732.                BLUE=C mod 16
  1733.                GREEN=(C/16) mod 16
  1734.                RED=(C/256) mod 16
  1735.                VSLIDE[STX+STGP,T1,STX+STGP+GAP,YSTART+2*GP+DIFY,RED]
  1736.                VSLIDE[STX+STGP+GAP+GP,T1,STX+STGP+GP+2*GAP,YSTART+2*GP+DIFY,GREEN]
  1737.                VSLIDE[STX+STGP+2*GAP+2*GP,T1,STX+STGP+2*GP+3*GAP,YSTART+2*GP+DIFY,BLUE]
  1738.             End If 
  1739.             If Z>CLR
  1740.                If Z=CLR+1
  1741.                   Repeat 
  1742.                      U=0
  1743.                      If Not(A=X Mouse)
  1744.                         If Not(B=Y Mouse)
  1745.                            Bell 20
  1746.                         End If 
  1747.                      End If 
  1748.                      U=Mouse Zone : K=Mouse Key
  1749.                      A=X Mouse : B=Y Mouse
  1750.                   Until((U>0) and(U<CLR+1)) and(K=1)
  1751.                   U=U-1
  1752.                   If U>31
  1753.                      U=U-32 : Rem To avoid errors working in EHB mode
  1754.                   End If 
  1755.                   If CURCOL>31
  1756.                      CURCOL=CURCOL-32
  1757.                   End If 
  1758.                   TEMP=Colour(CURCOL)
  1759.                   Colour CURCOL,Colour(U)
  1760.                   Colour U,TEMP
  1761.                End If 
  1762.                If Z=CLR+2
  1763.                   FINISHED=True
  1764.                End If 
  1765.                If Z=CLR+3 or Z=CLR+4
  1766.                   Repeat 
  1767.                      If Not(A=X Mouse)
  1768.                         If Not(B=Y Mouse)
  1769.                            Bell 20
  1770.                         End If 
  1771.                      End If 
  1772.                      U=Mouse Zone : K=Mouse Key
  1773.                      A=X Mouse : B=Y Mouse
  1774.                   Until((U>0) and(U<CLR+1)) and(K=1)
  1775.                   If Z=CLR+3
  1776.                      PALFOR=U-1
  1777.                   Else 
  1778.                      PALBAK=U-1
  1779.                   End If 
  1780.                   FINISHED=True
  1781.                   CHNGPAL=True
  1782.                End If 
  1783.                If Z=CLR+5
  1784.                   DEFPAL
  1785.                   FINISHED=True
  1786.                   CHNGPAL=True
  1787.                End If 
  1788.                If(Z>CLR+5) and(Z<CLR+9)
  1789.                   Repeat 
  1790.                      POS=(16*(YSTART+2*GP+DIFY-Y Screen(Y Mouse)))/(YSTART+2*GP+DIFY-T1)
  1791.                      If POS<1
  1792.                         POS=1
  1793.                      End If 
  1794.                      If POS>16
  1795.                         POS=16
  1796.                      End If 
  1797.                      If Z=CLR+6
  1798.                         RED=POS
  1799.                         VSLIDE[STX+STGP,T1,STX+STGP+GAP,YSTART+2*GP+DIFY,RED]
  1800.                         RED=RED-1
  1801.                      Else 
  1802.                         If Z=CLR+7
  1803.                            GREEN=POS
  1804.                            VSLIDE[STX+STGP+GAP+GP,T1,STX+STGP+GP+2*GAP,YSTART+2*GP+DIFY,GREEN]
  1805.                            GREEN=GREEN-1
  1806.                         Else 
  1807.                            If Z=CLR+8
  1808.                               BLUE=POS
  1809.                               VSLIDE[STX+STGP+2*GAP+2*GP,T1,STX+STGP+2*GP+3*GAP,YSTART+2*GP+DIFY,BLUE]
  1810.                               BLUE=BLUE-1
  1811.                            End If 
  1812.                         End If 
  1813.                      End If 
  1814.                      Set Pattern 0
  1815.                      If CURCOL>31
  1816.                         CURCOL=CURCOL-32
  1817.                      End If 
  1818.                      Colour CURCOL,(RED*256)+(GREEN*16)+BLUE
  1819.                   Until Not(Mouse Key mod 2)=1
  1820.                End If 
  1821.             End If 
  1822.          End If 
  1823.       Until FINISHED
  1824.       Put Cblock 1
  1825.    Until Not CHNGPAL
  1826.    Del Cblock 1
  1827.    Reserve Zone 
  1828.    Change Mouse MSTORE
  1829.    Volume 63
  1830.    Set Pattern 0
  1831.    CLRSB=Colour(0)
  1832.    If TTOOLS
  1833.       Screen 2
  1834.       Colour 0,CLRSB
  1835.       Screen 0
  1836.    End If 
  1837.    Menu On 
  1838. End Proc
  1839. Procedure DEFPAL
  1840.    '
  1841.    ' My Default Palette 
  1842.    '
  1843.    Colour 0,0
  1844.    Colour 1,$A40
  1845.    If CLR>2
  1846.       Colour 2,$FFF
  1847.       Colour 3,0
  1848.       If CLR>4
  1849.          Colour 4,$F00
  1850.          Colour 5,$F0
  1851.          Colour 6,$F
  1852.          Colour 7,$666
  1853.          If CLR>8
  1854.             Colour 8,$555
  1855.             Colour 9,$333
  1856.             Colour 10,$733
  1857.             Colour 11,$373
  1858.             Colour 12,$773
  1859.             Colour 13,$337
  1860.             Colour 14,$737
  1861.             Colour 15,$377
  1862.             If CLR>16
  1863.                Colour 16,$0
  1864.                Colour 17,$EC8
  1865.                Colour 18,$C60
  1866.                Colour 19,$EA0
  1867.                Colour 20,$27F
  1868.                Colour 21,$49D
  1869.                Colour 22,$5AE
  1870.                Colour 23,$ADF
  1871.                Colour 24,$BDF
  1872.                Colour 25,$CEF
  1873.                Colour 26,$FFF
  1874.                Colour 27,$408
  1875.                Colour 28,$A0E
  1876.                Colour 29,$E0E
  1877.                Colour 30,$E08
  1878.                Colour 31,$EEE
  1879.             End If 
  1880.          End If 
  1881.       End If 
  1882.    End If 
  1883.    PALFOR=INITFOR
  1884.    PALBAK=INITBAK
  1885. End Proc
  1886. Procedure VSLIDE[A,B,C,D,P]
  1887.    '
  1888.    ' My Slider Bars for procedure PAL,
  1889.    ' It's here to cut down on the number of parameters I had to remember
  1890.    ' whilst writing PAL. (Believe it or not, this procedure, I found was one  
  1891.    ' of the trickier ones! It was originally written, with PAL, REQ and REQBOX
  1892.    ' for AMOS_BROT V1.0 ) 
  1893.    '
  1894.    Set Slider PALFOR,PALBAK,PALFOR,,PALBAK,PALBAK,PALFOR,
  1895.    Vslider A,B To C,D,16,16-P,1
  1896. End Proc