diff options
Diffstat (limited to 'src/mame/video/sidepckt.cpp')
-rw-r--r-- | src/mame/video/sidepckt.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/mame/video/sidepckt.cpp b/src/mame/video/sidepckt.cpp index cafe257dbe3..e4d08556c48 100644 --- a/src/mame/video/sidepckt.cpp +++ b/src/mame/video/sidepckt.cpp @@ -12,34 +12,34 @@ #include "includes/sidepckt.h" -PALETTE_INIT_MEMBER(sidepckt_state, sidepckt) +void sidepckt_state::sidepckt_palette(palette_device &palette) const { - const uint8_t *color_prom = memregion("proms")->base(); + uint8_t const *const color_prom = memregion("proms")->base(); - for (int i = 0;i < palette.entries();i++) + for (int i = 0; i < palette.entries(); i++) { - int bit0,bit1,bit2,bit3,r,g,b; - - /* red component */ - bit0 = (color_prom[i] >> 4) & 0x01; - bit1 = (color_prom[i] >> 5) & 0x01; - bit2 = (color_prom[i] >> 6) & 0x01; - bit3 = (color_prom[i] >> 7) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - /* green component */ - bit0 = (color_prom[i] >> 0) & 0x01; - bit1 = (color_prom[i] >> 1) & 0x01; - bit2 = (color_prom[i] >> 2) & 0x01; - bit3 = (color_prom[i] >> 3) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - /* blue component */ - bit0 = (color_prom[i + palette.entries()] >> 0) & 0x01; - bit1 = (color_prom[i + palette.entries()] >> 1) & 0x01; - bit2 = (color_prom[i + palette.entries()] >> 2) & 0x01; - bit3 = (color_prom[i + palette.entries()] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - palette.set_pen_color(i,rgb_t(r,g,b)); + int bit0, bit1, bit2, bit3; + + // red component + bit0 = BIT(color_prom[i], 4); + bit1 = BIT(color_prom[i], 5); + bit2 = BIT(color_prom[i], 6); + bit3 = BIT(color_prom[i], 7); + int const r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + // green component + bit0 = BIT(color_prom[i], 0); + bit1 = BIT(color_prom[i], 1); + bit2 = BIT(color_prom[i], 2); + bit3 = BIT(color_prom[i], 3); + int const g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + // blue component + bit0 = BIT(color_prom[i + palette.entries()], 0); + bit1 = BIT(color_prom[i + palette.entries()], 1); + bit2 = BIT(color_prom[i + palette.entries()], 2); + bit3 = BIT(color_prom[i + palette.entries()], 3); + int const b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + + palette.set_pen_color(i, rgb_t(r, g, b)); } } |