[futurebasic] Re: Speaking of Speed...

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1997 : Group Archive : Group : All Groups

From: jonathan <format@...>
Date: Thu, 18 Dec 97 18:24:31 -0000
>Speaking of Speed, is there a way to do an automatic calculation on how
>fast the host processor is, and automatically adjust your "time-waster"
>loops accordingly? Ie, you'll notice that some games coded for a 25Mhz
>Quadra are pretty unplayable on a G3 because they are too fast.

basically there are 3 ways of doing this, one of which aint good:

1 (no good) - put in a for i = 1 to _yourNumber type do nothing loop
this'll slow things down on the target machine, but that's all

2 use on timer n
this means that the fn will only be called at the moment you want and do 
otherthings in that time

3 personnally i use

DO
 HANDLEVENTS : FN myFastIdle
UNTIL gTheCowsComeHome

and in the FN myFastIdle
i verify that the number of ticks that i want has passed

LOCAL FN myFastIdle
 LONG IF (gTimer& + _theBlessedTicks) > FN TICKCOUNT
 'do that thing
gTimer& = FN TICKCOUNT
XELSE
 'do dat udder thing
END IF
END FN


jonathan

'-------------------------------------------------------------'
'  format utile - studio de graphisme/graphic design studio   '
'    mail: 16, rue Baudin, 92300 Levallois-Perret, France     '
'    phone: +33 1 47 15 26 15   -   fax: +33 1 47 59 95 06    '
'-------------------------------------------------------------'