From 397e1fa649cb9e9ff2fc06b63d4e0801868cc072 Mon Sep 17 00:00:00 2001 From: "Daniel K. O. (dkosmari)" Date: Thu, 13 Feb 2025 21:18:16 -0300 Subject: [PATCH] Block `VPADRead()` only for Hyrule Warriors. --- source/patcher/hooks_patcher_static.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/patcher/hooks_patcher_static.cpp b/source/patcher/hooks_patcher_static.cpp index 7d28c00..6213b01 100644 --- a/source/patcher/hooks_patcher_static.cpp +++ b/source/patcher/hooks_patcher_static.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -93,8 +94,14 @@ DECL_FUNCTION(int32_t, VPADRead, int32_t chan, VPADStatus *buffer, uint32_t buff if (gConfigMenuOpened) { // Ignore reading vpad input only from other threads if the config menu is opened if (OSGetCurrentThread() != gOnlyAcceptFromThread) { - while (gConfigMenuOpened) - OSSleepTicks(OSMillisecondsToTicks(10)); + // Quick fix for Hyrule Warriors: block VPADRead() in non-rendering threads. + switch (OSGetTitleID()) { + case 0x00050000'1017CD00: // Hyrule Warriors JPN + case 0x00050000'1017D800: // Hyrule Warriors USA + case 0x00050000'1017D900: // Hyrule Warriors EUR + while (gConfigMenuOpened) + OSSleepTicks(OSMillisecondsToTicks(10)); + } return 0; } }