summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/dogfgt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/video/dogfgt.cpp')
-rw-r--r--src/mame/video/dogfgt.cpp43
1 files changed, 22 insertions, 21 deletions
diff --git a/src/mame/video/dogfgt.cpp b/src/mame/video/dogfgt.cpp
index 919f37754a0..fffe0ff4e55 100644
--- a/src/mame/video/dogfgt.cpp
+++ b/src/mame/video/dogfgt.cpp
@@ -13,33 +13,34 @@
***************************************************************************/
-PALETTE_INIT_MEMBER(dogfgt_state, dogfgt)
+void dogfgt_state::dogfgt_palette(palette_device &palette) const
{
- const uint8_t *color_prom = memregion("proms")->base();
+ uint8_t const *const color_prom = memregion("proms")->base();
- /* first 16 colors are RAM */
+ // first 16 colors are RAM
for (int i = 0; i < 64; 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[i], 0);
+ bit1 = BIT(color_prom[i], 1);
+ bit2 = BIT(color_prom[i], 2);
+ int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
+
+ // green component
+ bit0 = BIT(color_prom[i], 3);
+ bit1 = BIT(color_prom[i], 4);
+ bit2 = BIT(color_prom[i], 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[i], 6);
+ bit2 = BIT(color_prom[i], 7);
+ int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette.set_pen_color(i + 16, rgb_t(r,g,b));
- color_prom++;
+ palette.set_pen_color(i + 16, rgb_t(r, g, b));
}
}