diff options
Diffstat (limited to 'src/devices/sound/cdp1869.cpp')
-rw-r--r-- | src/devices/sound/cdp1869.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/devices/sound/cdp1869.cpp b/src/devices/sound/cdp1869.cpp index 580b715dff2..1347081549a 100644 --- a/src/devices/sound/cdp1869.cpp +++ b/src/devices/sound/cdp1869.cpp @@ -228,7 +228,7 @@ inline void cdp1869_device::update_prd_changed_timer() inline rgb_t cdp1869_device::get_rgb(int i, int c, int l) { - int luma = 0, r, g, b; + int luma = 0; luma += (l & 4) ? CDP1869_WEIGHT_RED : 0; luma += (l & 1) ? CDP1869_WEIGHT_GREEN : 0; @@ -236,9 +236,9 @@ inline rgb_t cdp1869_device::get_rgb(int i, int c, int l) luma = (luma * 0xff) / 100; - r = (c & 4) ? luma : 0; - g = (c & 1) ? luma : 0; - b = (c & 2) ? luma : 0; + int const r = (c & 4) ? luma : 0; + int const g = (c & 1) ? luma : 0; + int const b = (c & 2) ? luma : 0; return rgb_t(r, g, b); } @@ -368,10 +368,10 @@ cdp1869_device::cdp1869_device(const machine_config &mconfig, const char *tag, d // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(cdp1869_device::device_add_mconfig) - MCFG_PALETTE_ADD("palette", 8+64) - MCFG_PALETTE_INIT_OWNER(cdp1869_device, cdp1869) -MACHINE_CONFIG_END +void cdp1869_device::device_add_mconfig(machine_config &config) +{ + PALETTE(config, m_palette, FUNC(cdp1869_device::cdp1869_palette), 8 + 64); +} //------------------------------------------------- @@ -481,15 +481,13 @@ device_memory_interface::space_config_vector cdp1869_device::memory_space_config // initialize_palette - initialize palette //------------------------------------------------- -PALETTE_INIT_MEMBER(cdp1869_device, cdp1869) +void cdp1869_device::cdp1869_palette(palette_device &palette) const { - // color-on-color display (CFC=0) int i; + // color-on-color display (CFC=0) for (i = 0; i < 8; i++) - { palette.set_pen_color(i, get_rgb(i, i, 15)); - } // tone-on-tone display (CFC=1) for (int c = 0; c < 8; c++) |