Tweaked input latency patch to help prevent microstutters, updated RT64

This commit is contained in:
Mr-Wiseguy 2024-04-02 18:21:05 -04:00
parent 2e4988da2b
commit fcc4eb6351
3 changed files with 10 additions and 4 deletions

@ -1 +1 @@
Subproject commit 3ae6485d70e9899587b2afdb7551b9256f6427be
Subproject commit c9f38195ef1a6d56953957dc2ad84049a146818d

View File

@ -153,11 +153,16 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx, GameState* gameState) {
// @recomp Wait on the VI framebuffer to change if this task has a framebuffer swap.
if (scTask->flags & OS_SC_SWAPBUFFER) {
while (osViGetCurrentFramebuffer_recomp() != cfb->fb1) {
int viCounter = 0;
while (osViGetCurrentFramebuffer() != cfb->fb1) {
osRecvMesg(&vi_queue, NULL, OS_MESG_BLOCK);
viCounter++;
}
// If we didn't wait the full number of VIs needed between frames then wait one extra VI afterwards.
if (viCounter < gameState->framerateDivisor) {
osRecvMesg(&vi_queue, NULL, OS_MESG_BLOCK);
}
// Wait one extra VI afterwards.
osRecvMesg(&vi_queue, NULL, OS_MESG_BLOCK);
}
// @recomp Flush any extra messages from the VI queue.

View File

@ -5,6 +5,7 @@
#define osCreateMesgQueue osCreateMesgQueue_recomp
#define osRecvMesg osRecvMesg_recomp
#define osSendMesg osSendMesg_recomp
#define osViGetCurrentFramebuffer osViGetCurrentFramebuffer_recomp
#define sinf __sinf_recomp
#define cosf __cosf_recomp
#define gRandFloat sRandFloat