mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2026-03-21 17:25:21 -05:00
Block on VPADRead() while the plugin menu is open.
This commit is contained in:
parent
9aa660a302
commit
670329db60
|
|
@ -8,8 +8,10 @@
|
|||
#include "plugin/SectionInfo.h"
|
||||
#include "utils/config/ConfigUtils.h"
|
||||
|
||||
#include <coreinit/cache.h>
|
||||
#include <coreinit/core.h>
|
||||
#include <coreinit/messagequeue.h>
|
||||
#include <coreinit/time.h>
|
||||
#include <padscore/wpad.h>
|
||||
#include <vpad/input.h>
|
||||
|
||||
|
|
@ -21,9 +23,11 @@ DECL_FUNCTION(void, GX2SwapScanBuffers, void) {
|
|||
|
||||
if (sWantsToOpenConfigMenu && !gConfigMenuOpened) {
|
||||
gConfigMenuOpened = true;
|
||||
OSMemoryBarrier();
|
||||
ConfigUtils::openConfigMenu();
|
||||
gConfigMenuOpened = false;
|
||||
sWantsToOpenConfigMenu = false;
|
||||
OSMemoryBarrier();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -89,6 +93,8 @@ 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));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#include <wups/config.h>
|
||||
#include <wups/hooks.h>
|
||||
|
||||
#include <coreinit/cache.h>
|
||||
#include <coreinit/title.h>
|
||||
#include <sysapp/launch.h>
|
||||
|
||||
|
|
@ -165,6 +166,7 @@ void ConfigUtils::displayMenu() {
|
|||
bool skipFirstInput = true;
|
||||
|
||||
gOnlyAcceptFromThread = OSGetCurrentThread();
|
||||
OSMemoryBarrier();
|
||||
ConfigSubState subStateReturnValue = SUB_STATE_ERROR;
|
||||
while (true) {
|
||||
startTime = OSGetTime();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user