diff -ruN libcwiid-orig/cwiid_internal.h libcwiid/cwiid_internal.h
|
old
|
new
|
|
| 117 | 117 | #define EXT_PARTIAL 0xFF |
| 118 | 118 | #define EXT_NUNCHUK 0x00 |
| 119 | 119 | #define EXT_CLASSIC 0x01 |
| | 120 | #define EXT_CLASSIC_FAKE 0x2D /* some third party classic controllers seems to have this ID */ |
| 120 | 121 | |
| 121 | 122 | /* IR Enable blocks */ |
| 122 | 123 | #define MARCAN_IR_BLOCK_1 "\x00\x00\x00\x00\x00\x00\x90\x00\xC0" |
diff -ruN libcwiid-orig/process.c libcwiid/process.c
|
old
|
new
|
|
| 216 | 216 | classic_mesg->r_stick[CWIID_X] = (data[0] & 0xC0)>>3 | |
| 217 | 217 | (data[1] & 0xC0)>>5 | |
| 218 | 218 | (data[2] & 0x80)>>7; |
| | 219 | if (classic_mesg->l_stick[CWIID_X] < 30) |
| | 220 | classic_mesg->l_stick[CWIID_X] -= |
| | 221 | 7-(7*(100-(29-classic_mesg->l_stick[CWIID_X])*4)/100); |
| | 222 | if (classic_mesg->r_stick[CWIID_X] < 20) |
| | 223 | classic_mesg->r_stick[CWIID_X] = |
| | 224 | (classic_mesg->r_stick[CWIID_X]-1)*0.8334; |
| | 225 | else if (classic_mesg->r_stick[CWIID_X] > 19) |
| | 226 | classic_mesg->r_stick[CWIID_X] -= |
| | 227 | 4-(4*(100-(31-classic_mesg->r_stick[CWIID_X])*7)/100); |
| 219 | 228 | classic_mesg->r_stick[CWIID_Y] = data[2] & 0x1F; |
| 220 | 229 | classic_mesg->l = (data[2] & 0x60)>>2 | |
| 221 | 230 | (data[3] & 0xE0)>>5; |
| | 231 | classic_mesg->l *= 1.15; |
| 222 | 232 | classic_mesg->r = data[3] & 0x1F; |
| 223 | 233 | classic_mesg->buttons = ~((uint16_t)data[4]<<8 | |
| 224 | 234 | (uint16_t)data[5]); |
diff -ruN libcwiid-orig/thread.c libcwiid/thread.c
|
old
|
new
|
|
| 214 | 214 | status_mesg->ext_type = CWIID_EXT_NUNCHUK; |
| 215 | 215 | break; |
| 216 | 216 | case EXT_CLASSIC: |
| | 217 | case EXT_CLASSIC_FAKE: |
| 217 | 218 | status_mesg->ext_type = CWIID_EXT_CLASSIC; |
| 218 | 219 | break; |
| 219 | 220 | default: |
| | 221 | printf("Unknown extension connected: 0x%X\n", buf); |
| 220 | 222 | status_mesg->ext_type = CWIID_EXT_UNKNOWN; |
| 221 | 223 | break; |
| 222 | 224 | } |