NicoHood / Nintendo

Use Nintendo Controllers with Arduino
http://www.nicohood.de
MIT License
283 stars 56 forks source link

fix half-byte data structure endianness to fix Luigi's Mansion triggers #67

Open CarVac opened 5 months ago

CarVac commented 5 months ago

AVR is little-endian, so within each byte the LSB must come first even though the MSB goes over the wire first.

Mode 0 was supposedly tested with Pokemon XD, but XD uses digital press, not analog, so it's not a good test.

In Luigi's Mansion, L and R functions were switched.

This was borne out looking at the data line on an oscilloscope with an OEM controller, an Arduino based digital controller, and a Phob 2 (RP2040 using Pico-Rectangle's comms).

Thanks to @mizuyoukanao for trying to port the alternate modes over to PhobGCC-SW, and Skozzy for reporting the issue in Luigi's Mansion.