home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 2: Collection B / 17Bit_Collection_B.iso / files / 1767.dms / in.adf / Generator / Generator.amosSourceCode < prev    next >
Encoding:
AMOS Source Code  |  1993-03-08  |  23.3 KB  |  876 lines

  1. On Error Goto HANDLE
  2. THE_START:
  3. Change Mouse 4
  4. Screen Open 0,320,256,2,Lowres : Curs Off 
  5. Rem This will check to see if 1 Meg or an ECS Agnus is available 
  6. MEG=(Chip Free+Fast Free)/1024
  7. If MEG<512
  8.    Screen Open 0,640,256,2,Hires : Curs Off 
  9.    Colour Back $357
  10.    Hide 
  11.    Palette $357,$FFF
  12.    Cls 0
  13.    Locate 0,10
  14.    Centre "Not Enough Free Memory"
  15.    TMP$="Only"+Str$(MEG)+"k Is Currently Available."
  16.    Print : Print : Centre TMP$
  17.    Locate 0,22 : Centre "If You Have Any Memory Expansion Or An ECS Agnus ( 1 Meg Chip Memory )"
  18.    Print : Centre "Disconnect All External Drives & Re-Boot."
  19.    Locate 0,14 : Print : Centre "Use The 512k Version Also Supplied On This Disk."
  20.    Locate 0,29 : Centre "Press Left Mouse Button To Exit"
  21.    Print : Centre "Or" : Print 
  22.    Centre " Right Mouse Button To Close Workbench & Try Again."
  23.    Repeat 
  24.       If Mouse Key=2
  25.          Bell 
  26.          Close Editor 
  27.          Close Workbench 
  28.          Goto THE_START
  29.       End If 
  30.    Until Mouse Key=1
  31.    Fade 2 : Wait 45
  32.    Show 
  33.    ABORT
  34. End If 
  35. Locate 0,0
  36. Screen Open 5,320,256,32,Lowres : Curs Off : Rem scratch pad
  37. Screen Open 2,704,310,16,Hires : Curs Off 
  38. Screen Display 2,112,40,,
  39. Palette $0,$0,$0
  40. Cls 0
  41. Y#=256.0
  42. X#=320.0
  43. _MODE=$0
  44. MAG#=100
  45. XMIN#=-2.25
  46. XMAX#=0.75
  47. YMIN#=-1.5
  48. YMAX#=1.5
  49. SCRX#=320.0
  50. SCRY#=256.0
  51. _MODE=0
  52. DEPTH=32
  53. LDED=False
  54. If LDED=True
  55.    Screen 2
  56.    Ink 0,, : Bar 0,200 To 704,256
  57.    Locate 0,29 : Centre "Graphics Loaded Into Work Areas"
  58. End If 
  59. If LDED=False
  60.    Screen 2
  61.    Ink 0,, : Bar 0,200 To 704,256
  62.    Locate 0,29 : Centre "No Graphics Loaded Into Work Areas"
  63. End If 
  64. K=31
  65. Global SCRX#,SCRY#,XMIN#,YMIN#,XMAX#,YMAX#,Y#,X#,MAG#,K,_MODE,SCX#,SCY#,DEPTH,LDED
  66. Colour Back 0
  67. MEN
  68. Limit Mouse 
  69. Do 
  70. Loop 
  71. Procedure CALCULATE
  72.    KOLOURS=K+1
  73.    SCX#=SCRX#
  74.    SCY#=SCRY#
  75.    XS#=X#
  76.    YS#=Y#
  77.    Screen Open 0,SCRX#,SCRY#,K+1,_MODE : Curs Off : Flash Off 
  78.    Cls 0
  79.    Screen Open 3,704,24,2,Hires : Curs Off 
  80.    Screen Display 3,112,275,,
  81.    Cls 0 : Palette $0,$FFF
  82.    TMP$="X min:"+Str$(XMIN#)+", X max:"+Str$(XMAX#)
  83.    TMP$=TMP$+", Y min:"+Str$(YMIN#)+", Y max:"+Str$(YMAX#)+", "+Str$(K+1)+" Colours"
  84.    Centre TMP$ : Print 
  85.    TMP$="Re-Iteration Level:"+Str$(MAG#)
  86.    Centre TMP$ : Print 
  87.    TMP$="Screen Size:"
  88.    TMP$=TMP$+Str$(SCRX#)+" x "+Str$(SCRY#)
  89.    If DEPTH=500
  90.       TMP$=TMP$+" Deep Scanning Mode Enabled"
  91.    End If 
  92.    Centre TMP$
  93.    Screen 0
  94.    Hide : Menu Off 
  95.    Y#=SCRY# : X#=SCRX#
  96.    H#=(XMAX#-XMIN#)/(SCRX#-1)
  97.    V#=(YMAX#-YMIN#)/(SCRY#-1)
  98.    LDED=True
  99.    For Q#=0.0 To SCRY#
  100.       For P#=0.0 To SCRX#
  101.          M#=XMIN#+P#*H#
  102.          N#=YMIN#+Q#*V#
  103.          C=0 : X#=0 : Y#=0
  104.          STP2:
  105.          W#=X#*X# : Y2#=Y#*Y# : R#=W#+Y2#
  106.          Y#=2*X#*Y#+N#
  107.          X#=W#-Y2#+M#
  108.          Inc C
  109.          If R#<MAG# and C<DEPTH-1
  110.             Goto STP2
  111.          End If 
  112.          XU=P# : YU=Q#
  113.          C=C and K
  114.          Ink C : Plot XU,YU
  115.          Bchg %1,$BFE001
  116.          If Mouse Key
  117.             Screen Open 4,640,20,2,Hires : Curs Off : Palette $0,$FFF
  118.             Screen Display 4,132,200,,
  119.             Input "Are You You Sure You Want To Abort ";AB$
  120.             If AB$="y"
  121.                Q#=SCRY#+1.0
  122.                P#=SCRX#+1.0
  123.                LDED=False
  124.             End If 
  125.             Screen Close 4
  126.             Screen 0
  127.          End If 
  128.       Next P#
  129.    Next Q#
  130.    Menu On 
  131.    If LDED=True
  132.       Screen 2
  133.       Ink 0,, : Bar 0,200 To 704,256
  134.       Locate 0,29 : Centre "Graphics Loaded Into Work Areas"
  135.    End If 
  136.    If LDED=False
  137.       Screen 2
  138.       Ink 0,, : Bar 0,200 To 704,256
  139.       Locate 0,29 : Centre "No Graphics Loaded Into Work Areas"
  140.    End If 
  141.    Screen To Front 2 : Screen 2
  142.    On Menu On 
  143.    Show 
  144.    SCRX#=SCX#
  145.    SCRY#=SCY#
  146.    Y#=YS#
  147.    X#=XS#
  148.    Screen Copy 0 To 5
  149. End Proc
  150. Procedure CALCULATEMINIBROT
  151.    KOLOURS=K+1
  152.    SCX#=SCRX#
  153.    SCY#=SCRY#
  154.    XS#=X#
  155.    YS#=Y#
  156.    Screen Open 0,SCRX#,SCRY#,KOLOURS,_MODE : Curs Off : Flash Off 
  157.    ACROSS=(SCRX#/2)-50
  158.    Cls 0
  159.    Screen Open 3,704,30,2,Hires : Curs Off 
  160.    Screen Display 3,112,275,,
  161.    Cls 0 : Palette $0,$FFF
  162.    TMP$="X min:"+Str$(XMIN#)+", X max:"+Str$(XMAX#)
  163.    TMP$=TMP$+", Y min:"+Str$(YMIN#)+", Y max:"+Str$(YMAX#)+", "+Str$(K+1)+" Colours"
  164.    Centre TMP$ : Print 
  165.    TMP$="Re-Iteration Level:"+Str$(MAG#)
  166.    Centre TMP$ : Print 
  167.    TMP$="Preview Screen ( 50 x 50 )"
  168.    If DEPTH=500
  169.       TMP$=TMP$+" Deep Scanning Mode Enabled"
  170.    End If 
  171.    Centre TMP$
  172.    Screen 0
  173.    Hide : Menu Off 
  174.    Y#=SCRY# : X#=SCRX#
  175.    H#=(XMAX#-XMIN#)/(49.0)
  176.    V#=(YMAX#-YMIN#)/(49.0)
  177.    LDED=True
  178.    For Q#=0.0 To 50.0
  179.       For P#=0.0 To 50.0
  180.          M#=XMIN#+P#*H#
  181.          N#=YMIN#+Q#*V#
  182.          C=0 : X#=0 : Y#=0
  183.          LABEL2:
  184.          W#=X#*X# : Y2#=Y#*Y# : R#=W#+Y2#
  185.          Y#=2*X#*Y#+N#
  186.          X#=W#-Y2#+M#
  187.          Inc C
  188.          If R#<MAG# and C<DEPTH-1
  189.             Goto LABEL2
  190.          End If 
  191.          XU=P# : YU=Q#
  192.          C=C and K
  193.          Ink C : Plot ACROSS+XU,120+YU
  194.          Bchg %1,$BFE001
  195.          If Mouse Key
  196.             Screen Open 4,640,20,2,Hires : Curs Off : Palette $0,$FFF
  197.             Screen Display 4,132,200,,
  198.             Input "Are You You Sure You Want To Abort ";AB$
  199.             If AB$="y"
  200.                LDED=False
  201.                Q#=SCRY#+1.0
  202.                P#=SCRX#+1.0
  203.             End If 
  204.             Screen Close 4
  205.             Screen 0
  206.          End If 
  207.       Next P#
  208.    Next Q#
  209.    Menu On 
  210.    On Menu On 
  211.    Show 
  212.    Screen To Front 2
  213.    Screen 2
  214.    SCRX#=SCX#
  215.    SCRY#=SCY#
  216.    Y#=YS#
  217.    X#=XS#
  218.    If LDED=True
  219.       Screen 2
  220.       Ink 0,, : Bar 0,200 To 704,256
  221.       Locate 0,29 : Centre "Graphics Loaded Into Work Areas"
  222.    End If 
  223.    If LDED=False
  224.       Screen 2
  225.       Ink 0,, : Bar 0,200 To 704,256
  226.       Locate 0,29 : Centre "No Graphics Loaded Into Work Areas"
  227.    End If 
  228. End Proc
  229. Procedure SETCOORDS
  230.    If Choice(2)=1
  231.       Screen Open 1,640,24,2,Hires : Cls 0
  232.       Screen Display 1,132,55,,
  233.       Palette $0,$999
  234.       Input "Enter Minimum X Value: ";XMIN#
  235.       Screen Close 1
  236.    End If 
  237.    If Choice(2)=2
  238.       Screen Open 1,640,24,2,Hires : Cls 0
  239.       Screen Display 1,132,55,,
  240.       Palette $0,$999
  241.       Input "Enter Maximum X Value: ";XMAX#
  242.       Screen Close 1
  243.    End If 
  244.    If Choice(2)=3
  245.       Screen Open 1,640,24,2,Hires : Cls 0
  246.       Screen Display 1,132,55,,
  247.       Palette $0,$999
  248.       Input "Enter Minimum Y Value: ";YMIN#
  249.       Screen Close 1
  250.    End If 
  251.    If Choice(2)=4
  252.       Screen Open 1,640,24,2,Hires : Cls 0
  253.       Screen Display 1,132,55,,
  254.       Palette $0,$999
  255.       Input "Enter Maximum Y Value: ";YMAX#
  256.       Screen Close 1
  257.    End If 
  258.    If Choice(2)=5
  259.       Screen Open 1,640,24,2,Hires : Cls 0
  260.       Screen Display 1,132,55,,
  261.       Palette $0,$999
  262.       Input "Enter Re-Iteration Value: ";MAG#
  263.       Screen Close 1
  264.    End If 
  265.    If Choice(2)=6
  266.       Screen Open 1,640,150,2,Hires : Cls 0
  267.       Screen Display 1,132,55,,
  268.       Palette $0,$999
  269.       Input "Enter Re-Iteration Value: ";MAG#
  270.       Input "Enter Minimum X Value: ";XMIN#
  271.       Input "Enter Maximum X Value: ";XMAX#
  272.       Input "Enter Minimum Y Value: ";YMIN#
  273.       Input "Enter Maximum Y Value: ";YMAX#
  274.       Screen Close 1
  275.    End If 
  276.    If Choice(3)=1
  277.       Bell 
  278.       SCRX#=320.0 : SCRY#=256.0
  279.       _MODE=0
  280.       K=31
  281.    End If 
  282.    If Choice(3)=2
  283.       Bell 
  284.       SCRX#=640.0 : SCRY#=256.0
  285.       _MODE=$8000
  286.       K=15
  287.    End If 
  288.    If Choice(3)=3
  289.       Bell 
  290.       SCRX#=352.0 : SCRY#=256.0
  291.       _MODE=0
  292.       K=31
  293.    End If 
  294.    If Choice(3)=4
  295.       Bell 
  296.       SCRX#=704.0 : SCRY#=256.0
  297.       _MODE=$8000
  298.       K=15
  299.    End If 
  300.    If Choice(3)=5
  301.       Bell 
  302.       SCRX#=320.0 : SCRY#=256.0
  303.       _MODE=0
  304.       K=15
  305.    End If 
  306.    If Choice(3)=6
  307.       Bell 
  308.       SCRX#=352.0 : SCRY#=256.0
  309.       _MODE=0
  310.       K=15
  311.    End If 
  312.    Menu On 
  313.    On Menu On 
  314. End Proc
  315. Procedure SETCOLS
  316.    Bell 
  317.    If Choice(2)=1
  318.       Screen 0
  319.       Palette $0,$100,$300,$500,$700,$900,$A00,$C00,$E00,$F00,$F11,$F33,$F55,$F77,$F99,$FBB,$FDD,$FFF,$300,$500,$700,$900,$A00,$C00,$E00,$F00,$F11,$F33,$F55,$F77,$F99
  320.    End If 
  321.    If Choice(2)=2
  322.       Bell 
  323.       Screen 0
  324.       Palette $0,$10,$30,$50,$70,$90,$A0,$C0,$E0,$F0,$1F1,$3F3,$5F5,$7F7,$9F9,$BFB,$DFD,$FFF,$0,$10,$30,$50,$70,$90,$A0,$C0,$E0,$F0,$1F1,$3F3,$5F5
  325.    End If 
  326.    If Choice(2)=3
  327.       Bell 
  328.       Screen 0
  329.       Palette $0,$1,3,5,7,9,$A,$C,$E,$F,$11F,$33F,$55F,$77F,$99F,$BBF,$DDF,$EEF,$0,$1,3,5,7,9,$A,$C,$E,$F,$11F,$33F,$55F
  330.    End If 
  331.    If Choice(2)=4
  332.       Bell 
  333.       Screen 0
  334.       Palette $0,$111,$333,$555,$777,$999,$BBB,$DDD,$FFF,$222,$444,$666,$888,$AAA,$CCC,$EEE,$0,$111,$333,$555,$777,$999,$BBB,$DDD,$FFF,$222,$444,$666,$888,$AAA,$CCC
  335.    End If 
  336.    If Choice(2)=5
  337.       Bell 
  338.       Screen 0
  339.       For A=0 To 30 Step 2
  340.          Colour A,0 : Colour A+1,$FFF
  341.       Next 
  342.    End If 
  343.    If Choice(2)=6
  344.       Bell 
  345.       Screen 0
  346.       Palette $0,2,4,6,9,$B,$D,$F,$FFF,$DDF,$BBF,$99F,$67F,$45F,$22F,$F,$200,$400,$600,$800,$900,$B00,$D00,$F00,$F20,$F40,$F60,$F70,$F90,$FB0,$FD0,$FF0
  347.    End If 
  348.    If Choice(2)=7
  349.       Bell 
  350.       Screen 0
  351.       Palette $0,$FF0,$FC0,$FA0,$F70,$F50,$F20,$0,$FFF,$BDB,$8B8,$595,$373,$151,$30,$10,$100,$300,$511,$733,$955,$B88,$DBB,$FFF,$FFF,$BBD,$88B,$559,$337,$115,$3
  352.    End If 
  353.    If Choice(2)=8
  354.       Bell 
  355.       Screen 0
  356.       Palette $0,$200,$410,$620,$830,$950,$B80,$DB0,$FF0,$DB0,$B80,$950,$830,$620,$410,$200,$400,$510,$720,$840,$A50,$C70,$DA0,$FD0,$DA0,$C70,$A50,$840,$720,$510,$400,$200
  357.    End If 
  358.    If Choice(2)=9
  359.       Bell 
  360.       Screen 0
  361.       If K+1=32
  362.          If CFLAG=True
  363.             Colour 31,$FFF
  364.             CFLAG=False
  365.             Goto OOT
  366.          End If 
  367.          If CFLAG=False
  368.             Colour 31,$0
  369.             CFLAG=True
  370.             Goto OOT
  371.          End If 
  372.       End If 
  373.    End If 
  374.    If K+1=16
  375.       If CFLAG=True
  376.          Colour 15,$FFF
  377.          CFLAG=False
  378.          Goto OOT
  379.       End If 
  380.       If CFLAG=False
  381.          Colour 15,$0
  382.          CFLAG=True
  383.          Goto OOT
  384.       End If 
  385.    End If 
  386.    OOT:
  387.    Screen To Front 2 : Screen 2
  388.    Menu On 
  389.    On Menu On 
  390. End Proc
  391. Procedure QUIT
  392.    If Choice(2)=1
  393.       Screen Hide 0
  394.       Ink 0,, : Bar 0,200 To 704,256
  395.       Screen Open 1,704,256,4,Hires : Flash Off : Curs Off : Cls 0
  396.       Palette $0,$0,$8E : Hide 
  397.       Screen Display 1,112,-100,,
  398.       Screen 1
  399.       Locate 0,0
  400.       Centre "From Scientific Order To Dynamic Chaos."
  401.       Print : Centre " "
  402.       Print : Centre "An Experiment In MandelBrots And Fractal Geometry"
  403.       Print : Centre " "
  404.       Print : Centre "Coded By G.Shilvock & M.Norman (c) 1991"
  405.       Print : Print : Centre "NOTE: The Info Screen WILL NOT affect The Main Screen "
  406.       Print : Centre "The Data will be Plotted Beneath It."
  407.       Print : Print : Print 
  408.       Print : Print : Centre "Press Mouse Button To Continue."
  409.       For A=40 To 0 Step -1
  410.          Screen Display 2,112,A,,
  411.          Wait Vbl 
  412.       Next 
  413.       For A=-100 To 100 Step 3
  414.          Screen Display 1,112,A,,
  415.          Wait Vbl 
  416.       Next 
  417.       Fade 1 : Wait 15
  418.       Fade 1,$0,$0,$8E : Wait 15
  419.       Repeat 
  420.       Until Mouse Key
  421.       Fade 1 : Wait 15
  422.       Screen Close 1
  423.       For A=0 To 40
  424.          Screen Display 2,112,A,,
  425.          Wait Vbl 
  426.       Next 
  427.       Screen To Front 2 : Screen 2
  428.       Show 
  429.       If LDED=True
  430.          Screen 2
  431.          Ink 0,, : Bar 0,200 To 704,256
  432.          Locate 0,29 : Centre "Graphics Loaded Into Work Areas"
  433.       End If 
  434.       If LDED=False
  435.          Screen 2
  436.          Ink 0,, : Bar 0,200 To 704,256
  437.          Locate 0,29 : Centre "No Graphics Loaded Into Work Areas"
  438.       End If 
  439.    End If 
  440.    If Choice(2)=2
  441.       Dir$="df0:"
  442.       Rem shut down system areas 
  443.       CLI
  444.       End 
  445.    End If 
  446.    If Choice(2)=3
  447.       NAME$=Fsel$("Df0:","","Save IFF File.")
  448.       If NAME$=""
  449.          Goto ABORT
  450.       End If 
  451.       Screen 2 : 
  452.       Ink 0,, : Bar 0,200 To 704,256
  453.       Locate 0,29 : Centre "Saving Data As IFF File."
  454.       Screen To Front 0
  455.       Screen 0
  456.       Change Mouse 6
  457.       Save Iff NAME$,0
  458.       Change Mouse 4
  459.       If LDED=True
  460.          Screen 2
  461.          Ink 0,, : Bar 0,200 To 704,256
  462.          Locate 0,29 : Centre "Graphics Loaded Into Work Areas"
  463.       End If 
  464.       If LDED=False
  465.          Screen 2
  466.          Ink 0,, : Bar 0,200 To 704,256
  467.          Locate 0,29 : Centre "No Graphics Loaded Into Work Areas"
  468.       End If 
  469.       Screen To Front 2 : Screen 2
  470.    End If 
  471.    If Choice(2)=4
  472.       A$="Df0:Iff"
  473.       B$="Df1:Iff"
  474.       C$="Df0:Lo-res"
  475.       D$="Df1:Lo-res"
  476.       Dir$="df0:"
  477.       If Exist(A$)
  478.          Dir$=A$
  479.       End If 
  480.       If Exist(B$)
  481.          Dir$=B$ : Rem check for the existance
  482.       End If 
  483.       If Exist(C$)
  484.          Dir$=C$ : Rem of possible IFF directories
  485.       End If 
  486.       If Exist(D$)
  487.          Dir$=D$
  488.       End If 
  489.       NAME$=Fsel$("","","Load IFF File.")
  490.       If NAME$=""
  491.          Goto ABORT
  492.       End If 
  493.       Screen 2
  494.       Ink 0,, : Bar 0,200 To 704,256
  495.       Locate 0,29 : Centre "Loading Data As IFF File."
  496.       Change Mouse 6
  497.       Load Iff NAME$,0
  498.       Screen Copy 0 To 5
  499.       Change Mouse 4
  500.       Screen To Front 0
  501.       LDED=True
  502.       If LDED=True
  503.          Screen 2
  504.          Ink 0,, : Bar 0,200 To 704,256
  505.          Locate 0,29 : Centre "Graphics Loaded Into Work Areas"
  506.       End If 
  507.       If LDED=False
  508.          Screen 2
  509.          Ink 0,, : Bar 0,200 To 704,256
  510.          Locate 0,29 : Centre "No Graphics Loaded Into Work Areas"
  511.       End If 
  512.       PASS=False
  513.       Hide 
  514.       Repeat 
  515.          If Mouse Key
  516.             PASS=True
  517.          End If 
  518.          WHICHKEY$=Inkey$
  519.          If WHICHKEY$<>""
  520.             PASS=True
  521.          End If 
  522.       Until PASS=True
  523.       Show 
  524.    End If 
  525.    If Choice(2)=5
  526.       HELP
  527.    End If 
  528.    ABORT:
  529.    Screen Show 0
  530.    Screen To Front 2
  531.    Screen 2
  532.    Menu On 
  533.    On Menu On 
  534. End Proc
  535. Procedure MEN
  536.    Locate 0,0 : Ink 2 : Set Text 6 : Text 0,8,"                   MandelBrot Generator V1.85 (c) 1991 G.Shilvock/M.Norman.                    "
  537.    Set Text 0
  538.    Menu$(1)="   Misc"
  539.    Menu$(1,1)="  About."
  540.    Menu$(1,2)="  Quit.  "
  541.    Menu$(1,3)="  Save IFF File. "
  542.    Menu$(1,4)="  Load IFF File. "
  543.    Menu$(1,5)="  Instructions. "
  544.    Menu$(2)=" Variables"
  545.    Menu$(2,1)=" Set X Min. "
  546.    Menu$(2,2)=" Set X Max. "
  547.    Menu$(2,3)=" Set Y Min. "
  548.    Menu$(2,4)=" Set Y Max. "
  549.    Menu$(2,5)=" Set Re-Iteration Level."
  550.    Menu$(2,6)=" Set All Values.   "
  551.    Menu$(2,7)=" Set Resolution.    "
  552.    Menu$(2,7,1)=" 320 x 256 Low Res  "
  553.    Menu$(2,7,2)=" 640 x 256 High Res "
  554.    Menu$(2,7,3)=" 352 x 256 Low Res Overscan "
  555.    Menu$(2,7,4)=" 704 x 256 High Res Overscan"
  556.    Menu$(2,7,5)=" 320 x 256 Low res 16 Cols. "
  557.    Menu$(2,7,6)=" 352 x 256 Low res 16 Cols. "
  558.    Menu$(3)="  Palettes "
  559.    Menu$(3,1)=" Red      "
  560.    Menu$(3,2)=" Green    "
  561.    Menu$(3,3)=" Blue     "
  562.    Menu$(3,4)=" Grey     "
  563.    Menu$(3,5)=" MonoChrome "
  564.    Menu$(3,6)=" MultiColour 1 "
  565.    Menu$(3,7)=" MultiColour 2 "
  566.    Menu$(3,8)=" Brown    "
  567.    Menu$(3,9)=" Invert Centre "
  568.    Menu$(4)=" Calculate "
  569.    Menu$(4,1)=" Full Screen MandelBrot. "
  570.    Menu$(4,2)=" 50 x 50 Preview. "
  571.    Menu$(5)=" Scan Depth "
  572.    Menu$(5,1)="    Low     "
  573.    Menu$(5,2)="    Deep    "
  574.    Menu$(6)=" Examples "
  575.    Menu$(6,1)=" Example I "
  576.    Menu$(6,2)=" Example II "
  577.    Menu$(6,3)=" Example III "
  578.    Menu$(6,4)=" Example IV "
  579.    Menu$(6,5)=" Example V"
  580.    Menu$(7)=" Display "
  581.    Menu$(7,1)=" View Current "
  582.    Menu$(8)=" Fine Tune "
  583.    Menu$(8,1)=" Backup Pic   "
  584.    Menu$(8,2)=" Restore Pic  "
  585.    Menu$(8,3)=" Zero Area "
  586.    On Menu Proc QUIT,SETCOORDS,SETCOLS,CALC,DEEP,EXAMPS,CURRENT,TUNE
  587.    Menu On 
  588.    On Menu On 
  589.    Screen To Front 2 : Screen 2
  590.    Fade 2,$0,$357,$FFF
  591. End Proc
  592. Procedure CURRENT
  593.    Hide 
  594.    Screen To Front 0 : View 
  595.    Repeat 
  596.    Until Mouse Key
  597.    Show 
  598.    Screen To Front 2
  599.    Menu On 
  600.    On Menu On 
  601. End Proc
  602. Procedure HELP
  603.    Ink 0,, : Bar 0,200 To 704,256
  604.    For A=40 To 0 Step -1
  605.       Screen Display 2,112,A,,
  606.       Wait Vbl 
  607.    Next 
  608.    Fade 1,$357,$FFF,$FFF,$FFF : Wait 15
  609.    Screen Hide 0
  610.    Screen Open 1,704,900,2,Hires : Curs Off : Flash Off : Hide 
  611.    Palette $357,$FFF,$0
  612.    Screen Display 1,132,300,,
  613.    Locate 0,0
  614.    Centre "Instructions For MandelBrot Generator"
  615.    Print 
  616.    Centre "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  617.    Print : Print 
  618.    Centre "Space To Pause/Continue        Mouse Key To Quit"
  619.    Print : Print : Print 
  620.    Print : Print "This Program was developed using the following books:"
  621.    Print "Our many thanks to the authors for providing "
  622.    Print "us with invaluable background information."
  623.    Print : Print "'The Beauty Of Fractals.' By H.O.Peitgen & P.H. Richter."
  624.    Print "(ISBN 3-540-15851-0) "
  625.    Print "and 'Fractals.' By Jens Feder. (ISBN 0-306-42851-2)"
  626.    Print : Print "This program was coded using AMOS Basic (c) 1990 Mandarin Jawx."
  627.    Print "Thanks to Francois Lionet & Mandarin"
  628.    Print : Print "The menu options on the first menu are all self-explanatary, "
  629.    Print "so those will be skipped." : Print 
  630.    Print "The Variables Menu"
  631.    Print "~~~~~~~~~~~~~~~~~~"
  632.    Print 
  633.    Print "Xmin, Xmax, Ymin, Ymax determine where the 'window' over the MandelBrot"
  634.    Print "will be placed (i.e. Which part of the MandelBrot you will see),"
  635.    Print "And Are Grid Co-Ordinates relative to 0"
  636.    Print : Print 
  637.    Print "Examples"
  638.    Print "~~~~~~~~"
  639.    Print "Xmin       Xmax      Ymin      Ymax"
  640.    Print "-2.25      0.75      -1.5      1.5"
  641.    Print "-0.19920   -0.12954  1.01480   1.06707"
  642.    Print "-0.713     -0.4082   0.49216   0.71429"
  643.    Print "-1.781     -1.764    0.0       0.013"
  644.    Print : Print "As you can see, all the values are quite close to zero, otherwise"
  645.    Print "the MandelBrot doesn't vary much. The time it takes to compute a full "
  646.    Print "MandelBrot increases with the depth, therefore a basic MandelBrot could take"
  647.    Print "say, 10 Minutes to compute, whereas a MandelBrot computed at very deep levels"
  648.    Print "will be infinitly more complex and beautiful (Brot7.Iff in the "
  649.    Print "IFF Folder on this disk took nearly 16 hours to compute.(Un-compiled version))"
  650.    Print "The Re-Iteration Value is used as a trigger so that a recursive loop"
  651.    Print "doesn't occur. A value of 100 is recommened.)"
  652.    Print : Print "The screen resolution can also be changed, But be warned:- "
  653.    Print "The higher resolutions take quite a while to produce."
  654.    Print "(A HAM Mode Was Originly Included, But Computing time was much to great"
  655.    Print "to justify the end result.)"
  656.    Print "The 'Set All Values' is simply a shortcut from choosing individual menu options "
  657.    Print "if you want to enter a complete set of new data."
  658.    Print : Print "The Palettes Option is used after a MandelBrot has been computed."
  659.    Print "The Invert Centre option is purely cosmetic and is used to "
  660.    Print "invert the middle of the MandelBrot. (some look good with white centres,"
  661.    Print ".....some don't.)"
  662.    Print : Print 
  663.    Print "Calculate!"
  664.    Print "~~~~~~~~~~"
  665.    Print "The Calculate option is used to compute a full screen MandelBrot,"
  666.    Print : Print "Use the Preview option to create a smaller version of the"
  667.    Print "MandelBrot ( 50 pixels x 50 pixels.....a wait of 1 - 2 minutes at most )"
  668.    Print "This is to save you having to wait 5 Hours to find you have"
  669.    Print "created a totally black screen."
  670.    Print : 
  671.    Print "If You Choose 'Calculate' or 'Preview' once the program is loaded."
  672.    Print "A Full MandelBrot will be drawn using some pre-sets I have"
  673.    Print "already entered."
  674.    Print : Print : Print "Once a MandelBrot has been drawn the Program returns to the menu."
  675.    Print "Choose 'View Current' to see the MandelBrot  (Mouse Key returns to menu)"
  676.    Print : Print "Depth"
  677.    Print "~~~~~"
  678.    Print "This is a little more complex, because this is how 'detailed' the MandelBrot"
  679.    Print "will be. A 'LOW' setting is faster, but useless at deeper levels, whereas 'DEEP'"
  680.    Print "is very slow but very accurate."
  681.    Print "Try The Co-ordinates on a 'LOW' setting first, and if you get a blank screen,"
  682.    Print "abort the MandelBrot and change to 'DEEP'"
  683.    Print : Print "To use the examples, choose the one you want from the menu, and choose"
  684.    Print "a 'Calcuate' option...(Depth etc are all pre-set.)"
  685.    Print : Print 
  686.    Print "Fine Tuning"
  687.    Print "~~~~~~~~~~~"
  688.    Print "Backup - Takes a copy of the current image and copies it to another area"
  689.    Print "Restore - Copies a previously saved image to the current image"
  690.    Print "Zero Area - Does the equivalent of a 'Fill' in colour 0 to"
  691.    Print "black out areas of the MandelBrot."
  692.    Print "The Left button will zero an area, The Right button to finish."
  693.    Print : Print : Print : Print : Print : Print : Print 
  694.    Do 
  695.       For A=300 To -800 Step -1
  696.          Screen Display 1,132,A,,
  697.          Wait Vbl 
  698.          K$=Inkey$
  699.          If K$=" "
  700.             Wait 25
  701.             Repeat 
  702.             Until Inkey$<>""
  703.          End If 
  704.          If Mouse Key
  705.             Goto DUN
  706.          End If 
  707.       Next 
  708.    Loop 
  709.    DUN:
  710.    Fade 1 : Wait 45
  711.    Screen Close 1
  712.    Screen Show 0
  713.    Menu On 
  714.    On Menu On 
  715.    Fade 1,0,$357,$FFF
  716.    For A=0 To 40
  717.       Screen Display 2,112,A,,
  718.       Wait Vbl 
  719.    Next 
  720.    Screen To Front 2 : Screen 2
  721.    Show 
  722.    If LDED=True
  723.       Screen 2
  724.       Ink 0,, : Bar 0,200 To 704,256
  725.       Locate 0,29 : Centre "Graphics Loaded Into Work Areas"
  726.    End If 
  727.    If LDED=False
  728.       Screen 2
  729.       Ink 0,, : Bar 0,200 To 704,256
  730.       Locate 0,29 : Centre "No Graphics Loaded Into Work Areas"
  731.    End If 
  732. End Proc
  733. Procedure CALC
  734.    If Choice(2)=1
  735.       CALCULATE
  736.    End If 
  737.    If Choice(2)=2
  738.       CALCULATEMINIBROT
  739.    End If 
  740.    Screen To Front 2
  741.    Menu On 
  742.    On Menu On 
  743. End Proc
  744. Procedure DEEP
  745.    If Choice(2)=1
  746.       Bell 
  747.       DEPTH=32
  748.    End If 
  749.    If Choice(2)=2
  750.       Bell 
  751.       DEPTH=500
  752.    End If 
  753.    Menu On 
  754.    On Menu On 
  755.    Screen To Front 2 : Screen 2
  756. End Proc
  757. Procedure EXAMPS
  758.    If Choice(2)=1
  759.       XMIN#=-1.25402
  760.       XMAX#=-1.25286
  761.       YMIN#=0.046251
  762.       YMAX#=0.047125
  763.       DEPTH=500
  764.       Bell 
  765.    End If 
  766.    If Choice(2)=2
  767.       XMIN#=-2.25
  768.       XMAX#=0.75
  769.       YMIN#=-1.5
  770.       YMAX#=1.5
  771.       DEPTH=32
  772.       Bell 
  773.    End If 
  774.    If Choice(2)=3
  775.       XMIN#=-0.746541
  776.       XMAX#=-0.746378
  777.       YMIN#=0.107574
  778.       YMAX#=0.107678
  779.       DEPTH=32
  780.       Bell 
  781.    End If 
  782.    If Choice(2)=4
  783.       XMIN#=-0.1992
  784.       XMAX#=-0.4082
  785.       YMIN#=0.49216
  786.       YMAX#=0.71429
  787.       DEPTH=500
  788.       Bell 
  789.    End If 
  790.    If Choice(2)=5
  791.       XMIN#=-1.781
  792.       XMAX#=-1.764
  793.       YMIN#=0.0
  794.       YMAX#=0.013
  795.       DEPTH=500
  796.       Bell 
  797.    End If 
  798.    Menu On 
  799.    On Menu On 
  800.    Screen To Front 2 : Screen 2
  801. End Proc
  802. Procedure TUNE
  803.    If Choice(2)=1
  804.       Bell 
  805.       Screen Open 5,SCRX#,SCRY#,K+1,_MODE : Curs Off : Flash Off 
  806.       Screen 0
  807.       Screen Copy 0 To 5
  808.    End If 
  809.    If Choice(2)=2
  810.       Bell 
  811.       Screen 0
  812.       Screen Copy 5 To 0
  813.    End If 
  814.    If Choice(2)=3
  815.       Change Mouse 2
  816.       Screen To Front 0 : Screen 0
  817.       Limit Mouse 
  818.       PASS=False
  819.       Repeat 
  820.          If Mouse Key=1
  821.             X=X Screen(X Mouse) : Y=Y Screen(Y Mouse)
  822.             Ink 0,0,0 : Paint X,Y,1
  823.          End If 
  824.          If Mouse Key=2
  825.             PASS=True
  826.          End If 
  827.       Until PASS=True
  828.       Change Mouse 4
  829.       Screen To Front 0
  830.       PASS=False
  831.       Repeat 
  832.          If Mouse Key
  833.             PASS=True
  834.          End If 
  835.          WHICHKEY$=Inkey$
  836.          If WHICHKEY$<>""
  837.             PASS=True
  838.          End If 
  839.       Until PASS=True
  840.    End If 
  841.    Menu On 
  842.    On Menu On 
  843.    Screen To Front 2 : Screen 2
  844. End Proc
  845. Procedure CLI
  846.    Bell 
  847.    Rem shut down system areas 
  848.    Screen Close 0
  849.    Screen Close 5
  850.    Screen 2 : Fade 2 : Wait 45
  851.    Screen Close 2
  852. End Proc
  853. Procedure ABORT
  854.    Bell 
  855.    Rem shut down system areas 
  856.    Screen Close 0
  857.    End 
  858. End Proc
  859. '
  860. '
  861. '
  862. '
  863. '
  864. '
  865. HANDLE:
  866. Boom 
  867. Screen Open 4,640,16,2,Hires : Palette $0,$0 : Cls 0 : Curs Off 
  868. Screen Display 4,132,200,,
  869. Locate 0,0
  870. Centre "Error! Command Ignored."
  871. Fade 1,$0,$FAC
  872. Wait 200 : Fade 1 : Wait 45 : Screen Close 4
  873. '
  874. ' This is where structured programming goes out the window!  
  875. '
  876. Goto THE_START