Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:13 15 May 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2 :mandlebrot CSUB

     Page 2 of 2    
Author Message
daveculp
Newbie

Joined: 02/07/2020
Location: United States
Posts: 22
Posted: 05:13pm 08 Jul 2020
Copy link to clipboard 
Print this post

  Volhout said  
Ported to BBC V basic running on the raspberry Pi zero.


MODE 28

w = 800
h = 600
maxi = 64

TIME = 0
FOR py = 0 TO (h/2 - 1)
 sy = (py / h) * 2 - 1
 FOR px = 0 TO w - 1
   sx = (px / w) * 3.5 - 2.5
   i = 0
   x = 0
   y = 0
   WHILE ((x^2 + y^2 < 4) AND (i < maxi))
     xt = x^2 - y^2 + sx
     y = 2 * x * y + sy
     x = xt
     i = i + 1
   ENDWHILE
   GCOL i/maxi * 64
   POINT px, py
   POINT px, h-py
 NEXT px
NEXT py
PRINT TIME*10


run time : 16 seconds (10x slower than the CMM2 CSUB)




I forgot about the optimization of mirroring the horizontal axis!  That sped it up by twice.

I got 38 seconds on the CMM2 pure BASIC with that optimization and 100 iterations.
 
Sasquatch

Guru

Joined: 08/05/2020
Location: United States
Posts: 376
Posted: 09:10pm 08 Jul 2020
Copy link to clipboard 
Print this post

  daveculp said  

I forgot about the optimization of mirroring the horizontal axis!  That sped it up by twice.

I got 38 seconds on the CMM2 pure BASIC with that optimization and 100 iterations.


The CSub currently doesn't use that optimization.  It could be implemented for the special case of YCenter = 0.0  It would likely double the size of the code to double the speed for that one special case.
-Carl
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025