forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Framerate how?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
Ghoti



Joined: 31 Dec 2005
Posts: 288

PostPosted: Mon Jan 23, 2006 9:37 pm    Post subject: Framerate how? Reply with quote

Hi folks,

I have a question. How can you calculate the framerate?

i need the function that get the current time.

this way i can save it loop through the game 1 frame. compare the new time with the old time. see how much time has passed in 1 frame with that i can calculate the steps of my enemies and there speed.

what function do i need to get the time?

greets Ghoti
_________________
My PSP games:

Boxy II: http://www.ghoti.nl/boxyii.php
Elementals: http://www.ghoti.nl/Elementals.php
Back to top
View user's profile Send private message
weltall



Joined: 20 Feb 2004
Posts: 310

PostPosted: Wed Jan 25, 2006 3:43 am    Post subject: Reply with quote

you could use the cputicks or the timer function which were posted somewhere around with a timer manager.
you could also measure vsinc which are of a precise number/s for the same standard (they differs beetween pal and ntsc)
Back to top
View user's profile Send private message Visit poster's website
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Thu Jan 26, 2006 5:57 am    Post subject: Reply with quote

Woops, I swore I replied to this the other day...

There is a cdReadClock call that will return the current time, however it is an EXTREMELY expensive call and should be avoided.

Setting up a timer is probably the most accurate and one of the fastest (performancewise) ways to go..
For an example, I think quake_ps2 uses timers to track the time, but I haven't looked so I could be wrong and I dunno if it's a good example or not.

Counting vblanks is an easy way to setup, but you have to worry about what TV standard is being used.
_________________
Shoot Pixels Not People!
Makeshift Development
Back to top
View user's profile Send private message Visit poster's website
Ghoti



Joined: 31 Dec 2005
Posts: 288

PostPosted: Thu Jan 26, 2006 6:17 am    Post subject: Reply with quote

Ohw sorry sorry i posted this in the wrong forum is has to be in the PSP software section.
sorry
_________________
My PSP games:

Boxy II: http://www.ghoti.nl/boxyii.php
Elementals: http://www.ghoti.nl/Elementals.php
Back to top
View user's profile Send private message
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Thu Jan 26, 2006 6:52 am    Post subject: Reply with quote

Um... wow. The answer would be entirely different then :P
_________________
Shoot Pixels Not People!
Makeshift Development
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group