Determing FPS within another FPS .. How?
#9
(11-12-2022, 01:47 AM)TerryRitchie Wrote:
(11-12-2022, 12:15 AM)Pete Wrote: A completely different method is using an inner timer...

For your 51 FPS example:

Code: (Select All)
z2 = TIMER
DO
    _LIMIT 60
    i = i + 1
    IF ABS(z2 - TIMER) >= .06 THEN z2 = TIMER: s = s + 1
LOOP UNTIL i = 60
PRINT i, i - s, s, 100 - ((s / (i - s)) * 100)
END

Pete

Hmmm.. Interesting. My son saw me working on the code this afternoon and suggested something similar. He said the way the Nintendo worked was that sprites had two pixel layers. The outer pixel layer was a one to one relationship with the pixels on screen. The inner pixel count was used to move the sprite using smaller steps that would not show up on screen. Your approach seems to be along this line.

Seems like a count## = count## + 51 / 60  would work as well.   Just move the sprite on every integer increase of count.

0 -- move
0.8 -- don't move
1.6 -- move
2.4 -- move
3.2 -- move
4.0 -- move
4.8 -- don't move

(For example, depending on whatever 51/ 60 actually works out to be.)
Reply


Messages In This Thread
RE: Determing FPS within another FPS .. How? - by SMcNeill - 11-12-2022, 02:07 AM



Users browsing this thread: 6 Guest(s)