Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@fjtrujy
Copy link
Member

@fjtrujy fjtrujy commented Jun 27, 2025

Description

This PR adds a sample to gu directory to force a 30 FPS app by using double vsync

@sharkwouter
Copy link
Member

Could you explain how this code works? I'm a bit confused. What makes the sema do something?

@fjtrujy
Copy link
Member Author

fjtrujy commented Jul 1, 2025

Could you explain how this code works? I'm a bit confused. What makes the sema do something?

With the sceKernelRegisterSubIntrHandler(PSP_VBLANK_INT, 0, on_vblank, NULL);, the on_vblank function is going to be executed each PSP_VBLANK_INT interruption.

To force 30 FPS, we must ensure the VBLANK interruption happens exactly twice, in order to achieve this, I have used 2 semaphores, so before swapping buffers, we need to ensure that both semaphores are being signaled already, and this is what vsync30 method does.

The reason why I'm creating this example is because there are plenty of games whose FPS are set to 30FPS (as SuperMario 64), so this is just an example of how we could implement this.

@sharkwouter
Copy link
Member

Ah okay, that makes sense. Would it be possible to add some additional comments to clarify this?

@fjtrujy
Copy link
Member Author

fjtrujy commented Jul 1, 2025

Ah okay, that makes sense. Would it be possible to add some additional comments to clarify this?

Added as a comment at the top of the example file

@fjtrujy fjtrujy merged commit 1e5d2f1 into pspdev:master Jul 1, 2025
1 check passed
@fjtrujy fjtrujy deleted the sample_30fps branch July 1, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants