Page 1 of 1

Pretty fast Mandelbrot set generator...

Posted: Mon Apr 23, 2018 5:14 pm
by Bean
I wrote a program a play with the Mandelbrot set.
Uses ASM to draw the set and BASIC to handle the user interface.
Takes about 85 seconds in slow mode (NTSC) or about 16 seconds in fast mode.

Comments welcome...

Bean

Re: Pretty fast Mandelbrot set generator...

Posted: Mon Apr 23, 2018 7:06 pm
by Bean
I noticed if you zoom in too much it just goes blank. I think the increment goes to zero.
I am using 8.8 fixed point math in the asm. I guess I could use 4.12 and get more zoom.

Bean

Re: Pretty fast Mandelbrot set generator...

Posted: Thu Apr 26, 2018 2:17 pm
by Bean
I have updated the mandelbrot drawing program.
I now use 4.12 fixed point math so you can zoom in further.
I also added a couple more features (print, set max depth, etc).

I think this is quite a good demonstration program for the good ol' zeddy.

Bean

Re: Pretty fast Mandelbrot set generator...

Posted: Thu Jul 30, 2020 1:46 am
by Bean
I realized I didn't post the assembly source code for those interested...

This code is free to use and modify. Please give credit if you use it.

Bean

Re: Pretty fast Mandelbrot set generator...

Posted: Thu Jul 30, 2020 4:50 pm
by stroebeljc
It would be nice if the zoom focused on the center of the screen. It seems like I need to move the screen down 2 clicks after every time I zoom.

Re: Pretty fast Mandelbrot set generator...

Posted: Fri Jul 31, 2020 3:35 am
by Bean
John, To zoom from the center add these four lines

431 LET X = X - XI * 16
432 LET Y = Y - YI * 12
441 LET X = X + XI * 16
442 LET Y = Y + YI * 12

That should do it.

Bean

Re: Pretty fast Mandelbrot set generator...

Posted: Fri Jul 31, 2020 4:01 pm
by stroebeljc
Excellent!
Thanks, Bean.

Re: Pretty fast Mandelbrot set generator...

Posted: Fri Jul 31, 2020 7:32 pm
by marste
Bean wrote: Thu Apr 26, 2018 2:17 pm I now use 4.12 fixed point math so you can zoom in further.
I've seen that you're doing a lot of operations just to manage the 4 bit displacement. Wouldn't it be faster to go 8.16 in case more exponent were needed? (seems to me you would need the same operations to manage the exponent and even having 4 bits more precision, and would be easier to manage the mantissa, without all the mambo/jumbo shifting/rotational logic)

PS: I was thinking as an idea to investigate that as an extreme optimization might even work a 0.16 setup (with mantissa 1 implicit), or a 1.16 one (with 2 bits of mantissa, one implicit and the other one - the sign - managed with just conditional jumps and no operations)...

Re: Pretty fast Mandelbrot set generator...

Posted: Wed Aug 19, 2020 4:09 pm
by Bean
I think the 0.16 format would be faster, it would just limit what area you could view.
But it would let you zoom in further than my 4.12 format. So it might be worth it.

I was thinking about possibly changing the existing code so that it runs in fast mode, but shows a couple frames (20 or so) after every line so you can see how it going, but I'm not sure I can pull that off.

Bean