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 >
Wrap
Text File
|
1992-03-04
|
5KB
|
117 lines
Mandelbrot Generator
Copyright 1988 By M.S.Powell
Permission granted to copy for no profit
Written entirely in 68000 assembly language, using Hisoft's
Devpac editor/assembler.
=================================================================
I wrote this Mandelbrot set generator after seeing a GFA Basic
version which took 55 minutes to generate the initial set! I wrote it in
assembly language to get it to a reasonable speed. My first attempt at
it, with hindsight, was terrible (taking about 3 minutes for the
initial "snowman"). However, with a few nights spent calculating the
speed of routines using the 68000 "almanac", by Motorola, I finally
"hewed" this time down to the current 35 seconds. I'm pretty pleased
with this speed. It's the fastest of all the Mandelbrot generators that
I've seen on any 16 bit micro. If you have any improvements to the code
then please let me know, as I'd be interested to hear from anyone who
can improve on these times.
Now I suppose you'll be wanting some instructions?
Well... this program was really quickly hacked together after
seeing the basic version. I wrote it in September 1988, just before
returning to University for the 2nd year of my computer science degree
course, during which I didn't even look at the program (the course
doesn't even touch on programming problems like this!) The program
isn't exactly finished... It is certainly usable, though. But, features
that I was planning on adding did just not get put in. Someone could put
in other features if they like. However, I wouldn't envy anyone with
the task of figuring out how it works (I had a job, going back to it
after 9 months!)
When I wrote it I was going through this mad phase of re-
inventing the wheel. Every single bit a code that my program uses was
written by me. All the interrupt routines (vbl, keyboard handler) and
the mouse handling/drawing routines as well! I must have been mad. Well
never mind... at least the thing is FAST! That is the ultimate advantage
in using assembly language (I wish I could program in C, as good as I
can in assembler, sigh)
Anyway...
=================================================================
Some instructions, at least the ones I have gleaned from looking at
my source again.
The program only runs on colour monitors. It requires very little memory
to run. Being in assembly language the binary is only about 3.75K.
When run, the progam will greet you by drawing a display of the entire
set, which takes about 35 secs.
Whenever a display is being created it can be stopped by holding down
both mouse buttons together, for a second.
You select an area of the screen to zoom to full screen size by moving
the viewing box attracted to the mouse pointer. The box can be
enlarged/reduced by using the left and right mouse buttons. When the
desired area is enclosed in the box press <space> to make the program
draw that area the size of the screen. (If zooming in on an area
would surpass the accuracy of the maths routines employed by the
program, then the program will ping (dong?) at you. See explanation
of x command.)
Useful keys
Esc exit from program (some may consider this the most
useful option?)
f draw full Mandelbrot set
r redraw the display that was just terminated by the
mouse buttons, or that was just finished (not much
point in the latter!)
Undo redraw the screen previous to the current one
i adjust the number of iterations, just return will leave
the value unchanged.
s put screen in the single colour mode
m put screen in multi-colour mode
c start colour cycling
v stop colour cycling
- (on keypad) slow down cycling
+ (on keypad) speed up cycling
x display co-ords of top corner of screen and distance
between each pixel on screen. These values are in the
format that the programs maths routines use i.e. 32 bit
fixed point with the binary point between bits 29 and
28 e.g. $20000000 represents the value 1
$00d8ebcd represents the value 0.026479626
$d000659c represents the value -1.499951549
You get the idea, just divide a number by $20000000 to
get it's value.
The first two values the program displays are the co-
ordinates of the top left corner of the screen (the
first value is the x co-ord [real part of C] and the
second is the y co-ord [imaginary part of C], the y co-
ord is actually reversed by the program so that co-ord
(-2,-2) is the top left corner of the screen.) The
third value displayed is the displacement between each
consecutive pixel on the screen (when this value is 1
the program is zoomed in to it's maximum amount.)