Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CarVac
Copy link

@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