summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/crgolf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/video/crgolf.cpp')
-rw-r--r--src/mame/video/crgolf.cpp41
1 files changed, 20 insertions, 21 deletions
diff --git a/src/mame/video/crgolf.cpp b/src/mame/video/crgolf.cpp
index 5f1572eba0a..a12e514fc68 100644
--- a/src/mame/video/crgolf.cpp
+++ b/src/mame/video/crgolf.cpp
@@ -23,39 +23,38 @@
*
*************************************/
-PALETTE_INIT_MEMBER(crgolf_state, crgolf)
+void crgolf_state::crgolf_palette(palette_device &palette) const
{
- offs_t offs;
- const uint8_t *prom = memregion("proms")->base();
+ uint8_t const *const prom = memregion("proms")->base();
- for (offs = 0; offs < NUM_PENS; offs++)
+ for (offs_t offs = 0; offs < NUM_PENS; offs++)
{
- int bit0, bit1, bit2, r, g, b;
+ int bit0, bit1, bit2;
- uint8_t data = prom[offs];
+ uint8_t const data = prom[offs];
- /* red component */
- bit0 = (data >> 0) & 0x01;
- bit1 = (data >> 1) & 0x01;
- bit2 = (data >> 2) & 0x01;
- r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
+ // red component
+ bit0 = BIT(data, 0);
+ bit1 = BIT(data, 1);
+ bit2 = BIT(data, 2);
+ int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- /* green component */
- bit0 = (data >> 3) & 0x01;
- bit1 = (data >> 4) & 0x01;
- bit2 = (data >> 5) & 0x01;
- g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
+ // green component
+ bit0 = BIT(data, 3);
+ bit1 = BIT(data, 4);
+ bit2 = BIT(data, 5);
+ int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- /* blue component */
- bit0 = (data >> 6) & 0x01;
- bit1 = (data >> 7) & 0x01;
- b = 0x4f * bit0 + 0xa8 * bit1;
+ // blue component
+ bit0 = BIT(data, 6);
+ bit1 = BIT(data, 7);
+ int const b = 0x4f * bit0 + 0xa8 * bit1;
m_palette->set_pen_color(offs, r, g, b);
}
}
-PALETTE_INIT_MEMBER(crgolf_state, mastrglf)
+void crgolf_state::mastrglf_palette(palette_device &palette) const
{
}