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 endianess issue with camera setting data #3950

Merged

Conversation

Archez
Copy link
Contributor

@Archez Archez commented Feb 18, 2024

The camera settings struct was using a union member and bitfield flags to pack a single 32bit int as multiple values. This assumes Big Endian (N64 hardware). On Little Endian systems, this led to validModes being shifted by 2 bits causing some validation functions to behave incorrectly (couldn't C-Up in the fishing pond or bombchu bowling lobby).

The other two single bit values are unused, so I've decided to just remove them and the bitfield flags so that validModes is just treated as the full 32bit value. This fixes #1253.

I've also confirmed this change works on Wii U (Big Endian).

Here is a print out of some of the values before and after, with the first person mode highlighted.
Before:
cam-modes-before

After:
cam-mode-after

Build Artifacts

@briaguya-ai
Copy link
Contributor

dev only issue or should this fix point to macready?

@Archez
Copy link
Contributor Author

Archez commented Feb 18, 2024

dev only issue or should this fix point to macready?

It's an SoH always issue. Probably could target macready with this yea

@Archez Archez changed the base branch from develop to develop-macready February 18, 2024 23:09
@Archez
Copy link
Contributor Author

Archez commented Feb 18, 2024

Updated the base.

@garrettjoecox garrettjoecox merged commit ef9fc0a into HarbourMasters:develop-macready Feb 20, 2024
8 checks passed
@Archez Archez deleted the fix-camera-mode-data branch February 23, 2024 21:57
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.

Unable to enter first person view in several non pre-rendered Castle Town indoor areas
4 participants