diff options
Diffstat (limited to 'src/mame/video/kopunch.cpp')
-rw-r--r-- | src/mame/video/kopunch.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/mame/video/kopunch.cpp b/src/mame/video/kopunch.cpp index 50538bfc934..15479271459 100644 --- a/src/mame/video/kopunch.cpp +++ b/src/mame/video/kopunch.cpp @@ -12,7 +12,7 @@ #include "includes/kopunch.h" -PALETTE_INIT_MEMBER(kopunch_state, kopunch) +void kopunch_state::kopunch_palette(palette_device &palette) const { const uint8_t *color_prom = memregion("proms")->base(); @@ -20,23 +20,23 @@ PALETTE_INIT_MEMBER(kopunch_state, kopunch) for (int i = 0; i < palette.entries(); i++) { - int bit0, bit1, bit2, r, g, b; - - /* red component */ - bit0 = (*color_prom >> 0) & 0x01; - bit1 = (*color_prom >> 1) & 0x01; - bit2 = (*color_prom >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* green component */ - bit0 = (*color_prom >> 3) & 0x01; - bit1 = (*color_prom >> 4) & 0x01; - bit2 = (*color_prom >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* blue component */ + int bit0, bit1, bit2; + + // red component + bit0 = BIT(*color_prom, 0); + bit1 = BIT(*color_prom, 1); + bit2 = BIT(*color_prom, 2); + int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + // green component + bit0 = BIT(*color_prom, 3); + bit1 = BIT(*color_prom, 4); + bit2 = BIT(*color_prom, 5); + int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + // blue component bit0 = 0; - bit1 = (*color_prom >> 6) & 0x01; - bit2 = (*color_prom >> 7) & 0x01; - b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + bit1 = BIT(*color_prom, 6); + bit2 = BIT(*color_prom, 7); + int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; palette.set_pen_color(i, rgb_t(r, g, b)); color_prom++; |