Skip to content

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

Open
CarVac wants to merge 1 commit intoNicoHood:masterfrom
CarVac:master
Open

fix half-byte data structure endianness to fix Luigi's Mansion triggers#67
CarVac wants to merge 1 commit intoNicoHood:masterfrom
CarVac:master

Conversation

@CarVac
Copy link
Copy Markdown

@CarVac CarVac commented May 4, 2024

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.

AVR is little-endian, so within each byte the LSB must come 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 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant