yuzu-emu
/
yuzu-android
Archived
1
0
Fork 0

Recalibrate reconnected controllers

This commit is contained in:
Ameer 2020-07-06 22:09:07 -04:00
parent 7ad423923d
commit 86abff48e1
1 changed files with 5 additions and 0 deletions

View File

@ -49,6 +49,11 @@ GCPadStatus Adapter::GetPadStatus(int port, const std::array<u8, 37>& adapter_pa
PadButton::PAD_TRIGGER_L, PadButton::PAD_TRIGGER_L,
}; };
if (adapter_controllers_status[port] == ControllerTypes::None && !get_origin[port]) {
// Controller may have been disconnected, recalibrate if reconnected.
get_origin[port] = true;
}
if (adapter_controllers_status[port] != ControllerTypes::None) { if (adapter_controllers_status[port] != ControllerTypes::None) {
const u8 b1 = adapter_payload[1 + (9 * port) + 1]; const u8 b1 = adapter_payload[1 + (9 * port) + 1];
const u8 b2 = adapter_payload[1 + (9 * port) + 2]; const u8 b2 = adapter_payload[1 + (9 * port) + 2];