diff options
Diffstat (limited to 'src/mame/video/funkybee.cpp')
-rw-r--r-- | src/mame/video/funkybee.cpp | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/mame/video/funkybee.cpp b/src/mame/video/funkybee.cpp index 08bdaf7f3a4..b762dd4e256 100644 --- a/src/mame/video/funkybee.cpp +++ b/src/mame/video/funkybee.cpp @@ -11,33 +11,32 @@ #include "emu.h" #include "includes/funkybee.h" -PALETTE_INIT_MEMBER(funkybee_state, funkybee) +void funkybee_state::funkybee_palette(palette_device &palette) const { const uint8_t *color_prom = memregion("proms")->base(); - int i; - /* first, the character/sprite palette */ - for (i = 0; i < 32; i++) + // first, the character/sprite palette + for (int i = 0; i < 32; 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)); + palette.set_pen_color(i, rgb_t(r, g, b)); color_prom++; } } |