CDolphinController: rename known field

This commit is contained in:
Phillip Stephens 2022-03-20 13:30:56 -07:00
parent be79334465
commit 22c9b55300
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
2 changed files with 8 additions and 8 deletions

View File

@ -51,10 +51,10 @@ void CDolphinController::ReadDevices() {
} }
} }
if (x1b4_[i] == 0) { if (x1b4_controllerTypePollTime[i] == 0) {
const auto type = SIProbe(i); const auto type = SIProbe(i);
if ((type & (SI::ERROR_NO_RESPONSE | SI::ERROR_UNKNOWN | SI::ERROR_BUSY)) == 0) { if ((type & (SI::ERROR_NO_RESPONSE | SI::ERROR_UNKNOWN | SI::ERROR_BUSY)) == 0) {
x1b4_[i] = 0x3c; x1b4_controllerTypePollTime[i] = 0x3c;
if (type == SI::GC_WIRELESS) { if (type == SI::GC_WIRELESS) {
x1a4_controllerTypes[i] = skTypeWavebird; x1a4_controllerTypes[i] = skTypeWavebird;
} else if (type == SI::GBA) { /* here for completeness, the GameCube adapter does not support GBA */ } else if (type == SI::GBA) { /* here for completeness, the GameCube adapter does not support GBA */
@ -66,7 +66,7 @@ void CDolphinController::ReadDevices() {
x1a4_controllerTypes[i] = skTypeUnknown; x1a4_controllerTypes[i] = skTypeUnknown;
} }
} else { } else {
--x1b4_[i]; --x1b4_controllerTypePollTime[i];
} }
} }
@ -163,19 +163,19 @@ bool CDolphinController::Initialize() {
memset(x4_status.data(), 0, sizeof(PADStatus) * x4_status.size()); memset(x4_status.data(), 0, sizeof(PADStatus) * x4_status.size());
x34_gamepadStates[0].SetDeviceIsPresent(false); x34_gamepadStates[0].SetDeviceIsPresent(false);
x194_motorStates[0] = EMotorState::StopHard; x194_motorStates[0] = EMotorState::StopHard;
x1b4_[0] = 0; x1b4_controllerTypePollTime[0] = 0;
x1a4_controllerTypes[0] = skTypeUnknown; x1a4_controllerTypes[0] = skTypeUnknown;
x34_gamepadStates[1].SetDeviceIsPresent(false); x34_gamepadStates[1].SetDeviceIsPresent(false);
x194_motorStates[1] = EMotorState::StopHard; x194_motorStates[1] = EMotorState::StopHard;
x1b4_[1] = 0; x1b4_controllerTypePollTime[1] = 0;
x1a4_controllerTypes[0] = skTypeUnknown; x1a4_controllerTypes[0] = skTypeUnknown;
x34_gamepadStates[2].SetDeviceIsPresent(false); x34_gamepadStates[2].SetDeviceIsPresent(false);
x194_motorStates[2] = EMotorState::StopHard; x194_motorStates[2] = EMotorState::StopHard;
x1b4_[2] = 0; x1b4_controllerTypePollTime[2] = 0;
x1a4_controllerTypes[0] = skTypeUnknown; x1a4_controllerTypes[0] = skTypeUnknown;
x34_gamepadStates[3].SetDeviceIsPresent(false); x34_gamepadStates[3].SetDeviceIsPresent(false);
x194_motorStates[3] = EMotorState::StopHard; x194_motorStates[3] = EMotorState::StopHard;
x1b4_[3] = 0; x1b4_controllerTypePollTime[3] = 0;
x1a4_controllerTypes[0] = skTypeUnknown; x1a4_controllerTypes[0] = skTypeUnknown;
PADControlAllMotors(reinterpret_cast<const u32*>(x194_motorStates.data())); PADControlAllMotors(reinterpret_cast<const u32*>(x194_motorStates.data()));
Poll(); Poll();

View File

@ -15,7 +15,7 @@ class CDolphinController : public IController {
std::array<CControllerGamepadData, 4> x34_gamepadStates{}; std::array<CControllerGamepadData, 4> x34_gamepadStates{};
std::array<EMotorState, 4> x194_motorStates{}; std::array<EMotorState, 4> x194_motorStates{};
std::array<u32, 4> x1a4_controllerTypes{}; std::array<u32, 4> x1a4_controllerTypes{};
std::array<u32, 4> x1b4_{}; std::array<u32, 4> x1b4_controllerTypePollTime{};
u32 x1c4_ = 0xf0000000; u32 x1c4_ = 0xf0000000;
u32 x1c8_invalidControllers = 0; u32 x1c8_invalidControllers = 0;
u32 x1cc_ = 0; u32 x1cc_ = 0;