How do I get framerate/timing without LibGS?

General Programming help in C, C++ or ASM, Compiling / Debugging, and R3000A Central Processing Unit (CPU) information
Post Reply
User avatar
ArthCarvalho
Active PSXDEV User
Active PSXDEV User
Posts: 45
Joined: Jan 29, 2016
I am a: Artist, Programmer
PlayStation Model: SCPH-103

How do I get framerate/timing without LibGS?

Post by ArthCarvalho » November 19th, 2019, 5:34 pm

I want to check how my code is performing on the real hardware, but I have no idea how to get the current framerate, or anything else that I could use to profile my code.
LibGS had GsGetVcount() but I have no idea how to implement this by myself.

User avatar
MrQuetch
Active PSXDEV User
Active PSXDEV User
Posts: 42
Joined: Apr 01, 2018
I am a: Programmer and artist.
Motto: You can accomplish anything.
Location: United States

Post by MrQuetch » February 23rd, 2020, 1:21 pm

ArthCarvalho wrote: November 19th, 2019, 5:34 pm I want to check how my code is performing on the real hardware, but I have no idea how to get the current framerate, or anything else that I could use to profile my code.
LibGS had GsGetVcount() but I have no idea how to implement this by myself.
I was wondering how one could get a 'time' from whence the console started. This honestly would suffice for now. Well, looking at LIBREF46.PDF, the 'GsGetVcount' function returns a long. You could try using a 'printf' statement in your game-loop to see the current value of the vertical retrace. I tried this, and it worked perfectly:

printf("GsGetVcount: %d \n", GsGetVcount());

Unless, this isn't what you meant by 'having no idea how to implement this yourself'? I imagine you could have a variable (like 'currentFrame') and another one (like 'previousFrame') and subtract one from the other to see how many vertical retraces took place between the two. I'm certain you could get a good set of averages that way.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests