mirror of
https://github.com/mcgurk/Arduino-USB-HID-RetroJoystickAdapter
synced 2024-11-24 01:52:17 -05:00
Update RetroJoystickAdapter_PsxNewLib_XB360.ino
This commit is contained in:
parent
53d0a5ac91
commit
26ac21030c
@ -212,7 +212,7 @@ void setup () {
|
||||
}
|
||||
|
||||
void loop () {
|
||||
static byte slx, sly, srx, sry;
|
||||
static byte slx, sly, srx, sry, sl2, sr2;
|
||||
fastDigitalWrite (PIN_HAVECONTROLLER, haveController);
|
||||
|
||||
if (!haveController) {
|
||||
@ -292,6 +292,27 @@ void loop () {
|
||||
srx = rx;
|
||||
sry = ry;
|
||||
}
|
||||
|
||||
byte l2 = psx.getAnalogButton(PSAB_L2);
|
||||
if (l2 != 0 && l2 != sl2) {
|
||||
#ifdef DEBUG
|
||||
Serial.println(l2);
|
||||
#endif
|
||||
XInput.setTrigger(TRIGGER_LEFT, l2);
|
||||
dirty = true;
|
||||
sl2 = l2;
|
||||
}
|
||||
|
||||
byte r2 = psx.getAnalogButton(PSAB_R2);
|
||||
if (r2 != 0 && r2 != sr2) {
|
||||
#ifdef DEBUG
|
||||
Serial.println(r2);
|
||||
#endif
|
||||
XInput.setTrigger(TRIGGER_RIGHT, r2);
|
||||
dirty = true;
|
||||
sr2 = r2;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user