English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. AMOS

 
 
Thread Tools
Old 17 December 2011, 22:52   #1
Retro1234
Phone Homer
 
Retro1234's Avatar
 
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?
Retro1234 is offline  
Old 18 December 2011, 12:51   #2
pmc
gone
 
pmc's Avatar
 
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.
pmc is offline  
Old 18 December 2011, 13:11   #3
Retro1234
Phone Homer
 
Retro1234's Avatar
 
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.
Retro1234 is offline  
Old 18 December 2011, 15:50   #4
pmc
gone
 
pmc's Avatar
 
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?
pmc is offline  
Old 18 December 2011, 17:37   #5
Anakirob
Unregistered User
 
Anakirob's Avatar
 
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
Anakirob is offline  
Old 18 December 2011, 19:26   #6
Retro1234
Phone Homer
 
Retro1234's Avatar
 
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
Retro1234 is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:18.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06968 seconds with 15 queries