Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Spirale fractal [DBPro]

Author
Message
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 14th Apr 2006 12:43
Hi

this is qbasic Spirale fractal modify to work in DPro.



I'm not getting you down am I, Ho Look! another fancy Door?
flashing snall
18
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 15th Apr 2006 00:01
cool

dont assume cause ull make an ass out of you and me!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 15th Apr 2006 12:15
Have a few others to convert when I get my head around Qbasic werid coding.

Floats don't talk to me about floats!

I'm not getting you down am I, Ho Look! another fancy Door?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 15th Apr 2006 12:40
this ones a flowers type.


I'm not getting you down am I, Ho Look! another fancy Door?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 15th Apr 2006 13:25
worth the wait this one.


I'm not getting you down am I, Ho Look! another fancy Door?
spooky
21
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 15th Apr 2006 15:12
Not bad but you need to learn some tricks to speed up the drawing. Run the following code which is a fast version of your last snippet.

1. DBPro ABS command is DEAD slow when used many times in a loop. Lee said that there is no chance of him improving the speed. Simply write a FASTABS function instead - runs over 4 times faster

2. You were not syncing or locking screen when doing dots. This means graphics card updates screen far too often.

3. x any y are pixel cooordinates so should be integers, not floats like you had.

4. Having lots of IF's in a row means DBPro has to evaluate each and every one. Much more efficient to use SELECT and CASE commands. DBPro then only looks at ONE condition.



Hopefully you will learn from these little hints. Keep up the good work.

Boo!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 15th Apr 2006 16:53
Cheers spooky , thats some speed improvment, and thanks for show another use for select case.

Arggggg just notice that you can put the color on the end of dot, some were in doing this I thought you couldn't.

off to change me tree one now see if I can speed it up.

I'm not getting you down am I, Ho Look! another fancy Door?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 15th Apr 2006 17:34 Edited at: 17th Apr 2006 13:57
ouch! old one did it in 757923 timer clicks spooky's 1247 timer clicks.

Double Ouch! in RC9 1204.

I'm not getting you down am I, Ho Look! another fancy Door?
Daniel TGC
Retired Moderator
17
Years of Service
User Offline
Joined: 19th Feb 2007
Location: TGC
Posted: 28th Dec 2011 12:00 Edited at: 28th Dec 2011 12:23
Hi, I've increased the speed even more. There's a lot of unnecessary screen updates in there. My tests show that spooky's version takes between 1500 to 1650 milliseconds to complete on this system. I've got this down to between 156 to 158 milliseconds just by moving the sync out of the For y loop. I've also modified a version to use memblocks, which gives me a slightly faster speed of 149 - 151ms.



I've also wondered if using memblocks would be faster that the dot command with unlocked pixels.

MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 29th Dec 2011 03:26
What about FASTSYNC? I hardly see it get mention anywhere...

Hi guys

Dr Tank
14
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Southampton, UK
Posted: 31st Dec 2011 12:40
These are nice. Bit confused by "while not instat". Why not do/loop, or "while 1". Is this just something left in from porting it from qbasic, or is there some special reason for it?
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 10th Jan 2012 05:52
From the 2 version Daniel TGC put up I got 264 and 244, a slight increase using memblocks.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 11th Jan 2012 16:28
cheers, now thats what I call speeding things up....

Dark Physics makes any hot drink go cold.

Login to post a reply

Server time is: 2024-03-29 01:41:27
Your offset time is: 2024-03-29 01:41:27