17 December 2011, 22:52 | #1 |
Phone Homer
Join Date: Jun 2006
Location: 5150
Posts: 5,775
|
FPS & Timing calculating
Im running way to fast on 68020 how do I calculate FPS or/and calculate a timer for maintaing a constant speed?
|
18 December 2011, 12:51 | #2 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Maybe tie your code to only executing during vertical blanking? That would keep the speed at a constant 50fps (60 on NTSC machines) regardless of the clock speed of the processor executing the code.
|
18 December 2011, 13:11 | #3 |
Phone Homer
Join Date: Jun 2006
Location: 5150
Posts: 5,775
|
Thank you for your reply and suggestion and I know its being awkward but I would like the timer not to rely on vertical blanking
So im thinking no matter what the cpu I need work out the difference without causing a pause - have a max speed that I can cap. Last edited by Retro1234; 18 December 2011 at 13:16. |
18 December 2011, 15:50 | #4 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Fair enough
You could setup a timer interrupt which would then allow you to choose (by setting the timer duration) how regularly your code would execute maybe? |
18 December 2011, 17:37 | #5 |
Unregistered User
Join Date: Nov 2005
Location: Tasmania
Age: 42
Posts: 893
|
Umm, so you want to calculate FPS and/or cap frame rate but you don't want to count vertical blanks?! Seems like an oxymoron to me.
Anyway, many years ago with a piece of Blitz2 code I had a problem where sometimes my main loop would run at 50FPS and sometimes it would slow down to 25. I wanted a constant frame rate and felt that 25 FPS was fine. I resolved the issue like this: Code:
SetInt 5 VB+1 End SetInt .mainloop VB=0 <some code> WHILE VB<2 ; this is where you set your cap VWait WEND Goto mainloop |
18 December 2011, 19:26 | #6 |
Phone Homer
Join Date: Jun 2006
Location: 5150
Posts: 5,775
|
Thanks for your replys I think your right ill have to have a play - If anyone else has anything to add please do
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
The Best Amiga 3D FPS | Steve | Retrogaming General Discussion | 112 | 22 November 2015 16:28 |
Calculating percentages in assembly aka bpm and period | h0ffman | Coders. Asm / Hardware | 8 | 16 September 2012 18:49 |
Calculating distance?? | h0ffman | Coders. General | 4 | 28 September 2011 19:58 |
Less than 50 fps...? | pmc | Coders. General | 4 | 19 April 2010 11:59 |
ADoom FPS | W4r3DeV1L | support.Games | 5 | 09 December 2008 15:56 |
|
|