Framerate how?

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
Ghoti
Posts: 288
Joined: Sat Dec 31, 2005 11:06 pm

Framerate how?

Post by Ghoti »

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
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

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)
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

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
Ghoti
Posts: 288
Joined: Sat Dec 31, 2005 11:06 pm

Post by Ghoti »

Ohw sorry sorry i posted this in the wrong forum is has to be in the PSP software section.
sorry
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

Um... wow. The answer would be entirely different then :P
Shoot Pixels Not People!
Makeshift Development
Post Reply