Hi PSXDev!
I'm trying to get the FPS limit, and I can't find out in "LIBREF46.PDF".
Just use something like this: "FntPrint("%s",getFPS())".
Is it possible?
Trying to get the FPS limit
- MihaiGamerXD
- Active PSXDEV User
- Posts: 38
- Joined: Mar 09, 2019
- I am a: Programmer
- PlayStation Model: SCPH-1001
- MihaiGamerXD
- Active PSXDEV User
- Posts: 38
- Joined: Mar 09, 2019
- I am a: Programmer
- PlayStation Model: SCPH-1001
Found out for myself how to get.
And it gives me 14 FPS?! How can I set it back to 60 FPS?
Code: Select all
"FntPrint(~c666%d",VSync(0));
-
LameGuy64 Verified
- Psy-Q Enthusiast
- Posts: 388
- Joined: Apr 10, 2013
- I am a: Hobbyist Game Developer
- Motto: Commercial or not, play it!
- PlayStation Model: H2000/7000
- Location: Philippines
- Contact:
You need to install a VSync callback which will run a counter, and update a variable that will be your FPS from a variable that is updated constantly on every screen update.
fps will contain the frames per second your application is running at, updated every second.
Code: Select all
volatile int fps;
volatile int fps_counter;
volatile int fps_measure;
void vsync_cb(void) {
fps_counter++;
if( fps_counter > 60 ) {
fps = fps_measure;
fps_measure = 0;
fps_counter = 0;
}
}
int main() {
...
VSyncCallback(vsync_cb);
while(1) {
...
< your display update code >
fps_measure++;
...
}
...
}
Please don't forget to include my name if you share my work around. Credit where it is due.
Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.
DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.
Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.
DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.
- MihaiGamerXD
- Active PSXDEV User
- Posts: 38
- Joined: Mar 09, 2019
- I am a: Programmer
- PlayStation Model: SCPH-1001
Thanks Lameguy64! It worked, but It works at max 61 FPS, So you'll have to do is to change:LameGuy64 wrote: ↑August 24th, 2019, 12:33 pm You need to install a VSync callback which will run a counter, and update a variable that will be your FPS from a variable that is updated constantly on every screen update.
fps will contain the frames per second your application is running at, updated every second.Code: Select all
volatile int fps; volatile int fps_counter; volatile int fps_measure; void vsync_cb(void) { fps_counter++; if( fps_counter > 60 ) { fps = fps_measure; fps_measure = 0; fps_counter = 0; } } int main() { ... VSyncCallback(vsync_cb); while(1) { ... < your display update code > fps_measure++; ... } ... }
Code: Select all
if( fps_counter > 60 ) {
Code: Select all
if( fps_counter >= 60 ) {
Who is online
Users browsing this forum: No registered users and 3 guests