home *** CD-ROM | disk | FTP | other *** search
/ Falcon 030 Power 2 / F030_POWER2.iso / ST_STE / MAGS / ICTARI03.ARJ / ictari.03 / BASIC / CHAO_E26.BAS
BASIC Source File  |  1992-12-13  |  35KB  |  1,350 lines

  1. ' All main variables are global.
  2. '
  3. Creell=0.745428
  4. Cimag=0.113009
  5. '
  6. Mmandelbrot=42                 !These are the menu entry constants
  7. Mjuliaset=43
  8. Mkoor=11
  9. Mstepxy=12
  10. Mmax=13
  11. Mgrenz=14
  12. Mcree=16
  13. Mcim=17
  14. Mstandpar=19
  15. Mjuliakonst=30
  16. Mzeich=27
  17. Mgross=28
  18. Mgrau=45
  19. '
  20. Lim=50                ! Limit of pictures internally stored
  21. '
  22. Dim Val(Lim,11)       ! Array to store the data from which each picture
  23. '                       is calculated
  24. Dim Val$(Lim)         ! Array to store the actual pictures in
  25. '
  26. Dat=1                 ! Index to the current array position
  27. '                     ! for both Val,Val$
  28. Maxdat=1              ! Index to the last picture currently stored, so that
  29. '                     ! nothing is lost when one goes to previous pictures
  30. '
  31. Dim A$(49)                  ! Menu installation
  32. A$(0)="Desk "
  33. A$(1)=" Info            "
  34. A$(2)="-----------------"
  35. A$(3)="1"
  36. A$(4)="2"
  37. A$(5)="3"
  38. A$(6)="4"
  39. A$(7)="5"
  40. A$(8)="6"
  41. A$(9)=""
  42. A$(10)="Param"
  43. A$(11)="  Coordinates"
  44. A$(12)="  Step X, Step y     "
  45. A$(13)="  Maxiterat          "
  46. A$(14)="  Limit              "
  47. A$(15)="---------------------"
  48. A$(16)="  CReal              "
  49. A$(17)="  CImaginary         "
  50. A$(18)="---------------------"
  51. A$(19)="  Standard Parameter "
  52. A$(20)="---------------------"
  53. A$(21)="  Show Parameters    "
  54. A$(22)="  Print Parameters   "
  55. A$(23)=""
  56. A$(24)="Go"
  57. A$(25)=" Start                 "
  58. A$(26)="-----------------------"
  59. A$(27)=" Redraw Area           "
  60. A$(28)=" Enlarge Area          "
  61. A$(29)="-----------------------"
  62. A$(30)=" Choose Julia-Constant "
  63. A$(31)=""
  64. A$(32)="Files"
  65. A$(33)="  Save Picture    "
  66. A$(34)="  Load Picture    "
  67. A$(35)="------------------"
  68. A$(36)="  Save Data       "
  69. A$(37)="  Load Data       "
  70. A$(38)="------------------"
  71. A$(39)="  Next Picture    "
  72. A$(40)="  Last Picture    "
  73. A$(41)="------------------"
  74. A$(42)="  Draw Mandel     "
  75. A$(43)="  Draw Julia      "
  76. A$(44)="------------------"
  77. A$(45)="  Show Grayshades "
  78. A$(46)="------------------"
  79. A$(47)=" Quit "
  80. A$(48)=""
  81. A$(49)=""
  82. '
  83. ' This is the main program
  84. Start=False       ! Tells if the picture is to be drawn using the GO command
  85. '                 ! (TRUE) or the REDRAW,ENLARGE commands (false)
  86. '
  87. @Initvalues
  88. @Setxandy
  89. '
  90. Hidem
  91. Cls
  92. Sget Val$(1)           !Save initial screen
  93. Showm
  94. '
  95. Menu A$()
  96. Menu Off
  97. On Menu  Gosub Menustuff
  98. @Menudefaults
  99. Do
  100.   On Menu
  101. Loop
  102. ' End of Main Program
  103. '
  104. Procedure Initvalues
  105.   Xstart%=0
  106.   Ystart%=0
  107.   X0max%=320       !Resolution values
  108.   X2max%=640
  109.   Y0max%=200
  110.   Y2max%=400
  111. Return
  112. '
  113. Procedure Setxandy  ! Sets Xmax and Ymax according to resolution
  114.   Rez%=Xbios(4)
  115.   If Rez%=0 Then
  116.     Xvalue%=X0max%
  117.     Yvalue%=Y0max%
  118.   Else
  119.     If Rez%=1 Then
  120.       Alert 1,"Program runs only in Low |or Highres.|",1," Oh ",Bt%
  121.       End
  122.     Else
  123.       Xvalue%=X2max%
  124.       Yvalue%=Y2max%
  125.     Endif
  126.   Endif
  127. Return
  128. '
  129. Procedure Calcvars   ! Converts the screen coordinates to coords in the
  130.   Rminl=(Rechts-Links)*(1/Xvalue%)    ! complex plane
  131.   Ominu=(Oben-Unten)*(1/Yvalue%)
  132. Return
  133. '
  134. Procedure Disablemanual ! Disables manual parameter entry options in the
  135.   Menu Mkoor,2          ! menu
  136.   Menu Mstepxy,2
  137.   Menu Mmax,2
  138.   Menu Mgrenz,2
  139.   Menu Mcree,2
  140.   Menu Mcim,2
  141. Return
  142. '
  143. Procedure Enablemanual
  144.   Menu Mkoor,3
  145.   Menu Mstepxy,3
  146.   Menu Mmax,3
  147.   Menu Mgrenz,3
  148.   Menu Mcree,3
  149.   Menu Mcim,3
  150. Return
  151. '
  152. Procedure Showmenu   ! Shows menu with the current settings
  153.   Menu A$()
  154.   If Rez%=2 Then
  155.     If Grau Then    !Grau = gray
  156.       Menu Mgrau,1
  157.     Else
  158.       Menu Mgrau,0
  159.     Endif
  160.   Else
  161.     Menu Mgrau,2
  162.   Endif
  163.   If Not Start Then
  164.     Menu Mzeich,2
  165.     Menu Mgross,2
  166.   Else
  167.     Menu Mzeich,3
  168.     Menu Mgross,3
  169.   Endif
  170.   If Not Julia Then
  171.     Menu Mmandelbrot,1
  172.     Menu Mjuliaset,0
  173.     Menu Mjuliakonst,3
  174.   Else
  175.     Menu Mmandelbrot,0
  176.     Menu Mjuliaset,1
  177.     Menu Mjuliakonst,2
  178.   Endif
  179.   If Inpar Then        ! Inpar=True => standart parameters
  180.     Menu Mstandpar,1
  181.     @Disablemanual
  182.   Else
  183.     Menu Mstandpar,0
  184.     @Enablemanual
  185.   Endif
  186. Return
  187. '
  188. Procedure Introduction
  189.   Print At(1,3);
  190.   Print "     THE  CHAOSGENERATOR V25.00"
  191.   Print
  192.   Print "This   program  calculates  and  draws "
  193.   Print "pictures of the socalled    Mandelbrot "
  194.   Print "and Julia Sets.                        "
  195.   Print
  196.   Print "The   program   scans   and   draws  a "
  197.   Print "selectable  area   of the   imaginary  "
  198.   Print "coordinate  plane."
  199.   Print "Black    points  lie     whithin   the "
  200.   Print "sets, coloured points at the borders or"
  201.   Print "outside.  "
  202.   Print "                                       "
  203.   Print "The  program works in low res colour or"
  204.   Print "monochrome.    For   more  interesting "
  205.   Print "results   one  should  choose   colour "
  206.   Print "since the gray shades  in   monochrome "
  207.   Print "do not look pretty good.               "
  208.   Print "                                       "
  209.   Print "                                       "
  210.   Print "Press a key, please                    "
  211.   L=Gemdos(7)
  212.   Print At(1,3);
  213.   Print "A   picture calculation can be stopped "
  214.   Print "at any time by pressing a mousebutton. "
  215.   Print "                                       "
  216.   Print "                                       "
  217.   Print "The  program    is    completely menu  "
  218.   Print "controlled.                            "
  219.   Print "                                       "
  220.   Print "============= M E N U ================="
  221.   Print "                                       "
  222.   Print " Param :                               "
  223.   Print "                                       "
  224.   Print "Under Param one can enter the parameter"
  225.   Print "necessary for the  calculations  of  a "
  226.   Print "picture, either by hand or by standard "
  227.   Print "default. Standard parameters  are  set "
  228.   Print "automatically  at  the  start  of  the "
  229.   Print "program.To manually enter  the  values "
  230.   Print "one   has  to  deselect  the  Standard "
  231.   Print "Parameter entry.                       "
  232.   Print "                                       "
  233.   Print "Press a key please.                    "
  234.   L=Gemdos(7)
  235.   Print At(1,3);
  236.   Print " Go:                                   "
  237.   Print "                                       "
  238.   Print "Under Go  are  the  commands  to  work "
  239.   Print "the picture.                           "
  240.   Print "START begins  a  new picture according "
  241.   Print "to the selected parameters.            "
  242.   Print "                                       "
  243.   Print "REDRAW AREA  allows the  selection  of "
  244.   Print "a picture area, which is then  redrawn "
  245.   Print "according to  Step,Limit  and Maxiterat"
  246.   Print "values.                                "
  247.   Print "                                       "
  248.   Print "ENLARGE AREA allows the  selection  of "
  249.   Print "a picture area, which is then drawn in "
  250.   Print "full screen size.                      "
  251.   Print "                                       "
  252.   Print "                                       "
  253.   Print "                                       "
  254.   Print "                                       "
  255.   Print "                                       "
  256.   Print "Press a key please.                    "
  257.   L=Gemdos(7)
  258.   Print At(1,3);
  259.   Print "Watch out that  you  set  the  correct "
  260.   Print "parameters, especially the STEP X  and "
  261.   Print "STEP Y values, BEFOR you redraw or en- "
  262.   Print "large an area, as the program directly "
  263.   Print "starts with the drawing  without  any  "
  264.   Print "request for parameter changes.         "
  265.   Print "                                       "
  266.   Print "CHOOSE JULIA CONSTANT   allows     the "
  267.   Print "selection of a point of a Madelbrot Set"
  268.   Print "This   point  is  then  taken  as  the "
  269.   Print "complex   constant  for  a  Julia  Set "
  270.   Print "                                       "
  271.   Print "For every point  of a  Mandelbrot  Set "
  272.   Print "there  is  a  Julia  Set.  Interesting "
  273.   Print "Julia Sets are  produced  with  points "
  274.   Print "at the borders of a Madelbrot Set.     "
  275.   Print "                                       "
  276.   Print "Remember  here  as  well  to  set  the "
  277.   Print "correct  parameter.  A hint:  set  the "
  278.   Print "program to  Standard Parameter.        "
  279.   Print "                                       "
  280.   Print "Press a key please.                    "
  281.   L=Gemdos(7)
  282.   Print At(1,3);
  283.   Print "FILES:                                 "
  284.   Print "                                       "
  285.   Print "LOAD / SAVE PICTURE     loads / saves  "
  286.   Print "a  low  res  picture  in  uncompressed "
  287.   Print "Degas-Format, a  monochrome picture in "
  288.   Print "screenformat. Screenformat can be read "
  289.   Print "with STAD.                             "
  290.   Print "                                       "
  291.   Print "During loading the current picture  in "
  292.   Print "memory will be overwritten.            "
  293.   Print "                                       "
  294.   Print "It is to note, that ONLY  the  picture "
  295.   Print "will be loaded or saved, and  NOT  the "
  296.   Print "corresponding parameters !             "
  297.   Print "                                       "
  298.   Print "The parameters have to be saved/loaded "
  299.   Print "using the SAVE / LOAD DATA commands.   "
  300.   Print "The current data in memory  is  over - "
  301.   Print "written during loading !               "
  302.   Print "                                       "
  303.   Print "                                       "
  304.   Print "Press a key please.                    "
  305.   L=Gemdos(7)
  306.   Print At(1,3);
  307.   Print "NEXT / LAST PICTURE                    "
  308.   Print "                                       "
  309.   Print "Every picture and its data is  intern- "
  310.   Print "ally saved after  every  operation  or "
  311.   Print "a mouse break.                         "
  312.   Print "                                       "
  313.   Print "Using  'Next / last picture'  one  can "
  314.   Print "get those saved pictures back onto the "
  315.   Print "screen.                                "
  316.   Print "                                       "
  317.   Print "This is especially  intended  for  the "
  318.   Print "event that one wants to get back to the"
  319.   Print "original picture after an enlargement  "
  320.   Print "or  julia  constant  choice  does  not "
  321.   Print "please.                                "
  322.   Print "                                       "
  323.   Print "                                       "
  324.   Print "                                       "
  325.   Print "                                       "
  326.   Print "                                       "
  327.   Print "Press a key please.                    "
  328.   Print "                                       "
  329.   L=Gemdos(7)
  330.   Print At(1,3);
  331.   Print "                                       "
  332.   Print "                                       "
  333.   Print "                                       "
  334.   Print "                                       "
  335.   Print "                                       "
  336.   Print "                                       "
  337.   Print "        !!!! WARNING !!!!              "
  338.   Print "                                       "
  339.   Print "If a new enlargement  or  julia  point "
  340.   Print "selection is made after  returning  to "
  341.   Print "the  original  picture,  the  previous "
  342.   Print "enlargement or julia selection is over-"
  343.   Print "written !!!!!                          "
  344.   Print "                                       "
  345.   Print "The program can only store 50 pictutes."
  346.   Print "When the last picture is reached, any  "
  347.   Print "new picture will overwrite the old one."
  348.   Print "When the 2nd last picture is reached,a "
  349.   Print "warning will be given.                 "
  350.   Print "                                       "
  351.   Print "Press a key please.                    "
  352.   Print "                                       "
  353.   L=Gemdos(7)
  354.   Print At(1,3);
  355.   Print "This program is Public Domain.         "
  356.   Print "It may be freely copied but  NOT  sold "
  357.   Print "provided this text remains unchanged,  "
  358.   Print "except for additions about improvements"
  359.   Print "                                       "
  360.   Print "                                       "
  361.   Print " (C) 27.01.1992 Michael Jueschke       "
  362.   Print "                Perth                  "
  363.   Print "                West Australien        "
  364.   Print "                                       "
  365.   Print "Thanks to  Maik Zielinsky              "
  366.   Print "           Wipperfuerth-Kreuzberg      "
  367.   Print "                                       "
  368.   Print "      and  Andreas Ernst               "
  369.   Print "           Perth                       "
  370.   Print "                                       "
  371.   Print "                                       "
  372.   Print "                                       "
  373.   Print "Press a key please.                    "
  374.   L=Gemdos(7)
  375.   Sput Val$(Dat)     ! Write picture in the array at position dat to screen
  376.   @Showmenu
  377. Return
  378. '
  379. Procedure Initparameters
  380.   If Julia Then
  381.     Oben=1           !These four mean Top,Bottom,Left,Right
  382.     Unten=-1
  383.     Links=-1.5
  384.     Rechts=1.5
  385.   Else
  386.     Oben=1.2
  387.     Unten=-1.2
  388.     Links=-0.5
  389.     Rechts=2.1
  390.   Endif
  391.   Grenze%=4        ! limit
  392.   Maxiterat%=100
  393.   If Rez%=2 Then
  394.     Stepx%=5
  395.     Stepy%=5
  396.   Else
  397.     Stepx%=3
  398.     Stepy%=3
  399.   Endif
  400. Return
  401. '
  402. Procedure Emptymouse  ! get rid off previous mousebutton presses.
  403.   While C%<>0
  404.     Mouse Xm%,Ym%,C%
  405.   Wend
  406. Return
  407. '
  408. Procedure Calculatejulia
  409.   X=Xwert%*Rminl+Links      !Xwert , Ywert are the running screen coords
  410.   Y=Oben-Ywert%*Ominu       ! X,Y are the complex coords
  411.   Repeat
  412.     Inc Iterat%
  413.     Xhoch2=X*X
  414.     Yhoch2=Y*Y
  415.     Wegho2=Xhoch2+Yhoch2
  416.     Y=2*X*Y-Cimag
  417.     X=Xhoch2-Yhoch2-Creell
  418.     Mouse Xm%,Ym%,C%
  419.   Until (Iterat%=Maxiterat%) Or (Wegho2>Grenze%) Or C%=1
  420. Return
  421. '
  422. Procedure Calculatemandel
  423.   X=0
  424.   Y=0
  425.   Cre=Xwert%*Rminl+Links
  426.   Cim=Oben-Ywert%*Ominu
  427.   Repeat
  428.     Inc Iterat%
  429.     Xhoch2=X*X
  430.     Yhoch2=Y*Y
  431.     Wegho2=Xhoch2+Yhoch2
  432.     Y=2*X*Y-Cim
  433.     X=Xhoch2-Yhoch2-Cre
  434.     Mouse Xm%,Ym%,C%
  435.   Until (Iterat%=Maxiterat%) Or (Wegho2>Grenze%) Or C%=1
  436. Return
  437. '
  438. Procedure Steprate      ! Used to create pixel gray shades
  439.   Dl%=(Iterat% Mod 15)  ! It sets a value and only plots a point when
  440.   Dl%=Abs(Dl%)          ! the value has reached 0 and the then current
  441.   If Dl%>=0 And Dl%<3 Then  ! point is black.
  442.     Ste%=3                  ! ( the looping and plotting is actually done
  443.   Else                      !   in a different procedure, here the ste%
  444.     If Dl%>=3 And Dl%<4 Then !  is only set to a value )
  445.       Ste%=4
  446.     Else
  447.       If Dl%>=4 And Dl%<5 Then
  448.         Ste%=2
  449.       Else
  450.         If Dl%>=5 And Dl%<6 Then
  451.           Ste%=4
  452.         Else
  453.           If Dl%>=6 And Dl%<8 Then
  454.             Ste%=2
  455.           Else
  456.             If Dl%>=8 And Dl%<9 Then
  457.               Ste%=4
  458.             Else
  459.               If Dl%>=9 And Dl%<11 Then
  460.                 Ste%=3
  461.               Endif
  462.             Endif
  463.           Endif
  464.         Endif
  465.       Endif
  466.     Endif
  467.   Endif
  468. Return
  469. '
  470. Procedure Stepstepon20  ! Calculates and plots a highres block picture
  471.   Repeat                ! without symetry (either Mandel or Julia)
  472.     Xwert%=Xstart%
  473.     Repeat
  474.       Iterat%=0
  475.       Wegho2%=0
  476.       If Julia Then
  477.         @Calculatejulia
  478.       Else
  479.         @Calculatemandel
  480.       Endif
  481.       If Iterat%=Maxiterat% Then
  482.         Deffill 1,1
  483.       Else
  484.         If Grau Then
  485.           Deffill 1,2,(Iterat% Mod 15)+8
  486.         Else
  487.           Deffill 0,1
  488.         Endif
  489.       Endif
  490.       Pbox Xwert%,Ywert%,Xwert%+Stepx%,Ywert%+Stepy%
  491.       Add Xwert%,Stepx%
  492.     Until Xwert%>=Xvalue% Or C%=1  ! Xvalue, Yvalue are the right,bottom
  493.     Add Ywert%,Stepy%              ! limits of the drawing area.
  494.   Until Ywert%>=Yvalue% Or C%=1
  495. Return
  496. '
  497. Procedure Stepstepon21  ! Highres block picture for Julia set with
  498.   Repeat                ! point symetry about the origin
  499.     Xwert%=Xstart%
  500.     Repeat
  501.       Iterat%=0
  502.       Wegho2%=0
  503.       @Calculatejulia
  504.       Xx%=Xvalue%-Xwert%
  505.       Yy%=2*Yvalue%-Ywert%
  506.       If Iterat%=Maxiterat% Then
  507.         Deffill 1,1
  508.       Else
  509.         If Grau Then
  510.           Deffill 1,2,(Iterat% Mod 15)+8
  511.         Else
  512.           Deffill 0,1
  513.         Endif
  514.       Endif
  515.       Pbox Xwert%,Ywert%,Xwert%+Stepx%,Ywert%+Stepy%
  516.       Pbox Xx%,Yy%,Xx%-Stepx%,Yy%-Stepy%
  517.       Add Xwert%,Stepx%
  518.     Until Xwert%>=Xvalue% Or C%=1
  519.     Add Ywert%,Stepy%
  520.   Until Ywert%>=Yvalue% Or C%=1
  521. Return
  522. '
  523. Procedure Stepstepon22  ! Mandel highres block picture with line symetry
  524.   Repeat                ! about the real ( x ) axis.
  525.     Xwert%=Xstart%
  526.     Repeat
  527.       Iterat%=0
  528.       Wegho2%=0
  529.       @Calculatemandel
  530.       Yy%=2*Yvalue%-Ywert%
  531.       If Iterat%=Maxiterat% Then
  532.         Deffill 1,1
  533.       Else
  534.         If Grau Then
  535.           Deffill 1,2,(Iterat% Mod 15)+8
  536.         Else
  537.           Deffill 0,1
  538.         Endif
  539.       Endif
  540.       Pbox Xwert%,Ywert%,Xwert%+Stepx%,Ywert%+Stepy%
  541.       Pbox Xwert%,Yy%,Xwert%+Stepx%,Yy%-Stepy%
  542.       Add Xwert%,Stepx%
  543.     Until Xwert%>=Xvalue% Or C%=1
  544.     Add Ywert%,Stepy%
  545.   Until Ywert%>=Yvalue% Or C%=1
  546. Return
  547. '
  548. Procedure Nostep20     ! Nosteps are the same as StepSteps exept that they
  549.   Repeat               ! draw in single pixelel.
  550.     Xwert%=Xstart%     ! The numbers indicate the resolution and the type
  551.     Repeat             ! of symetry, eg 20 -- highres, no sym
  552.       Iterat%=0        !                02 -- lowres , line sym
  553.       Wegho2%=0
  554.       If Julia Then
  555.         @Calculatejulia
  556.       Else
  557.         @Calculatemandel
  558.       Endif
  559.       If Iterat%=Maxiterat% Then
  560.         Color 1
  561.         Plot Xwert%,Ywert%
  562.         Color 0
  563.       Else
  564.         If Grau Then
  565.           If Ste%=0 Then
  566.             @Steprate
  567.             Color 1
  568.           Else
  569.             Color 0
  570.             Sub Ste%,1
  571.           Endif
  572.           Plot Xwert%,Ywert%
  573.         Endif
  574.       Endif
  575.       Add Xwert%,Stepx%
  576.     Until Xwert%-1>=Xvalue% Or C%=1
  577.     Add Ywert%,Stepy%
  578.   Until Ywert%-1>=Yvalue% Or C%=1
  579. Return
  580. '
  581. Procedure Nostep21
  582.   Repeat
  583.     Xwert%=Xstart%
  584.     Repeat
  585.       Iterat%=0
  586.       Wegho2%=0
  587.       @Calculatejulia
  588.       Xx%=Xvalue%-Xwert%
  589.       Yy%=2*Yvalue%-Ywert%
  590.       If Iterat%=Maxiterat% Then
  591.         Color 1
  592.         Plot Xwert%,Ywert%
  593.         Plot Xx%-Xwert%,Yy%
  594.         Color 0
  595.       Else
  596.         If Grau Then
  597.           If Ste%=0 Then
  598.             @Steprate
  599.             Color 1
  600.           Else
  601.             Color 0
  602.             Sub Ste%,1
  603.           Endif
  604.           Plot Xwert%,Ywert%
  605.           Plot Xx%-Xwert%,Yy%
  606.         Endif
  607.       Endif
  608.       Add Xwert%,Stepx%
  609.     Until Xwert%-1>=Xvalue% Or C%=1
  610.     Add Ywert%,Stepy%
  611.   Until Ywert%-1>=Yvalue% Or C%=1
  612. Return
  613. '
  614. Procedure Nostep22
  615.   Repeat
  616.     Xwert%=Xstart%
  617.     Repeat
  618.       Iterat%=0
  619.       Wegho2%=0
  620.       @Calculatemandel
  621.       Yy%=2*Yvalue%-Ywert%
  622.       If Iterat%=Maxiterat% Then
  623.         Color 1
  624.         Plot Xwert%,Ywert%
  625.         Plot Xwert%,Yy%
  626.         Color 0
  627.       Else
  628.         If Grau Then
  629.           If Ste%=0 Then
  630.             @Steprate
  631.             Color 1
  632.           Else
  633.             Color 0
  634.             Sub Ste%,1
  635.           Endif
  636.           Plot Xwert%,Ywert%
  637.           Plot Xwert%,Yy%
  638.         Endif
  639.       Endif
  640.       Add Xwert%,Stepx%
  641.     Until Xwert%-1>=Xvalue% Or C%=1
  642.     Add Ywert%,Stepy%
  643.   Until Ywert%-1>=Yvalue% Or C%=1
  644. Return
  645. '
  646. Procedure Stepstepon00  ! low res, no sym, blocks
  647.   Repeat
  648.     Xwert%=Xstart%
  649.     Repeat
  650.       Iterat%=0
  651.       Wegho2=0
  652.       If Julia Then
  653.         @Calculatejulia
  654.       Else
  655.         @Calculatemandel
  656.       Endif
  657.       If Iterat%=Maxiterat% Then
  658.         Deffill 1
  659.       Else
  660.         Deffill (Iterat% Mod 15)+2
  661.       Endif
  662.       Pbox Xwert%,Ywert%,Xwert%+Stepx%,Ywert%+Stepy%
  663.       Add Xwert%,Stepx%
  664.     Until Xwert%>=Xvalue% Or C%=1
  665.     Add Ywert%,Stepy%
  666.   Until Ywert%>=Yvalue% Or C%=1
  667. Return
  668. '
  669. Procedure Stepstepon01
  670.   Repeat
  671.     Xwert%=Xstart%
  672.     Repeat
  673.       Iterat%=0
  674.       Wegho2=0
  675.       @Calculatejulia
  676.       If Iterat%=Maxiterat% Then
  677.         Deffill 1
  678.       Else
  679.         Deffill (Iterat% Mod 15)+2
  680.       Endif
  681.       Yy%=2*Yvalue%-Ywert%
  682.       Xx%=Xvalue%-Xwert%
  683.       Pbox Xwert%,Ywert%,Xwert%+Stepx%,Ywert%+Stepy%
  684.       Pbox Xx%,Yy%,Xx%-Stepx%,Yy%-Stepy%
  685.       Add Xwert%,Stepx%
  686.     Until Xwert%>=Xvalue% Or C%=1
  687.     Add Ywert%,Stepy%
  688.   Until Ywert%>=Yvalue% Or C%=1
  689. Return
  690. '
  691. Procedure Stepstepon02
  692.   Repeat
  693.     Xwert%=Xstart%
  694.     Repeat
  695.       Iterat%=0
  696.       Wegho2=0
  697.       @Calculatemandel
  698.       If Iterat%=Maxiterat% Then
  699.         Deffill 1
  700.       Else
  701.         Deffill (Iterat% Mod 15)+2
  702.       Endif
  703.       Yy%=2*Yvalue%-Ywert%
  704.       Pbox Xwert%,Ywert%,Xwert%+Stepx%,Ywert%+Stepy%
  705.       Pbox Xwert%,Yy%,Xwert%+Stepx%,Yy%-Stepy%
  706.       Add Xwert%,Stepx%
  707.     Until Xwert%>=Xvalue% Or C%=1
  708.     Add Ywert%,Stepy%
  709.   Until Ywert%>=Yvalue% Or C%=1
  710. Return
  711. '
  712. Procedure Nostep00  ! low res, no sym, pixels
  713.   Repeat
  714.     Xwert%=Xstart%
  715.     Repeat
  716.       Iterat%=0
  717.       Wegho2=0
  718.       If Julia Then
  719.         @Calculatejulia
  720.       Else
  721.         @Calculatemandel
  722.       Endif
  723.       If Iterat%=Maxiterat% Then
  724.         Color 1
  725.       Else
  726.         Color (Iterat% Mod 15)+2
  727.       Endif
  728.       Plot Xwert%,Ywert%
  729.       Add Xwert%,Stepx%
  730.     Until Xwert%-1>=Xvalue% Or C%=1
  731.     Add Ywert%,Stepy%
  732.   Until Ywert%-1>=Yvalue% Or C%=1
  733. Return
  734. '
  735. Procedure Nostep01
  736.   Repeat
  737.     Xwert%=Xstart%
  738.     Repeat
  739.       Iterat%=0
  740.       Wegho2=0
  741.       @Calculatejulia
  742.       If Iterat%=Maxiterat% Then
  743.         Color 1
  744.       Else
  745.         Color (Iterat% Mod 15)+2
  746.       Endif
  747.       Yy%=2*Yvalue%-Ywert%
  748.       Xx%=Xvalue%
  749.       Plot Xwert%,Ywert%
  750.       Plot Xx%-Xwert%,Yy%
  751.       Add Xwert%,Stepx%
  752.     Until Xwert%-1>=Xvalue% Or C%=1
  753.     Add Ywert%,Stepy%
  754.   Until Ywert%-1>=Yvalue% Or C%=1
  755. Return
  756. '
  757. Procedure Nostep02
  758.   Repeat
  759.     Xwert%=Xstart%
  760.     Repeat
  761.       Iterat%=0
  762.       Wegho2=0
  763.       @Calculatemandel
  764.       If Iterat%=Maxiterat% Then
  765.         Color 1
  766.       Else
  767.         Color (Iterat% Mod 15)+2
  768.       Endif
  769.       Yy%=2*Yvalue%-Ywert%
  770.       Plot Xwert%,Ywert%
  771.       Plot Xwert%,Yy%
  772.       Add Xwert%,Stepx%
  773.     Until Xwert%-1>=Xvalue% Or C%=1
  774.     Add Ywert%,Stepy%
  775.   Until Ywert%-1>=Yvalue% Or C%=1
  776. Return
  777. '
  778. Procedure Highres     ! Called when in highres. Selects drawing proc
  779.   If Stepstep% Then   ! according to symetry and step size.
  780.     If Isym%=0 Then   ! StepStep   -- means steps > 1 = blocks
  781.       @Stepstepon20   ! Isym -- type of symetry.
  782.     Else
  783.       If Isym%=1 Then
  784.         @Stepstepon21
  785.       Else
  786.         @Stepstepon22
  787.       Endif
  788.     Endif
  789.   Else
  790.     If Isym%=0 Then
  791.       @Nostep20
  792.     Else
  793.       If Isym%=1 Then
  794.         @Nostep21
  795.       Else
  796.         @Nostep22
  797.       Endif
  798.     Endif
  799.   Endif
  800. Return
  801. '
  802. Procedure Nothighres   ! NotHighRes ---- as Highres but for low res
  803.   If Stepstep% Then
  804.     If Isym%=0 Then
  805.       @Stepstepon00
  806.     Else
  807.       If Isym%=1 Then
  808.         @Stepstepon01
  809.       Else
  810.         @Stepstepon02
  811.       Endif
  812.     Endif
  813.   Else
  814.     If Isym%=0 Then
  815.       @Nostep00
  816.     Else
  817.       If Isym%=1 Then
  818.         @Nostep01
  819.       Else
  820.         @Nostep02
  821.       Endif
  822.     Endif
  823.   Endif
  824. Return
  825. '
  826. Procedure Running   ! Main procedure. Determines symetry and resolution
  827.   Hidem             ! Calls Highres or Nothighres
  828.   @Emptymouse
  829.   If Julia Then
  830.     If Links+Rechts=0 And Oben+Unten=0 And Nosymetry=0 Then
  831.       Isym%=1
  832.       Div Yvalue%,2
  833.     Else
  834.       Isym%=0
  835.     Endif
  836.   Else
  837.     If Oben+Unten=0 And Nosymetry=0 Then
  838.       Isym%=2
  839.       Div Yvalue%,2
  840.     Else
  841.       Isym%=0
  842.     Endif
  843.   Endif
  844.   Ywert%=Ystart%
  845.   Stepstep%=((Stepx%<>1) And (Stepy%<>1))
  846.   If Rez%=2 Then
  847.     Color 1
  848.     @Highres
  849.   Else
  850.     @Nothighres
  851.   Endif
  852.   Showm
  853. Return
  854. '
  855. Procedure Takedata  ! Saves data of current picture into array Val
  856.   If Dat>=Lim Then  ! at position Dat
  857.     Alert 1,"Memory limit reached.|Next picture overwrites old one!|",1," Sorry ",Btn%
  858.   Endif
  859.   If Dat<=Lim Then
  860.     If Dat=Maxdat Then  ! Maxdat <> lim . Maxdat is last entry in array
  861.       Add Maxdat,1      ! Lim is the limit size of the array
  862.     Endif
  863.   Endif
  864.   Add Dat,1
  865.   Sget Val$(Dat)
  866.   Val(Dat,1)=Julia
  867.   Val(Dat,2)=Oben
  868.   Val(Dat,3)=Unten
  869.   Val(Dat,4)=Links
  870.   Val(Dat,5)=Rechts
  871.   Val(Dat,6)=Maxiterat%
  872.   Val(Dat,7)=Grenze%
  873.   Val(Dat,8)=Creell
  874.   Val(Dat,9)=Cimag
  875.   Val(Dat,10)=Stepx%
  876.   Val(Dat,11)=Stepy%
  877. Return
  878. '
  879. Procedure Dragbox(Xs%,Ys%,X%,Y%)
  880.   Color 1
  881.   Graphmode 3
  882.   Box Xs%,Ys%,X%,Y%
  883.   Box Xs%,Ys%,X%,Y%
  884.   Graphmode 0
  885. Return
  886. '
  887. Procedure Getclicks   ! Waits for mouse click to mark top left dragbox
  888.   @Emptymouse         ! corner. Then adjusts size of the box and waits
  889.   Showm               ! for the click to mark the bottom right corner
  890.   Repeat
  891.     Mouse Xm%,Ym%,C%
  892.   Until C%<>0
  893.   Mx%=Xm%
  894.   My%=Ym%
  895.   @Emptymouse
  896.   Repeat
  897.     Mouse Xm%,Ym%,C%
  898.     @Dragbox(Mx%,My%,Xm%,Ym%)
  899.   Until C%<>0
  900.   Hidem
  901.   Sput Val$(Dat)
  902.   Nosymetry=1     ! when a box is chosen, any symetry in the original data
  903. Return            ! is overridden by this, as the box is unlikely to be
  904. '                 ! symetric.
  905. Procedure Redraw
  906.   Menu Off        ! redraw section with new values for steps and/or
  907.   Sput Val$(Dat)  ! maxiterat.
  908.   Inpar=False
  909.   @Enablemanual
  910.   @Getclicks
  911.   Xvalue%=Xm%   ! set corners to mousepositions from Getclicks
  912.   Yvalue%=Ym%
  913.   Xstart%=Mx%
  914.   Ystart%=My%
  915.   Deffill 1,1
  916.   Pbox Mx%,My%,Xm%-1,Ym%-1  ! Clear section (only necessary for highres
  917.   Graphmode 3               ! but used in low anyway)
  918.   Pbox Mx%-1,My%-1,Xm%,Ym%
  919.   Graphmode 0
  920.   Sub Dat,1        ! reduce index to update existing picture in memory
  921.   @Running         ! and not to create a new picture. Also updates the
  922.   @Takedata        ! data set.
  923.   @Showmenu
  924. Return
  925. '
  926. Procedure Fulldraw ! Redraws a section in full screen size (enlarge)
  927.   Menu Off
  928.   Sput Val$(Dat)
  929.   Inpar=False
  930.   @Enablemanual
  931.   @Getclicks
  932.   Xstart%=0
  933.   Ystart%=0
  934.   @Setxandy
  935.   O=Oben
  936.   L=Links
  937.   Oben=O-My%*(O-Unten)*(1/Yvalue%)
  938.   Unten=O-Ym%*(O-Unten)*(1/Yvalue%)
  939.   Links=L+Mx%*(Rechts-L)*(1/Xvalue%)
  940.   Rechts=L+Xm%*(Rechts-L)*(1/Xvalue%)
  941.   @Calcvars
  942.   @Emptymouse
  943.   Cls
  944.   @Running
  945.   @Takedata    ! Does not update existing picture, but creates new entries
  946.   @Showmenu
  947. Return
  948. '
  949. Procedure Drawjulia  ! Sets program values to julia set, changes menu
  950.   Menu Off           ! settings
  951.   Sput Val$(Dat)
  952.   @Emptymouse
  953.   Menu Mmandelbrot,0
  954.   Menu Mjuliaset,1
  955.   Menu Mjuliakonst,2
  956.   Menu Mstandpar,1
  957.   Inpar=True
  958.   Julia=True
  959.   Showm
  960.   Repeat               ! I just noticed that this loop is an 'Emptymouse'
  961.     Mouse Xm%,Ym%,C%
  962.   Until C%<>0
  963.   Creell=Xm%*Rminl+Links
  964.   Cimag=Oben-Ym%*Ominu
  965.   @Initparameters
  966.   @Initvalues
  967.   @Setxandy
  968.   @Calcvars
  969.   @Emptymouse
  970.   Nosymetry=0
  971.   Hidem
  972.   Cls
  973.   @Running
  974.   @Takedata
  975.   @Showmenu
  976. Return
  977. '
  978. Procedure Readdata   ! Read current array entries in as current variables
  979.   Julia=Val(Dat,1)
  980.   Oben=Val(Dat,2)
  981.   Unten=Val(Dat,3)
  982.   Links=Val(Dat,4)
  983.   Rechts=Val(Dat,5)
  984.   Maxiterat%=Val(Dat,6)
  985.   Grenze%=Val(Dat,7)
  986.   Creell=Val(Dat,8)
  987.   Cimag=Val(Dat,9)
  988.   Stepx%=Val(Dat,10)
  989.   Stepy%=Val(Dat,11)
  990.   @Initvalues
  991.   @Setxandy
  992.   @Calcvars
  993. Return
  994. '
  995. Procedure Loaddata
  996.   Menu Off
  997.   Fileselect Chr$(Gemdos(25)+65)+":\*.cao","",File$
  998.   If File$<>"" Then
  999.     Open "I",#1,File$
  1000.     For A=1 To 11
  1001.       Input #1,Val(Dat,A)
  1002.     Next A
  1003.     Close #1
  1004.   Endif
  1005.   Inpar=False
  1006.   @Readdata
  1007.   Start=True
  1008.   @Showmenu
  1009. Return
  1010. '
  1011. Procedure Savedata
  1012.   Menu Off
  1013.   Fileselect Chr$(Gemdos(25)+65)+":\*.cao","",File$
  1014.   If File$<>"" Then
  1015.     Open "O",#1,File$
  1016.     For A=1 To 11
  1017.       Print #1,Val(Dat,A)
  1018.     Next A
  1019.     Close #1
  1020.   Endif
  1021. Return
  1022. '
  1023. Procedure Lastpicture  ! Go back a picture (and hence go back a data set)
  1024.   Menu Off
  1025.   If Dat>1 Then
  1026.     Sub Dat,1
  1027.     @Readdata
  1028.     Sput Val$(Dat)
  1029.     @Showmenu
  1030.   Else
  1031.     Alert 1,"This is the first picture.|",1," Aha ",Bt%
  1032.   Endif
  1033. Return
  1034. '
  1035. Procedure Nextpicture ! go forward
  1036.   Menu Off
  1037.   If Dat<Maxdat Then
  1038.     Add Dat,1
  1039.     @Readdata
  1040.     Sput Val$(Dat)
  1041.     @Showmenu
  1042.   Else
  1043.     Alert 1,"This is the last picture.|",1," Aha ",Bt%
  1044.   Endif
  1045. Return
  1046. '
  1047. Procedure Loadpicture
  1048.   Menu Off
  1049.   If Rez%=0 Then
  1050.     Fileselect Chr$(Gemdos(25)+65)+":\*.PI1","",File$
  1051.     If File$<>"" Then
  1052.       Bload File$,Xbios(3)-34
  1053.     Endif
  1054.   Else
  1055.     Fileselect Chr$(Gemdos(25)+65)+":\*.PIC","",File$
  1056.     If File$<>"" Then
  1057.       Bload File$,Xbios(2)
  1058.     Endif
  1059.   Endif
  1060.   Sget Val$(Dat)
  1061.   @Showmenu
  1062. Return
  1063. '
  1064. Procedure Savepicture
  1065.   Menu Off
  1066.   If Rez%=0 Then
  1067.     Fileselect Chr$(Gemdos(25)+65)+":\*.PI1","",File$
  1068.     If File$<>"" Then
  1069.       Sput Val$(Dat)
  1070.       Bsave File$,Xbios(3)-34,32066
  1071.     Endif
  1072.   Else
  1073.     Fileselect Chr$(Gemdos(25)+65)+":\*.PIC","",File$
  1074.     If File$<>"" Then
  1075.       Sput Val$(Dat)
  1076.       Bsave File$,Xbios(2),32000
  1077.     Endif
  1078.   Endif
  1079.   @Showmenu
  1080. Return
  1081. '
  1082. Procedure Finish
  1083.   Menu Off
  1084.   Alert 1," Abbort program ? | Has the picture been saved ?|",2," Exit | Back | Save ",Btn%
  1085.   If Btn%=1 Then
  1086.     Menu Kill
  1087.     End
  1088.   Else
  1089.     If Btn%=3 Then
  1090.       @Savepicture
  1091.     Endif
  1092.   Endif
  1093. Return
  1094. '
  1095. Procedure Inputcoords
  1096.   Menu Off
  1097.   Print At(1,3);"Top  ";Oben;" : ";
  1098.   Input Oben
  1099.   Print "Bottom ";Unten;" : ";
  1100.   Input Unten
  1101.   Print "Left  ";Links;" : ";
  1102.   Input Links
  1103.   Print "Right  ";Rechts;" : ";
  1104.   Input Rechts
  1105.   Sput Val$(Dat)  ! Restore picture as it was before writing all over it
  1106. Return
  1107. '
  1108. Procedure Inputgrenze
  1109.   Menu Off
  1110.   Print At(1,3);"Limit  ";Grenze%;" : ";
  1111.   Input Grenze%
  1112.   Sput Val$(Dat)
  1113. Return
  1114. '
  1115. Procedure Inputmaxiterat
  1116.   Menu Off
  1117.   Print At(1,3);"Maxiterat ";Maxiterat%;" : ";
  1118.   Input Maxiterat%
  1119.   Sput Val$(Dat)
  1120. Return
  1121. '
  1122. Procedure Inputcreell
  1123.   Menu Off
  1124.   Print At(1,3);"CReal  ";Creell;" : ";
  1125.   Input Creel
  1126.   Sput Val$(Dat)
  1127. Return
  1128. '
  1129. Procedure Inputcimg
  1130.   Menu Off
  1131.   Print At(1,3);"CImag ";Cimag;" : ";
  1132.   Input Cimag
  1133.   Sput Val$(Dat)
  1134. Return
  1135. '
  1136. Procedure Inputstep
  1137.   Menu Off
  1138.   Print At(1,3);"Step X ";Stepx%;" : ";
  1139.   Input Stepx%
  1140.   Print "Step Y ";Stepy%;" : ";
  1141.   Input Stepy%
  1142.   Sput Val$(Dat)
  1143. Return
  1144. '
  1145. Procedure Printvalues
  1146.   Menu Off
  1147.   If Bios(8,0)=-1 Then
  1148.     If Julia Then
  1149.       Lprint "Julia Set"
  1150.       Lprint
  1151.       @Printconstants
  1152.     Else
  1153.       Lprint "Mandelbrot Set"
  1154.       Lprint
  1155.     Endif
  1156.     Lprint "TOP       ";Oben
  1157.     Lprint "BOTTOM    ";Unten
  1158.     Lprint "LEFT      ";Links
  1159.     Lprint "RIGHT     ";Rechts
  1160.     Lprint "LIMIT     ";Grenze%
  1161.     Lprint "MAXITERAT ";Maxiterat%
  1162.     Lprint "STEP X    ";Stepx%
  1163.     Lprint "STEP Y    ";Stepy%
  1164.   Else
  1165.     Alert 1,"Printer is not ready !|",1," Ups ",Bt%
  1166.   Endif
  1167. Return
  1168. '
  1169. Procedure Printconstants
  1170.   Lprint "CImg      ";Cimag
  1171.   Lprint "CReal     ";Creell
  1172.   Lprint
  1173. Return
  1174. '
  1175. Procedure Listvalues
  1176.   Menu Off
  1177.   If Julia Then
  1178.     Print At(1,4);"Julia Set"
  1179.     Print
  1180.     @Listconstants
  1181.   Else
  1182.     Print At(1,4);"Mandelbrot Set"
  1183.     Print
  1184.   Endif
  1185.   Print "TOP       ";Oben
  1186.   Print "BOTTOM    ";Unten
  1187.   Print "LEFT      ";Links
  1188.   Print "RIGHT     ";Rechts
  1189.   Print "LIMIT     ";Grenze%
  1190.   Print "MAXITERAT ";Maxiterat%
  1191.   Print "STEP X    ";Stepx%
  1192.   Print "STEP Y    ";Stepy%
  1193.   Print
  1194.   Print "Press a key please."
  1195.   L=Gemdos(7)
  1196.   Sput Val$(Dat)
  1197.   @Showmenu
  1198. Return
  1199. '
  1200. Procedure Listconstants
  1201.   Print "CImg      ";Cimag
  1202.   Print "CReal     ";Creell
  1203.   Print
  1204. Return
  1205. '
  1206. Procedure Startup   ! Called when 'GO' is chosen in the menu.
  1207.   Menu Off          ! It initiallises all relevant data for a full
  1208.   Start=True        ! screen draw (mainly xstart,ystart,xvalue,yvalue)
  1209.   Index=1
  1210.   Cls
  1211.   '
  1212.   Nosymetry=0
  1213.   '
  1214.   @Initvalues
  1215.   @Setxandy
  1216.   @Calcvars
  1217.   @Running
  1218.   @Takedata
  1219.   Hidem
  1220.   @Showmenu
  1221.   Showm
  1222. Return
  1223. '
  1224. Procedure Menustuff   ! Select action
  1225.   If A$(Menu(0))=" Info            " Then
  1226.     @Introduction
  1227.   Endif
  1228.   If A$(Menu(0))="  Save Picture    " Then
  1229.     @Savepicture
  1230.   Endif
  1231.   If A$(Menu(0))="  Load Picture    " Then
  1232.     @Loadpicture
  1233.   Endif
  1234.   If A$(Menu(0))="  Save Data       " Then
  1235.     @Savedata
  1236.   Endif
  1237.   If A$(Menu(0))="  Load Data       " Then
  1238.     @Loaddata
  1239.   Endif
  1240.   If A$(Menu(0))="  Next Picture    " Then
  1241.     @Nextpicture
  1242.   Endif
  1243.   If A$(Menu(0))="  Last Picture    " Then
  1244.     @Lastpicture
  1245.   Endif
  1246.   If A$(Menu(0))="  Draw Mandel     " Then
  1247.     Julia=False
  1248.     If Inpar Then      ! if standard parameters are selected, initialise
  1249.       @Initparameters
  1250.     Endif
  1251.     Menu Off
  1252.     Menu Mmandelbrot,1
  1253.     Menu Mjuliaset,0
  1254.     Menu Mjuliakonst,3
  1255.   Endif
  1256.   If A$(Menu(0))="  Draw Julia      " Then
  1257.     Julia=True
  1258.     If Inpar Then
  1259.       @Initparameters
  1260.     Endif
  1261.     Menu Off
  1262.     Menu Mmandelbrot,0
  1263.     Menu Mjuliaset,1
  1264.     Menu Mjuliakonst,2
  1265.   Endif
  1266.   If A$(Menu(0))="  Coordinates"
  1267.     @Inputcoords
  1268.     Sub Dat,1      ! reduce index to update current values as
  1269.     @Takedata      ! Takedata does increase Dat by one before writing
  1270.     @Showmenu      ! values into the array
  1271.   Endif
  1272.   If A$(Menu(0))="  Step X, Step y     "
  1273.     @Inputstep
  1274.     Sub Dat,1
  1275.     @Takedata
  1276.     @Showmenu
  1277.   Endif
  1278.   If A$(Menu(0))="  Maxiterat          "
  1279.     @Inputmaxiterat
  1280.     Sub Dat,1
  1281.     @Takedata
  1282.     @Showmenu
  1283.   Endif
  1284.   If A$(Menu(0))="  Limit              "
  1285.     @Inputgrenze
  1286.     Sub Dat,1
  1287.     @Takedata
  1288.     @Showmenu
  1289.   Endif
  1290.   If A$(Menu(0))="  CReal              "
  1291.     @Inputcreell
  1292.     Sub Dat,1
  1293.     @Takedata
  1294.     @Showmenu
  1295.   Endif
  1296.   If A$(Menu(0))="  CImaginary         "
  1297.     @Inputcimg
  1298.     Sub Dat,1
  1299.     @Takedata
  1300.     @Showmenu
  1301.   Endif
  1302.   If A$(Menu(0))="  Standard Parameter "
  1303.     Menu Off
  1304.     If Inpar Then
  1305.       Inpar=False
  1306.       Menu Mstandpar,0
  1307.       @Enablemanual
  1308.     Else
  1309.       Inpar=True
  1310.       Menu Mstandpar,1
  1311.       @Disablemanual
  1312.       @Initparameters
  1313.     Endif
  1314.   Endif
  1315.   If A$(Menu(0))="  Show Parameters    " Then
  1316.     @Listvalues
  1317.   Endif
  1318.   If A$(Menu(0))="  Print Parameters   " Then
  1319.     @Printvalues
  1320.   Endif
  1321.   If A$(Menu(0))=" Start                 " Then
  1322.     @Startup
  1323.   Endif
  1324.   If A$(Menu(0))=" Redraw Area           " Then
  1325.     @Redraw
  1326.   Endif
  1327.   If A$(Menu(0))=" Enlarge Area          " Then
  1328.     @Fulldraw
  1329.   Endif
  1330.   If A$(Menu(0))=" Choose Julia-Constant " Then
  1331.     @Drawjulia
  1332.   Endif
  1333.   If A$(Menu(0))="  Show Grayshades " Then
  1334.     Menu Off
  1335.     If Grau Then
  1336.       Grau=False
  1337.       Menu Mgrau,0
  1338.     Else
  1339.       Grau=True
  1340.       Menu Mgrau,1
  1341.     Endif
  1342.   Endif
  1343.   If A$(Menu(0))=" Quit " Then
  1344.     @Finish
  1345.   Endif
  1346. Return
  1347. '
  1348. Procedure Menudefaults
  1349.   If Rez%<>2 Then
  1350.     Menu Mgrau,2    ! if not hi