Pretty fast Mandelbrot set generator...
Pretty fast Mandelbrot set generator...
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
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
- Attachments
-
- mand01.TZX
- (2.28 KiB) Downloaded 412 times
Re: Pretty fast Mandelbrot set generator...
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
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...
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
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
- Attachments
-
- mand02.P
- (2.38 KiB) Downloaded 419 times
Re: Pretty fast Mandelbrot set generator...
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
This code is free to use and modify. Please give credit if you use it.
Bean
- Attachments
-
- Mandelbrot02.asm
- (12.43 KiB) Downloaded 300 times
-
- Posts: 67
- Joined: Thu Apr 23, 2020 6:02 am
Re: Pretty fast Mandelbrot set generator...
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.
John
Re: Pretty fast Mandelbrot set generator...
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
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
-
- Posts: 67
- Joined: Thu Apr 23, 2020 6:02 am
Re: Pretty fast Mandelbrot set generator...
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...
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
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