Mandelbrot fractal on QL

A place to discuss general QL issues.
Post Reply
User avatar
dex
Gold Card
Posts: 288
Joined: Thu Dec 23, 2010 1:40 pm

Mandelbrot fractal on QL

Post by dex »

I was just playing with QL and SBasic, but the result, I think, looks nice.


User avatar
vanpeebles
Commissario Pebbli
Posts: 2822
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: Mandelbrot fractal on QL

Post by vanpeebles »

Impressive :)


User avatar
ppe
Trump Card
Posts: 171
Joined: Tue Dec 14, 2010 10:48 am
Location: Espoo, Finland

Re: Mandelbrot fractal on QL

Post by ppe »

Very cool! And also, a very fitting subject for a retro computer demo :)


RWAP
RWAP Master
Posts: 2840
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: Mandelbrot fractal on QL

Post by RWAP »

That reminds me about my own Quick Mandelbrot - I remember spending hours / days trying to eke every last ounce of speed out of the machine code! :)


User avatar
dex
Gold Card
Posts: 288
Joined: Thu Dec 23, 2010 1:40 pm

Re: Mandelbrot fractal on QL

Post by dex »

I don't have Quick Mandelbrot.

This one is much simpler.
First, the "darn *language!* :) pre-calc":
(Sequence on this video was calculated in one day.)

Code: Select all

10 sizex%=366:sizey%=256
20 maxiter%=256
30 MODE 8:WINDOW #1,sizey%*2,sizey%,0,0
40 SCALE sizey%,0,0
45 a%=10
50 FOR x%=0 TO sizex%
60 xi=x%/a%-2
70 FOR y%=0 TO sizey%/2
80 yi=y%/a%
90 x=0:y=0
100 FOR i%=1 TO maxiter%
110 IF x*x+y*y>4 THEN EXIT i%
120 xt=xi+x*x-y*y
130 y=yi+2*x*y
140 x=xt
150 END FOR i%
160 IF i%>maxiter% THEN LET i%=0
170 INK i% MOD 256: POINT x%,y%+sizey%/2,x%,sizey%/2-y%
180 NEXT y%
190 NEXT x%
195 SBYTES "flp1_"&(a%/10),$20000,$8000
200 a%=a%+10:GO TO 50
(Generates infinitely screenshots, step size is a% - value of 10 I used is very small.)

And the player:
(can be played directly from floppy, but it will be not so smooth due to head movements.
With 4 MB of RAM, whole ED, i.e. 2.8 MB disk, fits into RAM1_ with no problem.)

Code: Select all

50 max%=86
60 FOR a%=1 TO max%
70 AT 10,15:PRINT a%
80 COPY "flp1_"&a% TO "ram1_"&a%
90 NEXT a%
------------ this copied files to RAMdisk
100 max%=86
110 FOR a%=1 TO max%
120 LBYTES "ram1_"&a%,$20000
130 PAUSE 5 : REMark alter to change speed
140 NEXT a%
150 GO TO 110
max% is the number of screeshots saved on disk.


Post Reply