diff options
Diffstat (limited to 'src/mame/video/atarisy2.cpp')
-rw-r--r-- | src/mame/video/atarisy2.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mame/video/atarisy2.cpp b/src/mame/video/atarisy2.cpp index 4dc92540ca8..2f8d509b756 100644 --- a/src/mame/video/atarisy2.cpp +++ b/src/mame/video/atarisy2.cpp @@ -159,25 +159,25 @@ WRITE16_MEMBER( atarisy2_state::yscroll_w ) * *************************************/ -PALETTE_DECODER_MEMBER( atarisy2_state, RRRRGGGGBBBBIIII ) +rgb_t atarisy2_state::RRRRGGGGBBBBIIII(uint32_t raw) { - static const int ZB = 115, Z3 = 78, Z2 = 37, Z1 = 17, Z0 = 9; + static constexpr int ZB = 115, Z3 = 78, Z2 = 37, Z1 = 17, Z0 = 9; - static const int intensity_table[16] = + static constexpr int intensity_table[16] = { 0, ZB+Z0, ZB+Z1, ZB+Z1+Z0, ZB+Z2, ZB+Z2+Z0, ZB+Z2+Z1, ZB+Z2+Z1+Z0, ZB+Z3, ZB+Z3+Z0, ZB+Z3+Z1, ZB+Z3+Z1+Z0,ZB+ Z3+Z2, ZB+Z3+Z2+Z0, ZB+Z3+Z2+Z1, ZB+Z3+Z2+Z1+Z0 }; - static const int color_table[16] = + static constexpr int color_table[16] = { 0x0, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xe, 0xf, 0xf }; - int i = intensity_table[raw & 15]; - uint8_t r = (color_table[(raw >> 12) & 15] * i) >> 4; - uint8_t g = (color_table[(raw >> 8) & 15] * i) >> 4; - uint8_t b = (color_table[(raw >> 4) & 15] * i) >> 4; + int const i = intensity_table[raw & 15]; + uint8_t const r = (color_table[(raw >> 12) & 15] * i) >> 4; + uint8_t const g = (color_table[(raw >> 8) & 15] * i) >> 4; + uint8_t const b = (color_table[(raw >> 4) & 15] * i) >> 4; return rgb_t(r, g, b); } |