Update wup028_adapter.cpp

This commit is contained in:
GalaxisBeast
2026-08-26 15:55:57 -04:00
parent 9ee14e582d
commit 8ba44162fa
+6 -1
View File
@@ -239,6 +239,7 @@ bool RefreshInputStream(Device& device) {
void ClearConnectedPorts(const char* reason) {
std::lock_guard lock(g_mutex);
g_rumble.fill(0);
for (size_t port = 0; port < g_info.ports.size(); ++port) {
if (g_info.ports[port]) {
g_info.ports[port] = false;
@@ -387,7 +388,11 @@ bool Read(std::array<PADStatus, 4>& statuses) {
bool SetRumble(uint32_t port, bool enabled) {
if (port >= g_rumble.size() || !g_connected.load(std::memory_order_acquire)) return false;
std::lock_guard lock(g_mutex);
if (!g_connected.load(std::memory_order_acquire) || g_statuses[port].err != PAD_ERR_NONE) return false;
if (!g_connected.load(std::memory_order_acquire)) return false;
if (g_statuses[port].err != PAD_ERR_NONE) {
g_rumble[port] = 0;
return false;
}
g_rumble[port] = enabled ? 1 : 0;
return true;
}