From 13c79e1e509e95d80715000f9da113bd72c73027 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 15 Aug 2023 08:22:41 +1000 Subject: [PATCH] Wii/GameCube: Some fixes (Thanks AndrewPH) Fix all FPS modes waiting for vblank, instead of just the default vsync mode Fix input issues when only GameCube controller connected (this was because the game was wrongly acting like a Wiimote with 0 buttons held was also connected, causing input to constantly toggle between the two) --- src/Graphics_GCWii.c | 3 ++- src/Window_GCWii.c | 13 ++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Graphics_GCWii.c b/src/Graphics_GCWii.c index 00571b8c2..50968bf71 100644 --- a/src/Graphics_GCWii.c +++ b/src/Graphics_GCWii.c @@ -260,7 +260,8 @@ void Gfx_EndFrame(void) { VIDEO_SetNextFramebuffer(xfbs[curFB]); VIDEO_Flush(); - VIDEO_WaitVSync(); + + if (gfx_vsync) VIDEO_WaitVSync(); if (gfx_minFrameMs) LimitFPS(); } diff --git a/src/Window_GCWii.c b/src/Window_GCWii.c index 803e68950..11a80bcd6 100644 --- a/src/Window_GCWii.c +++ b/src/Window_GCWii.c @@ -309,14 +309,12 @@ static void ProcessKeyboardInput(void) { if (ke.symbol) Event_RaiseInt(&InputEvents.Press, ke.symbol); } } - -void Window_ProcessEvents(double delta) { - Input.JoystickMovement = false; - +static void ProcessWPADInput(double delta) { WPAD_ScanPads(); u32 mods = WPAD_ButtonsDown(0) | WPAD_ButtonsHeld(0); u32 type; int res = WPAD_Probe(0, &type); + if (res) return; if (launcherMode) { ProcessWPAD_Launcher(mods); @@ -341,7 +339,12 @@ void Window_ProcessEvents(double delta) { dragActive = false; } Pointer_SetPosition(0, x, y); - +} + +void Window_ProcessEvents(double delta) { + Input.JoystickMovement = false; + + ProcessWPADInput(delta); ProcessPADInput(); ProcessKeyboardInput(); }