home *** CD-ROM | disk | FTP | other *** search
/ Falcon 030 Power 2 / F030_POWER2.iso / ST_STE / MAGS / ICTARI01.ARJ / ictari.01 / ASSEMBLY / MANDEL / MANDEL.DOC next >
Text File  |  1992-03-04  |  5KB  |  117 lines

  1.  
  2.                           Mandelbrot Generator
  3.  
  4.                       Copyright 1988 By M.S.Powell
  5.  
  6.                 Permission granted to copy for no profit
  7.  
  8.        Written entirely in 68000 assembly language, using Hisoft's
  9.                         Devpac editor/assembler.
  10.  
  11.     =================================================================
  12.  
  13.      I  wrote  this Mandelbrot set  generator  after seeing  a  GFA Basic
  14. version which took 55 minutes to generate the initial  set! I wrote it in
  15. assembly language to get it to a  reasonable  speed. My  first attempt at
  16. it,  with hindsight,  was   terrible   (taking  about  3  minutes for the
  17. initial "snowman").  However,  with a  few nights  spent  calculating the
  18. speed of routines using  the   68000  "almanac",  by Motorola,  I finally
  19. "hewed" this time down to  the  current  35  seconds.  I'm pretty pleased
  20. with this speed. It's the fastest  of  all the Mandelbrot generators that
  21. I've seen on any 16 bit micro.  If  you have any improvements to the code
  22. then  please let  me know,  as I'd be interested to hear from anyone  who
  23. can improve on these times.
  24.  
  25.      Now I suppose you'll be wanting some instructions?
  26.  
  27.      Well...  this  program was  really  quickly  hacked  together  after
  28. seeing  the basic version.  I wrote  it in  September  1988,  just before
  29. returning to University for the 2nd year of  my  computer science  degree
  30. course,  during which I didn't  even  look   at  the program  (the course
  31. doesn't even touch  on   programming   problems  like  this!) The program
  32. isn't exactly finished... It is  certainly usable,  though. But, features
  33. that I was planning on adding did just not get put in.  Someone could put
  34. in other features if they  like.   However,   I wouldn't envy anyone with
  35. the task of figuring out  how it  works  (I  had  a job, going back to it
  36. after 9 months!)
  37.  
  38.      When  I wrote  it  I  was  going  through  this  mad  phase  of  re-
  39. inventing the wheel. Every single  bit  a  code  that my program uses was
  40. written by me.  All the interrupt  routines  (vbl,  keyboard handler) and
  41. the mouse handling/drawing routines as well!   I must have been mad. Well
  42. never mind... at least the thing is FAST! That is  the ultimate advantage
  43. in using assembly language (I  wish  I  could  program in C, as good as I
  44. can in assembler, sigh)
  45.  
  46.      Anyway...
  47.  
  48.     =================================================================
  49.  
  50.     Some instructions,  at least the ones  I have gleaned from looking at
  51. my source again.
  52.  
  53. The program only runs on colour monitors.  It requires very little memory
  54. to  run.  Being in assembly language the binary  is  only about 3.75K.
  55. When run,  the progam will greet you  by drawing a display of  the entire
  56. set, which takes about 35 secs.
  57.  
  58. Whenever a display is being created  it  can  be stopped by  holding down
  59. both mouse buttons together, for a second.
  60.  
  61. You  select an area of the screen to  zoom to full screen size  by moving
  62. the  viewing  box  attracted  to  the  mouse  pointer.  The  box  can  be
  63. enlarged/reduced by using the left  and  right  mouse  buttons. When  the
  64. desired area is enclosed in the box press  <space>  to make  the  program
  65. draw that area the size  of   the   screen.   (If zooming  in  on an area
  66. would surpass the accuracy  of   the   maths  routines   employed  by the
  67. program,  then the  program  will   ping  (dong?) at you. See explanation
  68. of x command.)
  69.  
  70. Useful keys
  71.  
  72. Esc       exit  from  program (some may consider  this  the  most
  73.           useful option?)
  74.  
  75. f         draw full Mandelbrot set
  76.  
  77. r         redraw  the  display that was just  terminated  by  the
  78.           mouse  buttons,  or  that was just finished  (not  much
  79.           point in the latter!)
  80.  
  81. Undo      redraw the screen previous to the current one
  82.  
  83. i         adjust the number of iterations, just return will leave
  84.           the value unchanged.
  85.  
  86. s         put screen in the single colour mode
  87.  
  88. m         put screen in multi-colour mode
  89.  
  90. c         start colour cycling
  91.  
  92. v         stop colour cycling
  93.  
  94. -         (on keypad) slow down cycling
  95.  
  96. +         (on keypad) speed up cycling
  97.  
  98. x         display  co-ords of top corner of screen  and  distance
  99.           between each pixel on screen.  These values are in  the
  100.           format that the programs maths routines use i.e. 32 bit
  101.           fixed  point with the binary point between bits 29  and
  102.           28 e.g. $20000000 represents the value 1
  103.                   $00d8ebcd represents the value 0.026479626
  104.                   $d000659c represents the value -1.499951549
  105.           You get the idea,  just divide a number by $20000000 to
  106.           get it's value.
  107.           The  first two values the program displays are the  co-
  108.           ordinates  of  the top left corner of the  screen  (the
  109.           first  value is the x co-ord [real part of C]  and  the
  110.           second is the y co-ord [imaginary part of C], the y co-
  111.           ord is actually reversed by the program so that  co-ord
  112.           (-2,-2)  is  the top left corner of  the  screen.)  The
  113.           third value displayed is the displacement between  each
  114.           consecutive  pixel on the screen (when this value is  1
  115.           the program is zoomed in to it's maximum amount.)
  116.  
  117.