summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/thedealr.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2018-12-29 05:53:50 +1100
committer Vas Crabb <vas@vastheman.com>2018-12-29 05:53:50 +1100
commitf1f0591f43f381123e8d9ec20c52eb7c0c332c79 (patch)
tree97c8dd30a6ea292c3189f372b8103a2e303c0b2d /src/mame/drivers/thedealr.cpp
parent65bfb2654f0c73235f114e9145c766245bed9790 (diff)
Start cleaning up palette configuration:
* Basically, initialisers go in the constructor arguments, and things for setting format go in set_format. * Initialisation patterns can be specified with an enum discriminator or with a FUNC and optionally a tag. * Formats can be specified with an enum discriminator or a size and function pointer. * You must always supply the number of entries when setting the format. * When initislising with a paletter initialisation member, you can specify the entries and indirecte entries together. * The palette_device now has a standard constructor, so use .set_entries if you are specifying entry count with no format/initialisation. * Also killed an overload on delegates that wasn't being useful.
Diffstat (limited to 'src/mame/drivers/thedealr.cpp')
-rw-r--r--src/mame/drivers/thedealr.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mame/drivers/thedealr.cpp b/src/mame/drivers/thedealr.cpp
index 162a69351eb..17c6c56ee5f 100644
--- a/src/mame/drivers/thedealr.cpp
+++ b/src/mame/drivers/thedealr.cpp
@@ -71,7 +71,7 @@ private:
TIMER_DEVICE_CALLBACK_MEMBER(thedealr_interrupt);
// video
- DECLARE_PALETTE_INIT(thedealr);
+ void thedealr_palette(palette_device &palette) const;
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(screen_vblank);
@@ -96,13 +96,13 @@ private:
***************************************************************************/
-PALETTE_INIT_MEMBER(thedealr_state,thedealr)
+void thedealr_state::thedealr_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++)
{
- int col = (color_prom[i] << 8) + color_prom[i + 512];
+ int const col = (color_prom[i] << 8) | color_prom[i + 512];
palette.set_pen_color(i, pal5bit(col >> 10), pal5bit(col >> 5), pal5bit(col >> 0));
}
}
@@ -568,9 +568,8 @@ MACHINE_CONFIG_START(thedealr_state::thedealr)
screen.screen_vblank().append_inputline(m_subcpu, INPUT_LINE_NMI);
screen.set_palette(m_palette);
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_thedealr)
- MCFG_PALETTE_ADD("palette", 512)
- MCFG_PALETTE_INIT_OWNER(thedealr_state,thedealr)
+ GFXDECODE(config, "gfxdecode", m_palette, gfx_thedealr);
+ PALETTE(config, m_palette, FUNC(thedealr_state::thedealr_palette), 512);
// sound hardware
SPEAKER(config, "mono").front_center();