Nintendo
Nintendo copied to clipboard
fix half-byte data structure endianness to fix Luigi's Mansion triggers
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.