mirror of
https://github.com/patchzyy/wiicompiled
synced 2026-09-10 09:11:52 -04:00
Update wup028_adapter.cpp
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user