Fix endianess issue with camera setting data #3950
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
![cam-modes-before](https://private-user-images.githubusercontent.com/13861068/305734289-837f8976-22d1-4242-8336-2a3d28d8e0a2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNjk0OTMsIm5iZiI6MTczOTM2OTE5MywicGF0aCI6Ii8xMzg2MTA2OC8zMDU3MzQyODktODM3Zjg5NzYtMjJkMS00MjQyLTgzMzYtMmEzZDI4ZDhlMGEyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDE0MDYzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM3ODlkMTIwNzdhZDg5NGZkZjZiNDYzYzlmZmU1NjEzMzM5ZmE0MjVjOTY2OTJlNmM5Mjg4ZWRlZjM3ZmU3OGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.2MQRGZRh0xjQs8gSxBq7mlC1_MVfNe5W-LxUapRl_kg)
Before:
After:
![cam-mode-after](https://private-user-images.githubusercontent.com/13861068/305734276-2c380cf9-7a06-4706-b5a5-74b4bafc73fd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNjk0OTMsIm5iZiI6MTczOTM2OTE5MywicGF0aCI6Ii8xMzg2MTA2OC8zMDU3MzQyNzYtMmMzODBjZjktN2EwNi00NzA2LWI1YTUtNzRiNGJhZmM3M2ZkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDE0MDYzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZjY2UwODUwODRmYThhNTZjNjllMDI2YjZlNGJiY2IxNTNjZDkxYjc1MjA3ZDEwYzc1M2MyZDdjMDM5MDgzNGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.sVIR1I6yqqYyDq5h2StKKdlzkddj9FJXg5u7TRZES4k)
Build Artifacts