1
0
mirror of https://github.com/mcgurk/Arduino-USB-HID-RetroJoystickAdapter synced 2024-12-22 07:28:53 -05:00

Update RetroJoystickAdapter_Playstation_XB360.ino

This commit is contained in:
Jarno Lehtinen 2021-01-18 22:34:40 +02:00 committed by GitHub
parent 6fcf4c35b5
commit 6ad543e652
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,10 +54,11 @@
#define PS_O (data[1] & ( 1 << 5 ))
#define PS_X (data[1] & ( 1 << 6 ))
#define PS_S (data[1] & ( 1 << 7 ))
#define PS_LX ((data[4]-128)*256)
#define PS_LY ((-data[5]+127)*256)
#define PS_RX ((data[2]-128)*256)
#define PS_RY ((-data[3]+127)*256)
#define PS_LX (((uint16_t)data[4]*257)-32768) // 0..255 -> -32768..32767
#define PS_LY (((255-(uint16_t)data[5])*257)-32768) // 0..255 -> 32767..-32768
#define PS_RX (((uint16_t)data[2]*257)-32768) // 0..255 -> -32768..32767
#define PS_RY (((255-(uint16_t)data[3])*257)-32768) // 0..255 -> 32767..-32768
uint8_t head;
uint8_t type;