Skip to content

Palette DAC conversion fixes #1714

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

DankRank
Copy link
Contributor

First two commits deal with conversion from 6-bit VGA DAC color values to 8-bit RGB. The original routine shifted the bits to the left, leaving the two bottom bits cleared, which results in a slight bias towards black in the output. This PR remedies this by using a linear formula that maps 0-63 to 0-255. Admittedly, this is a very pedantic fix with almost no discernible visual difference.

Third commit documents how gammatable was generated.

The original VGA DAC values are 1, 5, 16 (decimal).
64.5/255 < 16/63 < 65.5/255
Therefore 65 (0x41) is a better approximation for the blue component.

The rest of the text mode palette had similar inaccuracies, which were
fixed in PR chocolate-doom#1659 (issue chocolate-doom#1658).
The difference is in the two least-significant bits.
Also includes the corresponding gamma decoding values for each gamma
correction level.
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