Skip to content

Commit

Permalink
neogeo, improve color accuracy with the missing 'dark' bit
Browse files Browse the repository at this point in the history
  • Loading branch information
dinkc64 committed Aug 20, 2023
1 parent c700bd9 commit b2e2e7f
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/burn/drv/neogeo/neo_palette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,24 @@ inline static UINT32 CalcCol(UINT16 nColour)
{
INT32 r = (nColour & 0x0F00) >> 4; // Red
r |= (nColour >> 11) & 8;
INT32 g = (nColour & 0x00F0); // Green
r |= (nColour >> 13) & 4; // Red: add "dark" bit
INT32 g = (nColour & 0x00F0); // Green
g |= (nColour >> 10) & 8;
g |= (nColour >> 13) & 4;
INT32 b = (nColour & 0x000F) << 4; // Blue
b |= (nColour >> 9) & 8;
b |= (nColour >> 13) & 4;

r |= r >> 5;
g |= g >> 5;
b |= b >> 5;
// our current color mask is 0xfc (6 bits)
// shift down and OR to fill in the low 2 bits
r |= r >> 6;
g |= g >> 6;
b |= b >> 6;

if (bNeoDarkenPalette) {
r /= 2;
g /= 2;
b /= 2;
r >>= 1;
g >>= 1;
b >>= 1;
}

return BurnHighCol(r, g, b, 0);
Expand Down

0 comments on commit b2e2e7f

Please sign in to comment.