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 interpolation issues on HW #1802

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

eliasdaler
Copy link
Contributor

@eliasdaler eliasdaler commented Nov 17, 2024

Had an issue that only showed up on HW and now in emulators. Turns out it was caused by unsafe write before dpct.
https://github.com/user-attachments/assets/aec0b48b-a2d5-4cce-ae55-ec48a3939f64
(the flickering vertex colors when doing interpolation)

Also added some safeguards against bad psyqo::Color being passed into the primitives when it can potentially affect the command (e.g. in setColor/setColorA).
E.g. consider this case:

psyqo::Color c;
c.r = 0xAB;
c.g = 0xCD;
c.b = 0xEF;
// the value of c.packed is <??>EFCDAB

Or you could possibly read the color from some RGB register and if it has the MSB set... you'd get tons of corruptions and crashes on HW. To prevent that, we need to mask away those potentially "dirty" bits in everything.

Also safeguard against bad psyqo::Color being passed into the primitives
when it can potentially affect the command (e.g. in setColor/setColorA).
@nicolasnoble nicolasnoble merged commit 3c9b655 into grumpycoders:main Nov 18, 2024
16 checks passed
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.

2 participants