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

Render dimmed DMD using shaded palette #392

Merged
merged 1 commit into from
Dec 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/wpc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2013,6 +2013,8 @@ static void drawChar(struct mame_bitmap *bitmap, int row, int col, UINT16 seg_bi
}
}

#define DMD_PAL(x) ((unsigned int)sizeof(core_palette)/3u - 48u + ((unsigned int)(x) * 47u) / 255u) // The trail of PinMAME palette has 48 DMD dot shades
const UINT8 lum4[] = { 0, 85, 170, 255 };
for (kk = 0; kk < s->rows; kk++) {
BMTYPE * __restrict line = &((BMTYPE **)(bitmap->line))[row+kk][col + s->cols];
// size is limited to 15 cols
Expand All @@ -2021,11 +2023,13 @@ static void drawChar(struct mame_bitmap *bitmap, int row, int col, UINT16 seg_bi
for (ll = 0; ll < s->cols; ll++, p >>= 2, np >>= 2)
{
if (p & 0x03) // segment set?
*(--line) = dimming ? dim_LUT[(p & 0x03)-1][dim[kk][ll]] : Machine->pens[palSize - 33 + (3 - (p & 0x03))*16];
//*(--line) = dimming ? dim_LUT[(p & 0x03)-1][dim[kk][ll]] : Machine->pens[palSize - 33 + (3 - (p & 0x03))*16];
*(--line) = dimming ? DMD_PAL((dim[kk][ll] * (4u - (p & 3))) / 3u) : DMD_PAL(((4u - (p & 3)) * 255u) / 3u);
else
*(--line) = Machine->pens[offPens[np & 0x03]];
}
}
#undef DMD_PAL
}


Expand Down
Loading