pouët.net

Fractal Engine by Chris Covell [web]

Fractal Engine v1.0 by Chris Covell
-----------------------------------

This is just a little demo that generates a Mandelbrot fractal image
on the NEC PC-Engine / Turbografx-16.  Since the PCE/TG uses an 8-bit
CPU running at 7.16 Mhz with no floating-point unit, nor any hardware
multiplication or division functions, please understand that this program
is probably slower at drawing fractals than you're used to on your PC.

I made it just to learn about fractal math, and to see some cool graphics
generated by the PCE's CPU and a little bit of code.

The controls should be easy to understand, and if you get stuck, check
out a more detailed explanation on my page at:
http://disgruntleddesigner.com/chrisc/fractalengine.html
-----------------

About the math:
---------------

Yeah, so the fractal generated by this program is flipped left-to-right
from the usual representations of the Mandelbrot set.  I did this to speed
up the math just a little bit.  I don't think it will make much of a difference
aesthetically to the image that gets generated.

This program uses fixed-point math with most variables at 32 bits, with 8 bits
representing the integer portion, and 24 representing the fraction.  I think
this makes a good balance between speed and accuracy, or rather, how far you
can zoom in.  With this in mind, it should be noted that these are the
minumum zoom values because of the bytewidth of my variables:

256-preview: 000000002
512-preview: 000000004
256-full:    00000001
512-full:    00000002

I've sped up the fractal calculations as much as I can, by adding periodicity
checking, removing some range checking, and using very fast table-based 
squaring and multiplication routines.  There isn't much bounds-checking
for when you edit the parameters in the panel, but remember this is just
a toy for playing with, not a professional program.

I've provided a ROM for use in emulators or flash cartridges, as well as
a CUE/ISO for burning to a CD (for use with a PCE Super CD-ROM system.)
-----------------

About the code:
---------------

I had originally tested out the mathematical concept in a BASIC program on
the Commodore-64.  The next step was making an integer fractal generator
on the 6502.  Since examples were nowhere to be found on the internet, I
had to figure out the general algorithm from example C code that I found.
"ManicMoir" (author of the emulator Mednafen; I don't know her real name)
was very helpful in writing up a fully working program on the PC whose C
source code used only simple integer math.  I then wrote up the 6280 ASM
code myself using her C algorithms as a guide.  I'll include the original
C source for reference too.

-----------------

That's it!  Any questions, please e-mail me at chris_covell@yahoo.ca
Chris Covell, Sept. 17, 2007
http://www.chrismcovell.com


LEGAL NOTICE
THIS PROGRAM IS A COPYRIGHTED WORK OF THE ABOVE AUTHOR AND SO ON AND SO
FORTH AND DOES ANYBODY SERIOUSLY READ THIS STUFF ANYMORE?  DID THEY EVER?
ANYWAY, HAVE FUN FINDING THE NICE EASTER EGG IN THIS PROGRAM.  A LITTLE
HINT: IT HAS TO DO WITH NUMBERS.  SO BE PERCEPTIVE AND INTUITIVE.  REMEMBER
THOSE TWO WORDS.