get rid of some copy/pasted macros for different numbers of arguments (nw)

This commit is contained in:
Vas Crabb 2019-02-09 21:28:39 +11:00
parent 5364087629
commit 422d365332
83 changed files with 321 additions and 328 deletions

View File

@ -470,18 +470,18 @@ void cdp1864_device::initialize_palette()
// foreground colors
uint8_t r = 0, g = 0, b = 0;
if (m_chr_r != RES_INF) r = combine_1_weights(color_weights_r, BIT(i, 0));
if (m_chr_b != RES_INF) b = combine_1_weights(color_weights_b, BIT(i, 1));
if (m_chr_g != RES_INF) g = combine_1_weights(color_weights_g, BIT(i, 2));
if (m_chr_r != RES_INF) r = combine_weights(color_weights_r, BIT(i, 0));
if (m_chr_b != RES_INF) b = combine_weights(color_weights_b, BIT(i, 1));
if (m_chr_g != RES_INF) g = combine_weights(color_weights_g, BIT(i, 2));
m_palette[i] = rgb_t(r, g, b);
// background colors
r = 0, g = 0, b = 0;
if (m_chr_r != RES_INF) r = combine_1_weights(color_weights_bkg_r, BIT(i, 0));
if (m_chr_b != RES_INF) b = combine_1_weights(color_weights_bkg_b, BIT(i, 1));
if (m_chr_g != RES_INF) g = combine_1_weights(color_weights_bkg_g, BIT(i, 2));
if (m_chr_r != RES_INF) r = combine_weights(color_weights_bkg_r, BIT(i, 0));
if (m_chr_b != RES_INF) b = combine_weights(color_weights_bkg_b, BIT(i, 1));
if (m_chr_g != RES_INF) g = combine_weights(color_weights_bkg_g, BIT(i, 2));
m_palette[i + 8] = rgb_t(r, g, b);
}

View File

@ -64,19 +64,19 @@ WRITE8_MEMBER( mb_vcu_device::mb_vcu_paletteram_w )
/* red component */
bit1 = (m_palram[offset] >> 7) & 0x01;
bit0 = (m_palram[offset] >> 6) & 0x01;
r = combine_2_weights(m_weights_r, bit0, bit1);
r = combine_weights(m_weights_r, bit0, bit1);
/* green component */
bit2 = (m_palram[offset] >> 5) & 0x01;
bit1 = (m_palram[offset] >> 4) & 0x01;
bit0 = (m_palram[offset] >> 3) & 0x01;
g = combine_3_weights(m_weights_g, bit0, bit1, bit2);
g = combine_weights(m_weights_g, bit0, bit1, bit2);
/* blue component */
bit2 = (m_palram[offset] >> 2) & 0x01;
bit1 = (m_palram[offset] >> 1) & 0x01;
bit0 = (m_palram[offset] >> 0) & 0x01;
b = combine_3_weights(m_weights_b, bit0, bit1, bit2);
b = combine_weights(m_weights_b, bit0, bit1, bit2);
m_palette->set_pen_color(offset, rgb_t(r, g, b));
}
@ -474,19 +474,19 @@ WRITE8_MEMBER( mb_vcu_device::background_color_w )
/* red component */
bit1 = (m_bk_color >> 7) & 0x01;
bit0 = (m_bk_color >> 6) & 0x01;
r = combine_2_weights(m_weights_r, bit0, bit1);
r = combine_weights(m_weights_r, bit0, bit1);
/* green component */
bit2 = (m_bk_color >> 5) & 0x01;
bit1 = (m_bk_color >> 4) & 0x01;
bit0 = (m_bk_color >> 3) & 0x01;
g = combine_3_weights(m_weights_g, bit0, bit1, bit2);
g = combine_weights(m_weights_g, bit0, bit1, bit2);
/* blue component */
bit2 = (m_bk_color >> 2) & 0x01;
bit1 = (m_bk_color >> 1) & 0x01;
bit0 = (m_bk_color >> 0) & 0x01;
b = combine_3_weights(m_weights_b, bit0, bit1, bit2);
b = combine_weights(m_weights_b, bit0, bit1, bit2);
m_palette->set_pen_color(0x100, rgb_t(r, g, b));
}

View File

@ -177,21 +177,12 @@ double compute_resistor_weights(
int count_2, const int * resistances_2, double * weights_2, int pulldown_2, int pullup_2,
int count_3, const int * resistances_3, double * weights_3, int pulldown_3, int pullup_3);
template <typename T, std::size_t N, typename... U>
constexpr int combine_weights(T const (&tab)[N], U... w)
template <typename T = int, typename U, std::size_t N, typename... V>
constexpr T combine_weights(U const (&tab)[N], V... w)
{
return int(emu::detail::combine_weights<0U>(tab, w...) + 0.5);
return T(emu::detail::combine_weights<0U>(tab, w...) + 0.5);
}
#define combine_8_weights(tab,w0,w1,w2,w3,w4,w5,w6,w7) (int(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2) + (tab)[3]*(w3) + (tab)[4]*(w4) + (tab)[5]*(w5) + (tab)[6]*(w6) + (tab)[7]*(w7)) + 0.5))
#define combine_7_weights(tab,w0,w1,w2,w3,w4,w5,w6) (int(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2) + (tab)[3]*(w3) + (tab)[4]*(w4) + (tab)[5]*(w5) + (tab)[6]*(w6)) + 0.5))
#define combine_6_weights(tab,w0,w1,w2,w3,w4,w5) (int(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2) + (tab)[3]*(w3) + (tab)[4]*(w4) + (tab)[5]*(w5)) + 0.5))
#define combine_5_weights(tab,w0,w1,w2,w3,w4) (int(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2) + (tab)[3]*(w3) + (tab)[4]*(w4)) + 0.5))
#define combine_4_weights(tab,w0,w1,w2,w3) (int(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2) + (tab)[3]*(w3)) + 0.5))
#define combine_3_weights(tab,w0,w1,w2) (int(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2)) + 0.5))
#define combine_2_weights(tab,w0,w1) (int(((tab)[0]*(w0) + (tab)[1]*(w1)) + 0.5))
#define combine_1_weights(tab,w0) (int(((tab)[0]*(w0) + 0.5)))
/* this should be moved to one of the core files */
@ -205,10 +196,10 @@ constexpr int combine_weights(T const (&tab)[N], U... w)
/* for the open collector outputs PROMs */
double compute_resistor_net_outputs(
int minval, int maxval, double scaler,
int count_1, const int * resistances_1, double * outputs_1, int pulldown_1, int pullup_1,
int count_2, const int * resistances_2, double * outputs_2, int pulldown_2, int pullup_2,
int count_3, const int * resistances_3, double * outputs_3, int pulldown_3, int pullup_3 );
int minval, int maxval, double scaler,
int count_1, const int * resistances_1, double * outputs_1, int pulldown_1, int pullup_1,
int count_2, const int * resistances_2, double * outputs_2, int pulldown_2, int pullup_2,
int count_3, const int * resistances_3, double * outputs_3, int pulldown_3, int pullup_3 );

View File

@ -386,21 +386,21 @@ void tx1_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t
if (m_step0 & ((1 << TX1_FRAC)))
{
update_engine(m_eng0);
m_pit0 = combine_4_weights(m_weights0, m_eng0[0], m_eng0[1], m_eng0[2], m_eng0[3]);
m_pit0 = combine_weights(m_weights0, m_eng0[0], m_eng0[1], m_eng0[2], m_eng0[3]);
m_step0 &= ((1 << TX1_FRAC) - 1);
}
if (m_step1 & ((1 << TX1_FRAC)))
{
update_engine(m_eng1);
m_pit1 = combine_3_weights(m_weights1, m_eng1[0], m_eng1[1], m_eng1[3]);
m_pit1 = combine_weights(m_weights1, m_eng1[0], m_eng1[1], m_eng1[3]);
m_step1 &= ((1 << TX1_FRAC) - 1);
}
if (m_step2 & ((1 << TX1_FRAC)))
{
update_engine(m_eng2);
m_pit2 = combine_3_weights(m_weights2, m_eng2[0], m_eng2[1], m_eng2[3]);
m_pit2 = combine_weights(m_weights2, m_eng2[0], m_eng2[1], m_eng2[3]);
m_step2 &= ((1 << TX1_FRAC) - 1);
}
@ -659,7 +659,7 @@ void buggyboy_sound_device::device_start()
0, nullptr, nullptr, 0, 0 );
for (i = 0; i < 16; i++)
m_eng_voltages[i] = combine_4_weights(aweights, BIT(tmp[i], 0), BIT(tmp[i], 1), BIT(tmp[i], 2), BIT(tmp[i], 3));
m_eng_voltages[i] = combine_weights(aweights, BIT(tmp[i], 0), BIT(tmp[i], 1), BIT(tmp[i], 2), BIT(tmp[i], 3));
/* Allocate the stream */
m_stream = machine().sound().stream_alloc(*this, 0, 2, machine().sample_rate());

View File

@ -278,9 +278,9 @@ void beezer_state::palette_init(palette_device &device)
WRITE8_MEMBER( beezer_state::palette_w )
{
int r = combine_3_weights(m_weights_r, BIT(data, 0), BIT(data, 1), BIT(data, 2));
int g = combine_3_weights(m_weights_g, BIT(data, 3), BIT(data, 4), BIT(data, 5));
int b = combine_2_weights(m_weights_b, BIT(data, 6), BIT(data, 7));
int r = combine_weights(m_weights_r, BIT(data, 0), BIT(data, 1), BIT(data, 2));
int g = combine_weights(m_weights_g, BIT(data, 3), BIT(data, 4), BIT(data, 5));
int b = combine_weights(m_weights_b, BIT(data, 6), BIT(data, 7));
m_palette->set_pen_color(offset, rgb_t(r, g, b));
}

View File

@ -476,9 +476,9 @@ void berzerk_state::get_pens(rgb_t *pens)
uint8_t b_bit = (color >> 2) & 0x01;
uint8_t i_bit = (color >> 3) & 0x01;
uint8_t r = combine_2_weights(color_weights, r_bit & i_bit, r_bit);
uint8_t g = combine_2_weights(color_weights, g_bit & i_bit, g_bit);
uint8_t b = combine_2_weights(color_weights, b_bit & i_bit, b_bit);
uint8_t r = combine_weights(color_weights, r_bit & i_bit, r_bit);
uint8_t g = combine_weights(color_weights, g_bit & i_bit, g_bit);
uint8_t b = combine_weights(color_weights, b_bit & i_bit, b_bit);
pens[color] = rgb_t(r, g, b);
}

View File

@ -649,18 +649,18 @@ void dacholer_state::dacholer_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(weights_rg, bit0, bit1, bit2);
int const r = combine_weights(weights_rg, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(weights_rg, bit0, bit1, bit2);
int const g = combine_weights(weights_rg, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(weights_b, bit0, bit1);
int const b = combine_weights(weights_b, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -497,18 +497,18 @@ void dmndrby_state::dmndrby_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -258,17 +258,17 @@ void ettrivia_state::ettrivia_palette(palette_device &palette) const
// red component
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i+0x100], 0);
int const r = combine_2_weights(weights, bit0, bit1);
int const r = combine_weights(weights, bit0, bit1);
// green component
bit0 = BIT(color_prom[i], 2);
bit1 = BIT(color_prom[i+0x100], 2);
int const g = combine_2_weights(weights, bit0, bit1);
int const g = combine_weights(weights, bit0, bit1);
// blue component
bit0 = BIT(color_prom[i], 1);
bit1 = BIT(color_prom[i+0x100], 1);
int const b = combine_2_weights(weights, bit0, bit1);
int const b = combine_weights(weights, bit0, bit1);
palette.set_pen_color(bitswap<8>(i,5,7,6,2,1,0,4,3), rgb_t(r, g, b));
}

View File

@ -441,18 +441,18 @@ R = 82 Ohms Pull Down.
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(weights_r, bit0, bit1, bit2);
int const r = combine_weights(weights_r, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(weights_g, bit0, bit1, bit2);
int const g = combine_weights(weights_g, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(weights_b, bit0, bit1);
int const b = combine_weights(weights_b, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -164,18 +164,18 @@ void jangou_state::jangou_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(weights_rg, bit0, bit1, bit2);
int const r = combine_weights(weights_rg, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(weights_rg, bit0, bit1, bit2);
int const g = combine_weights(weights_rg, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(weights_b, bit0, bit1);
int const b = combine_weights(weights_b, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -216,18 +216,18 @@ void looping_state::looping_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -288,18 +288,18 @@ void meijinsn_state::meijinsn_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(weights_r, bit0, bit1, bit2);
int const r = combine_weights(weights_r, bit0, bit1, bit2);
/* green component */
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(weights_g, bit0, bit1, bit2);
int const g = combine_weights(weights_g, bit0, bit1, bit2);
/* blue component */
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(weights_b, bit0, bit1);
int const b = combine_weights(weights_b, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -140,15 +140,15 @@ void monzagp_state::monzagp_palette(palette_device &palette) const
// red component
bit0 = BIT(d, 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(d, 1);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(d, 0);
int const b = combine_3_weights(bweights, bit0, bit1, bit2);
int const b = combine_weights(bweights, bit0, bit1, bit2);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -107,16 +107,16 @@ void mpu4dealem_state::dealem_palette(palette_device &palette) const
bit0 = BIT(*color_prom, 0);
bit1 = BIT(*color_prom, 1);
bit2 = BIT(*color_prom, 2);
int const r = combine_3_weights(weights_r, bit0, bit1, bit2);
int const r = combine_weights(weights_r, bit0, bit1, bit2);
/* green component */
bit0 = BIT(*color_prom, 3);
bit1 = BIT(*color_prom, 4);
bit2 = BIT(*color_prom, 5);
int const g = combine_3_weights(weights_g, bit0, bit1, bit2);
int const g = combine_weights(weights_g, bit0, bit1, bit2);
/* blue component */
bit0 = BIT(*color_prom, 6);
bit1 = BIT(*color_prom, 7);
int const b = combine_2_weights(weights_b, bit0, bit1);
int const b = combine_weights(weights_b, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
color_prom++;

View File

@ -468,18 +468,18 @@ void mrgame_state::mrgame_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
uint8_t const r = combine_3_weights(rweights, bit0, bit1, bit2);
uint8_t const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
uint8_t const g = combine_3_weights(gweights, bit0, bit1, bit2);
uint8_t const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
uint8_t const b = combine_2_weights(bweights, bit0, bit1);
uint8_t const b = combine_weights(bweights, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
palette.set_pen_color(i + 32, rgb_t(r, g, b));

View File

@ -216,18 +216,18 @@ void nightgal_state::nightgal_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(weights_rg, bit0, bit1, bit2);
int const r = combine_weights(weights_rg, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(weights_rg, bit0, bit1, bit2);
int const g = combine_weights(weights_rg, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(weights_b, bit0, bit1);
int const b = combine_weights(weights_b, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -887,9 +887,9 @@ void segaxbd_state::palette_init()
int i2 = (value >> 2) & 1;
int i1 = (value >> 1) & 1;
int i0 = (value >> 0) & 1;
m_palette_normal[value] = combine_6_weights(weights_normal, i0, i1, i2, i3, i4, 0);
m_palette_shadow[value] = combine_6_weights(weights_sh, i0, i1, i2, i3, i4, 0);
m_palette_hilight[value] = combine_6_weights(weights_sh, i0, i1, i2, i3, i4, 1);
m_palette_normal[value] = combine_weights(weights_normal, i0, i1, i2, i3, i4, 0);
m_palette_shadow[value] = combine_weights(weights_sh, i0, i1, i2, i3, i4, 0);
m_palette_hilight[value] = combine_weights(weights_sh, i0, i1, i2, i3, i4, 1);
}
}

View File

@ -182,18 +182,18 @@ void shougi_state::shougi_palette(palette_device &palette) const
bit0 = (color_prom[i] >> 0) & 0x01;
bit1 = (color_prom[i] >> 1) & 0x01;
bit2 = (color_prom[i] >> 2) & 0x01;
int const r = combine_3_weights(weights_r, bit0, bit1, bit2);
int const r = combine_weights(weights_r, bit0, bit1, bit2);
/* green component */
bit0 = (color_prom[i] >> 3) & 0x01;
bit1 = (color_prom[i] >> 4) & 0x01;
bit2 = (color_prom[i] >> 5) & 0x01;
int const g = combine_3_weights(weights_g, bit0, bit1, bit2);
int const g = combine_weights(weights_g, bit0, bit1, bit2);
/* blue component */
bit0 = (color_prom[i] >> 6) & 0x01;
bit1 = (color_prom[i] >> 7) & 0x01;
int const b = combine_2_weights(weights_b, bit0, bit1);
int const b = combine_weights(weights_b, bit0, bit1);
palette.set_pen_color(i,rgb_t(r,g,b));
}

View File

@ -230,18 +230,18 @@ void supercrd_state::supercrd_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(weights_r, bit0, bit1, bit2);
int const r = combine_weights(weights_r, bit0, bit1, bit2);
// blue component */
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const b = combine_3_weights(weights_b, bit0, bit1, bit2);
int const b = combine_weights(weights_b, bit0, bit1, bit2);
// green component */
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const g = combine_2_weights(weights_g, bit0, bit1);
int const g = combine_weights(weights_g, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -123,18 +123,18 @@ void superdq_state::superdq_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 7);
bit1 = BIT(color_prom[i], 6);
bit2 = BIT(color_prom[i], 5);
int const r = combine_3_weights(rweights, bit2, bit1, bit0);
int const r = combine_weights(rweights, bit2, bit1, bit0);
// green component
bit0 = BIT(color_prom[i], 4);
bit1 = BIT(color_prom[i], 3);
bit2 = BIT(color_prom[i], 2);
int const g = combine_3_weights(gweights, bit2, bit1, bit0);
int const g = combine_weights(gweights, bit2, bit1, bit0);
// blue component
bit0 = BIT(color_prom[i], 1);
bit1 = BIT(color_prom[i], 0);
int const b = combine_2_weights(bweights, bit1, bit0);
int const b = combine_weights(bweights, bit1, bit0);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -157,18 +157,18 @@ void wallc_state::wallc_palette(palette_device &palette) const
// red component
bit0 = BIT(color_prom[i], 5);
bit1 = BIT(color_prom[i], 6);
int const r = combine_2_weights(weights_r, bit1, bit0);
int const r = combine_weights(weights_r, bit1, bit0);
// green component
bit0 = BIT(color_prom[i], 2);
bit1 = BIT(color_prom[i], 3);
int const g = combine_2_weights(weights_g, bit1, bit0);
int const g = combine_weights(weights_g, bit1, bit0);
// blue component
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit7 = BIT(color_prom[i], 7);
int const b = combine_3_weights(weights_b, bit7, bit1, bit0);
int const b = combine_weights(weights_b, bit7, bit1, bit0);
palette.set_pen_color(i, rgb_t(r, g, b));
}
@ -195,18 +195,18 @@ void wallc_state::unkitpkr_palette(palette_device &palette) const
// red component
bit0 = BIT(color_prom[i], 5);
bit1 = BIT(color_prom[i], 6);
int const r = combine_2_weights(weights_r, bit1, bit0);
int const r = combine_weights(weights_r, bit1, bit0);
// green component
bit0 = BIT(color_prom[i], 2);
bit1 = BIT(color_prom[i], 3);
int const g = combine_2_weights(weights_g, bit1, bit0);
int const g = combine_weights(weights_g, bit1, bit0);
// blue component
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit7 = BIT(color_prom[i], 7);
int const b = combine_3_weights(weights_b, bit7, bit1, bit0);
int const b = combine_weights(weights_b, bit7, bit1, bit0);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -73,7 +73,8 @@ private:
DECLARE_WRITE8_MEMBER(m52_flipscreen_w);
TILE_GET_INFO_MEMBER(get_tile_info);
void init_palette();
void init_sprite_palette(const int *resistances_3, const int *resistances_2, double *weights_r, double *weights_g, double *weights_b, double scale);
template <size_t N, size_t O, size_t P>
void init_sprite_palette(const int *resistances_3, const int *resistances_2, double (&weights_r)[N], double (&weights_g)[O], double (&weights_b)[P], double scale);
uint32_t screen_update_m52(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void draw_background(bitmap_rgb32 &bitmap, const rectangle &cliprect, int xpos, int ypos, int image);
void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, int initoffs);

View File

@ -129,9 +129,9 @@ void sega_16bit_common_base::palette_init()
int i2 = (value >> 2) & 1;
int i1 = (value >> 1) & 1;
int i0 = (value >> 0) & 1;
m_palette_normal[value] = combine_6_weights(weights_normal, i0, i1, i2, i3, i4, 0);
m_palette_shadow[value] = combine_6_weights(weights_sh, i0, i1, i2, i3, i4, 0);
m_palette_hilight[value] = combine_6_weights(weights_sh, i0, i1, i2, i3, i4, 1);
m_palette_normal[value] = combine_weights(weights_normal, i0, i1, i2, i3, i4, 0);
m_palette_shadow[value] = combine_weights(weights_sh, i0, i1, i2, i3, i4, 0);
m_palette_hilight[value] = combine_weights(weights_sh, i0, i1, i2, i3, i4, 1);
}
}

View File

@ -99,19 +99,19 @@ void ampoker2_state::ampoker2_palette(palette_device &palette) const
// blue component
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
int const b = combine_2_weights(weights_b, bit0, bit1);
int const b = combine_weights(weights_b, bit0, bit1);
// green component
bit0 = BIT(color_prom[i], 2);
bit1 = BIT(color_prom[i], 3);
bit2 = BIT(color_prom[i], 4);
int const g = combine_3_weights(weights_g, bit0, bit1, bit2);
int const g = combine_weights(weights_g, bit0, bit1, bit2);
// red component
bit0 = BIT(color_prom[i], 5);
bit1 = BIT(color_prom[i], 6);
bit2 = BIT(color_prom[i], 7);
int const r = combine_3_weights(weights_r, bit0, bit1, bit2);
int const r = combine_weights(weights_r, bit0, bit1, bit2);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -142,21 +142,21 @@ void astrocde_state::profpac_palette(palette_device &palette) const
bit1 = BIT(i, 1);
bit2 = BIT(i, 2);
bit3 = BIT(i, 3);
int const b = combine_4_weights(weights, bit0, bit1, bit2, bit3);
int const b = combine_weights(weights, bit0, bit1, bit2, bit3);
// green component
bit0 = BIT(i, 4);
bit1 = BIT(i, 5);
bit2 = BIT(i, 6);
bit3 = BIT(i, 7);
int const g = combine_4_weights(weights, bit0, bit1, bit2, bit3);
int const g = combine_weights(weights, bit0, bit1, bit2, bit3);
// red component
bit0 = BIT(i, 8);
bit1 = BIT(i, 9);
bit2 = BIT(i, 10);
bit3 = BIT(i, 11);
int const r = combine_4_weights(weights, bit0, bit1, bit2, bit3);
int const r = combine_weights(weights, bit0, bit1, bit2, bit3);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -64,18 +64,18 @@ void bagman_state::bagman_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(weights_r, bit0, bit1, bit2);
int const r = combine_weights(weights_r, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(weights_g, bit0, bit1, bit2);
int const g = combine_weights(weights_g, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(weights_b, bit0, bit1);
int const b = combine_weights(weights_b, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -62,18 +62,18 @@ void bking_state::bking_palette(palette_device &palette) const
bit0 = (color_prom[pen] >> 0) & 0x01;
bit1 = (color_prom[pen] >> 1) & 0x01;
bit2 = (color_prom[pen] >> 2) & 0x01;
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = (color_prom[pen] >> 3) & 0x01;
bit1 = (color_prom[pen] >> 4) & 0x01;
bit2 = (color_prom[pen] >> 5) & 0x01;
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = (color_prom[pen] >> 6) & 0x01;
bit1 = (color_prom[pen] >> 7) & 0x01;
int const b = combine_2_weights(gweights, bit0, bit1);
int const b = combine_weights(gweights, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -90,19 +90,19 @@ WRITE8_MEMBER(ccastles_state::ccastles_paletteram_w)
bit0 = (~r >> 0) & 0x01;
bit1 = (~r >> 1) & 0x01;
bit2 = (~r >> 2) & 0x01;
r = combine_3_weights(m_rweights, bit0, bit1, bit2);
r = combine_weights(m_rweights, bit0, bit1, bit2);
/* green component (inverted) */
bit0 = (~g >> 0) & 0x01;
bit1 = (~g >> 1) & 0x01;
bit2 = (~g >> 2) & 0x01;
g = combine_3_weights(m_gweights, bit0, bit1, bit2);
g = combine_weights(m_gweights, bit0, bit1, bit2);
/* blue component (inverted) */
bit0 = (~b >> 0) & 0x01;
bit1 = (~b >> 1) & 0x01;
bit2 = (~b >> 2) & 0x01;
b = combine_3_weights(m_bweights, bit0, bit1, bit2);
b = combine_weights(m_bweights, bit0, bit1, bit2);
m_palette->set_pen_color(offset & 0x1f, rgb_t(r, g, b));
}

View File

@ -57,18 +57,18 @@ void cclimber_state::cclimber_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(weights_rg, bit0, bit1, bit2);
int const r = combine_weights(weights_rg, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(weights_rg, bit0, bit1, bit2);
int const g = combine_weights(weights_rg, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(weights_b, bit0, bit1);
int const b = combine_weights(weights_b, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -50,18 +50,18 @@ void champbas_state::champbas_palette(palette_device &palette) const
bit0 = (color_prom[i] >> 0) & 0x01;
bit1 = (color_prom[i] >> 1) & 0x01;
bit2 = (color_prom[i] >> 2) & 0x01;
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
/* green component */
bit0 = (color_prom[i] >> 3) & 0x01;
bit1 = (color_prom[i] >> 4) & 0x01;
bit2 = (color_prom[i] >> 5) & 0x01;
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
/* blue component */
bit0 = (color_prom[i] >> 6) & 0x01;
bit1 = (color_prom[i] >> 7) & 0x01;
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -54,18 +54,18 @@ void circusc_state::circusc_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -66,19 +66,19 @@ void cloak_state::set_pen(int i)
bit0 = (~palette_ram[i] >> 6) & 0x01;
bit1 = (~palette_ram[i] >> 7) & 0x01;
bit2 = (~palette_ram[i] >> 8) & 0x01;
r = combine_3_weights(weights, bit0, bit1, bit2);
r = combine_weights(weights, bit0, bit1, bit2);
/* green component */
bit0 = (~palette_ram[i] >> 3) & 0x01;
bit1 = (~palette_ram[i] >> 4) & 0x01;
bit2 = (~palette_ram[i] >> 5) & 0x01;
g = combine_3_weights(weights, bit0, bit1, bit2);
g = combine_weights(weights, bit0, bit1, bit2);
/* blue component */
bit0 = (~palette_ram[i] >> 0) & 0x01;
bit1 = (~palette_ram[i] >> 1) & 0x01;
bit2 = (~palette_ram[i] >> 2) & 0x01;
b = combine_3_weights(weights, bit0, bit1, bit2);
b = combine_weights(weights, bit0, bit1, bit2);
m_palette->set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -66,19 +66,19 @@ WRITE8_MEMBER(cloud9_state::cloud9_paletteram_w)
bit0 = (~r >> 0) & 0x01;
bit1 = (~r >> 1) & 0x01;
bit2 = (~r >> 2) & 0x01;
r = combine_3_weights(m_rweights, bit0, bit1, bit2);
r = combine_weights(m_rweights, bit0, bit1, bit2);
/* green component (inverted) */
bit0 = (~g >> 0) & 0x01;
bit1 = (~g >> 1) & 0x01;
bit2 = (~g >> 2) & 0x01;
g = combine_3_weights(m_gweights, bit0, bit1, bit2);
g = combine_weights(m_gweights, bit0, bit1, bit2);
/* blue component (inverted) */
bit0 = (~b >> 0) & 0x01;
bit1 = (~b >> 1) & 0x01;
bit2 = (~b >> 2) & 0x01;
b = combine_3_weights(m_bweights, bit0, bit1, bit2);
b = combine_weights(m_bweights, bit0, bit1, bit2);
m_palette->set_pen_color(offset & 0x3f, rgb_t(r, g, b));
}

View File

@ -106,13 +106,13 @@ void divebomb_state::decode_proms(palette_device &palette, const uint8_t * rgn,
for (uint32_t i = 0; i < size; ++i)
{
uint32_t const rdata = rgn[i + size*2] & 0x0f;
uint32_t const r = combine_4_weights(rweights, BIT(rdata, 0), BIT(rdata, 1), BIT(rdata, 2), BIT(rdata, 3));
uint32_t const r = combine_weights(rweights, BIT(rdata, 0), BIT(rdata, 1), BIT(rdata, 2), BIT(rdata, 3));
uint32_t const gdata = rgn[i + size] & 0x0f;
uint32_t const g = combine_4_weights(gweights, BIT(gdata, 0), BIT(gdata, 1), BIT(gdata, 2), BIT(gdata, 3));
uint32_t const g = combine_weights(gweights, BIT(gdata, 0), BIT(gdata, 1), BIT(gdata, 2), BIT(gdata, 3));
uint32_t const bdata = rgn[i] & 0x0f;
uint32_t const b = combine_4_weights(bweights, BIT(bdata, 0), BIT(bdata, 1), BIT(bdata, 2), BIT(bdata, 3));
uint32_t const b = combine_weights(bweights, BIT(bdata, 0), BIT(bdata, 1), BIT(bdata, 2), BIT(bdata, 3));
if (!inv)
palette.set_pen_color(index + i, rgb_t(r, g, b));

View File

@ -58,18 +58,18 @@ void exerion_state::exerion_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -47,21 +47,21 @@ void fastfred_state::fastfred_palette(palette_device &palette) const
bit1 = BIT(color_prom[i | 0x000], 1);
bit2 = BIT(color_prom[i | 0x000], 2);
bit3 = BIT(color_prom[i | 0x000], 3);
int const r = combine_4_weights(rweights, bit0, bit1, bit2, bit3);
int const r = combine_weights(rweights, bit0, bit1, bit2, bit3);
// green component
bit0 = BIT(color_prom[i | 0x100], 0);
bit1 = BIT(color_prom[i | 0x100], 1);
bit2 = BIT(color_prom[i | 0x100], 2);
bit3 = BIT(color_prom[i | 0x100], 3);
int const g = combine_4_weights(gweights, bit0, bit1, bit2, bit3);
int const g = combine_weights(gweights, bit0, bit1, bit2, bit3);
// blue component
bit0 = BIT(color_prom[i | 0x200], 0);
bit1 = BIT(color_prom[i | 0x200], 1);
bit2 = BIT(color_prom[i | 0x200], 2);
bit3 = BIT(color_prom[i | 0x200], 3);
int const b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
int const b = combine_weights(bweights, bit0, bit1, bit2, bit3);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -57,21 +57,21 @@ void finalizr_state::finalizr_palette(palette_device &palette) const
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
bit3 = BIT(color_prom[i], 3);
int const r = combine_4_weights(rweights, bit0, bit1, bit2, bit3);
int const r = combine_weights(rweights, bit0, bit1, bit2, bit3);
// green component
bit0 = BIT(color_prom[i], 4);
bit1 = BIT(color_prom[i], 5);
bit2 = BIT(color_prom[i], 6);
bit3 = BIT(color_prom[i], 7);
int const g = combine_4_weights(gweights, bit0, bit1, bit2, bit3);
int const g = combine_weights(gweights, bit0, bit1, bit2, bit3);
// blue component
bit0 = BIT(color_prom[i + 0x20], 0);
bit1 = BIT(color_prom[i + 0x20], 1);
bit2 = BIT(color_prom[i + 0x20], 2);
bit3 = BIT(color_prom[i + 0x20], 3);
int const b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
int const b = combine_weights(bweights, bit0, bit1, bit2, bit3);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -85,18 +85,18 @@ WRITE16_MEMBER(foodf_state::foodf_paletteram_w)
bit0 = (newword >> 0) & 0x01;
bit1 = (newword >> 1) & 0x01;
bit2 = (newword >> 2) & 0x01;
r = combine_3_weights(m_rweights, bit0, bit1, bit2);
r = combine_weights(m_rweights, bit0, bit1, bit2);
/* green component */
bit0 = (newword >> 3) & 0x01;
bit1 = (newword >> 4) & 0x01;
bit2 = (newword >> 5) & 0x01;
g = combine_3_weights(m_gweights, bit0, bit1, bit2);
g = combine_weights(m_gweights, bit0, bit1, bit2);
/* blue component */
bit0 = (newword >> 6) & 0x01;
bit1 = (newword >> 7) & 0x01;
b = combine_2_weights(m_bweights, bit0, bit1);
b = combine_weights(m_bweights, bit0, bit1);
m_palette->set_pen_color(offset, rgb_t(r, g, b));
}

View File

@ -70,16 +70,16 @@ void funworld_state::funworld_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(weights_r, bit0, bit1, bit2);
int const r = combine_weights(weights_r, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const b = combine_3_weights(weights_b, bit0, bit1, bit2);
int const b = combine_weights(weights_b, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const g = combine_2_weights(weights_g, bit0, bit1);
int const g = combine_weights(weights_g, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -286,18 +286,18 @@ void galaxian_state::galaxian_palette(palette_device &palette)
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -25,12 +25,12 @@ void gottlieb_state::palette_w(offs_t offset, u8 data)
/* blue & green are encoded in the even bytes */
val = m_paletteram[offset & ~1];
int const g = combine_4_weights(m_weights, BIT(val, 4), BIT(val, 5), BIT(val, 6), BIT(val, 7));
int const b = combine_4_weights(m_weights, BIT(val, 0), BIT(val, 1), BIT(val, 2), BIT(val, 3));
int const g = combine_weights(m_weights, BIT(val, 4), BIT(val, 5), BIT(val, 6), BIT(val, 7));
int const b = combine_weights(m_weights, BIT(val, 0), BIT(val, 1), BIT(val, 2), BIT(val, 3));
/* red is encoded in the odd bytes */
val = m_paletteram[offset | 1];
int const r = combine_4_weights(m_weights, BIT(val, 0), BIT(val, 1), BIT(val, 2), BIT(val, 3));
int const r = combine_weights(m_weights, BIT(val, 0), BIT(val, 1), BIT(val, 2), BIT(val, 3));
/* alpha is set to 0 if laserdisc video is enabled */
int const a = (m_transparent0 && offset / 2 == 0) ? 0 : 255;

View File

@ -33,18 +33,18 @@ void gotya_state::gotya_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -34,18 +34,18 @@ void grchamp_state::grchamp_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -53,18 +53,18 @@ void gyruss_state::gyruss_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(weights_rg, bit0, bit1, bit2);
int const r = combine_weights(weights_rg, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(weights_rg, bit0, bit1, bit2);
int const g = combine_weights(weights_rg, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(weights_b, bit0, bit1);
int const b = combine_weights(weights_b, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -53,18 +53,18 @@ void hyperspt_state::hyperspt_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -40,21 +40,21 @@ void ironhors_state::ironhors_palette(palette_device &palette) const
bit1 = BIT(color_prom[i | 0x000], 1);
bit2 = BIT(color_prom[i | 0x000], 2);
bit3 = BIT(color_prom[i | 0x000], 3);
int const r = combine_4_weights(rweights, bit0, bit1, bit2, bit3);
int const r = combine_weights(rweights, bit0, bit1, bit2, bit3);
// green component
bit0 = BIT(color_prom[i | 0x100], 0);
bit1 = BIT(color_prom[i | 0x100], 1);
bit2 = BIT(color_prom[i | 0x100], 2);
bit3 = BIT(color_prom[i | 0x100], 3);
int const g = combine_4_weights(gweights, bit0, bit1, bit2, bit3);
int const g = combine_weights(gweights, bit0, bit1, bit2, bit3);
// blue component
bit0 = BIT(color_prom[i | 0x200], 0);
bit1 = BIT(color_prom[i | 0x200], 1);
bit2 = BIT(color_prom[i | 0x200], 2);
bit3 = BIT(color_prom[i | 0x200], 3);
int const b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
int const b = combine_weights(bweights, bit0, bit1, bit2, bit3);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -57,21 +57,21 @@ void kingofb_state::palette_init_common( palette_device &palette, const uint8_t
bit1 = (r_data >> 1) & 0x01;
bit2 = (r_data >> 2) & 0x01;
bit3 = (r_data >> 3) & 0x01;
r = combine_4_weights(rweights, bit0, bit1, bit2, bit3);
r = combine_weights(rweights, bit0, bit1, bit2, bit3);
/* green component */
bit0 = (g_data >> 0) & 0x01;
bit1 = (g_data >> 1) & 0x01;
bit2 = (g_data >> 2) & 0x01;
bit3 = (g_data >> 3) & 0x01;
g = combine_4_weights(gweights, bit0, bit1, bit2, bit3);
g = combine_weights(gweights, bit0, bit1, bit2, bit3);
/* blue component */
bit0 = (b_data >> 0) & 0x01;
bit1 = (b_data >> 1) & 0x01;
bit2 = (b_data >> 2) & 0x01;
bit3 = (b_data >> 3) & 0x01;
b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
b = combine_weights(bweights, bit0, bit1, bit2, bit3);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -292,17 +292,17 @@ void ladybug_base_state::palette_init_common(palette_device &palette, const uint
// red component
bit0 = BIT(~color_prom[i], r_bit0);
bit1 = BIT(~color_prom[i], r_bit1);
int const r = combine_2_weights(rweights, bit0, bit1);
int const r = combine_weights(rweights, bit0, bit1);
// green component
bit0 = BIT(~color_prom[i], g_bit0);
bit1 = BIT(~color_prom[i], g_bit1);
int const g = combine_2_weights(gweights, bit0, bit1);
int const g = combine_weights(gweights, bit0, bit1);
// blue component
bit0 = BIT(~color_prom[i], b_bit0);
bit1 = BIT(~color_prom[i], b_bit1);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -147,42 +147,42 @@ void lucky74_state::lucky74_palette(palette_device &palette) const
bit1 = BIT(color_prom[0x000 + i], 1);
bit2 = BIT(color_prom[0x000 + i], 2);
bit3 = BIT(color_prom[0x000 + i], 3);
int const r1 = combine_4_weights(weights_r, bit0, bit1, bit2, bit3);
int const r1 = combine_weights(weights_r, bit0, bit1, bit2, bit3);
// red component (this 2, PROM E7)
bit0 = BIT(color_prom[0x100 + i], 0);
bit1 = BIT(color_prom[0x100 + i], 1);
bit2 = BIT(color_prom[0x100 + i], 2);
bit3 = BIT(color_prom[0x100 + i], 3);
int const r2 = combine_4_weights(weights_r, bit0, bit1, bit2, bit3);
int const r2 = combine_weights(weights_r, bit0, bit1, bit2, bit3);
// green component (this 1, PROM D6)
bit0 = BIT(color_prom[0x200 + i], 0);
bit1 = BIT(color_prom[0x200 + i], 1);
bit2 = BIT(color_prom[0x200 + i], 2);
bit3 = BIT(color_prom[0x200 + i], 3);
int const g1 = combine_4_weights(weights_g, bit0, bit1, bit2, bit3);
int const g1 = combine_weights(weights_g, bit0, bit1, bit2, bit3);
// green component (this 2, PROM D7)
bit0 = BIT(color_prom[0x300 + i], 0);
bit1 = BIT(color_prom[0x300 + i], 1);
bit2 = BIT(color_prom[0x300 + i], 2);
bit3 = BIT(color_prom[0x300 + i], 3);
int const g2 = combine_4_weights(weights_g, bit0, bit1, bit2, bit3);
int const g2 = combine_weights(weights_g, bit0, bit1, bit2, bit3);
// blue component (this 1, PROM C6)
bit0 = BIT(color_prom[0x400 + i], 0);
bit1 = BIT(color_prom[0x400 + i], 1);
bit2 = BIT(color_prom[0x400 + i], 2);
bit3 = BIT(color_prom[0x400 + i], 3);
int const b1 = combine_4_weights(weights_b, bit0, bit1, bit2, bit3);
int const b1 = combine_weights(weights_b, bit0, bit1, bit2, bit3);
// blue component (this 2, PROM C7)
bit0 = BIT(color_prom[0x500 + i], 0);
bit1 = BIT(color_prom[0x500 + i], 1);
bit2 = BIT(color_prom[0x500 + i], 2);
bit3 = BIT(color_prom[0x500 + i], 3);
int const b2 = combine_4_weights(weights_b, bit0, bit1, bit2, bit3);
int const b2 = combine_weights(weights_b, bit0, bit1, bit2, bit3);
// PROMs circuitry, 1st state

View File

@ -35,10 +35,10 @@ void m52_state::init_palette()
const uint8_t *char_pal = memregion("tx_pal")->base();
for (int i = 0; i < 512; i++)
{
uint8_t promval = char_pal[i];
int r = combine_3_weights(weights_r, BIT(promval, 0), BIT(promval, 1), BIT(promval, 2));
int g = combine_3_weights(weights_g, BIT(promval, 3), BIT(promval, 4), BIT(promval, 5));
int b = combine_2_weights(weights_b, BIT(promval, 6), BIT(promval, 7));
uint8_t const promval = char_pal[i];
int const r = combine_weights(weights_r, BIT(promval, 0), BIT(promval, 1), BIT(promval, 2));
int const g = combine_weights(weights_g, BIT(promval, 3), BIT(promval, 4), BIT(promval, 5));
int const b = combine_weights(weights_b, BIT(promval, 6), BIT(promval, 7));
m_tx_palette->set_pen_color(i, rgb_t(r, g, b));
}
@ -48,9 +48,9 @@ void m52_state::init_palette()
for (int i = 0; i < 32; i++)
{
uint8_t promval = back_pal[i];
int r = combine_3_weights(weights_r, BIT(promval, 0), BIT(promval, 1), BIT(promval, 2));
int g = combine_3_weights(weights_g, BIT(promval, 3), BIT(promval, 4), BIT(promval, 5));
int b = combine_2_weights(weights_b, BIT(promval, 6), BIT(promval, 7));
int r = combine_weights(weights_r, BIT(promval, 0), BIT(promval, 1), BIT(promval, 2));
int g = combine_weights(weights_g, BIT(promval, 3), BIT(promval, 4), BIT(promval, 5));
int b = combine_weights(weights_b, BIT(promval, 6), BIT(promval, 7));
m_bg_palette->set_indirect_color(i, rgb_t(r, g, b));
}
@ -81,7 +81,8 @@ void m52_state::init_palette()
init_sprite_palette(resistances_3, resistances_2, weights_r, weights_g, weights_b, scale);
}
void m52_state::init_sprite_palette(const int *resistances_3, const int *resistances_2, double *weights_r, double *weights_g, double *weights_b, double scale)
template <size_t N, size_t O, size_t P>
void m52_state::init_sprite_palette(const int *resistances_3, const int *resistances_2, double (&weights_r)[N], double (&weights_g)[O], double (&weights_b)[P], double scale)
{
const uint8_t *sprite_pal = memregion("spr_pal")->base();
const uint8_t *sprite_table = memregion("spr_clut")->base();
@ -95,10 +96,10 @@ void m52_state::init_sprite_palette(const int *resistances_3, const int *resista
/* sprite palette */
for (int i = 0; i < 32; i++)
{
uint8_t promval = sprite_pal[i];
int r = combine_2_weights(weights_r, BIT(promval, 6), BIT(promval, 7));
int g = combine_3_weights(weights_g, BIT(promval, 3), BIT(promval, 4), BIT(promval, 5));
int b = combine_3_weights(weights_b, BIT(promval, 0), BIT(promval, 1), BIT(promval, 2));
uint8_t const promval = sprite_pal[i];
int const r = combine_weights(weights_r, BIT(promval, 6), BIT(promval, 7));
int const g = combine_weights(weights_g, BIT(promval, 3), BIT(promval, 4), BIT(promval, 5));
int const b = combine_weights(weights_b, BIT(promval, 0), BIT(promval, 1), BIT(promval, 2));
m_sp_palette->set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -42,9 +42,9 @@ void m58_state::m58_palette(palette_device &palette) const
for (int i = 0; i < 256; i++)
{
uint8_t const promval = (char_lopal[i] & 0x0f) | (char_hipal[i] << 4);
int const r = combine_2_weights(weights_r, BIT(promval,6), BIT(promval,7));
int const g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int const b = combine_3_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
int const r = combine_weights(weights_r, BIT(promval,6), BIT(promval,7));
int const g = combine_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int const b = combine_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
palette.set_indirect_color(i, rgb_t(r, g, b));
}
@ -53,9 +53,9 @@ void m58_state::m58_palette(palette_device &palette) const
for (int i = 0; i < 256; i++)
{
uint8_t const promval = (radar_lopal[i] & 0x0f) | (radar_hipal[i] << 4);
int const r = combine_2_weights(weights_r, BIT(promval,6), BIT(promval,7));
int const g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int const b = combine_3_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
int const r = combine_weights(weights_r, BIT(promval,6), BIT(promval,7));
int const g = combine_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int const b = combine_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
palette.set_indirect_color(256 + i, rgb_t(r, g, b));
}
@ -70,9 +70,9 @@ void m58_state::m58_palette(palette_device &palette) const
for (int i = 0; i < 16; i++)
{
uint8_t const promval = sprite_pal[i];
int const r = combine_2_weights(weights_r, BIT(promval,6), BIT(promval,7));
int const g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int const b = combine_3_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
int const r = combine_weights(weights_r, BIT(promval,6), BIT(promval,7));
int const g = combine_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int const b = combine_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
palette.set_indirect_color(256 + 256 + i, rgb_t(r, g, b));
}

View File

@ -53,18 +53,18 @@ void mappy_state::superpac_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}
@ -108,18 +108,18 @@ void mappy_state::mappy_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}
@ -176,21 +176,21 @@ void mappy_state::phozon_palette(palette_device &palette) const
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
bit3 = BIT(color_prom[i], 3);
int const r = combine_4_weights(rweights, bit0, bit1, bit2, bit3);
int const r = combine_weights(rweights, bit0, bit1, bit2, bit3);
// green component
bit0 = BIT(color_prom[i | 0x100], 0);
bit1 = BIT(color_prom[i | 0x100], 1);
bit2 = BIT(color_prom[i | 0x100], 2);
bit3 = BIT(color_prom[i | 0x100], 3);
int const g = combine_4_weights(gweights, bit0, bit1, bit2, bit3);
int const g = combine_weights(gweights, bit0, bit1, bit2, bit3);
// blue component
bit0 = BIT(color_prom[i | 0x200], 0);
bit1 = BIT(color_prom[i | 0x200], 1);
bit2 = BIT(color_prom[i | 0x200], 2);
bit3 = BIT(color_prom[i | 0x200], 3);
int const b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
int const b = combine_weights(bweights, bit0, bit1, bit2, bit3);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -60,18 +60,18 @@ void megazone_state::megazone_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -50,21 +50,21 @@ void mikie_state::mikie_palette(palette_device &palette) const
bit1 = BIT(color_prom[i + 0x000], 1);
bit2 = BIT(color_prom[i + 0x000], 2);
bit3 = BIT(color_prom[i + 0x000], 3);
int const r = combine_4_weights(rweights, bit0, bit1, bit2, bit3);
int const r = combine_weights(rweights, bit0, bit1, bit2, bit3);
// green component
bit0 = BIT(color_prom[i + 0x100], 0);
bit1 = BIT(color_prom[i + 0x100], 1);
bit2 = BIT(color_prom[i + 0x100], 2);
bit3 = BIT(color_prom[i + 0x100], 3);
int const g = combine_4_weights(gweights, bit0, bit1, bit2, bit3);
int const g = combine_weights(gweights, bit0, bit1, bit2, bit3);
// blue component
bit0 = BIT(color_prom[i + 0x200], 0);
bit1 = BIT(color_prom[i + 0x200], 1);
bit2 = BIT(color_prom[i + 0x200], 2);
bit3 = BIT(color_prom[i + 0x200], 3);
int const b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
int const b = combine_weights(bweights, bit0, bit1, bit2, bit3);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -100,18 +100,18 @@ void mystston_state::set_palette()
bit0 = (data >> 0) & 0x01;
bit1 = (data >> 1) & 0x01;
bit2 = (data >> 2) & 0x01;
r = combine_3_weights(weights_rg, bit0, bit1, bit2);
r = combine_weights(weights_rg, bit0, bit1, bit2);
/* green component */
bit0 = (data >> 3) & 0x01;
bit1 = (data >> 4) & 0x01;
bit2 = (data >> 5) & 0x01;
g = combine_3_weights(weights_rg, bit0, bit1, bit2);
g = combine_weights(weights_rg, bit0, bit1, bit2);
/* blue component */
bit0 = (data >> 6) & 0x01;
bit1 = (data >> 7) & 0x01;
b = combine_2_weights(weights_b, bit0, bit1);
b = combine_weights(weights_b, bit0, bit1);
m_palette->set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -78,17 +78,17 @@ void naughtyb_state::naughtyb_palette(palette_device &palette) const
// red component
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i+0x100], 0);
int const r = combine_2_weights(weights, bit0, bit1);
int const r = combine_weights(weights, bit0, bit1);
// green component
bit0 = BIT(color_prom[i], 2);
bit1 = BIT(color_prom[i+0x100], 2);
int const g = combine_2_weights(weights, bit0, bit1);
int const g = combine_weights(weights, bit0, bit1);
// blue component
bit0 = BIT(color_prom[i], 1);
bit1 = BIT(color_prom[i+0x100], 1);
int const b = combine_2_weights(weights, bit0, bit1);
int const b = combine_weights(weights, bit0, bit1);
palette.set_pen_color(bitswap<8>(i, 5, 7, 6, 2, 1, 0, 4, 3), rgb_t(r, g, b));
}

View File

@ -59,10 +59,10 @@ void neogeo_base_state::create_rgb_lookups()
int i2 = (i >> 2) & 1;
int i1 = (i >> 1) & 1;
int i0 = (i >> 0) & 1;
m_palette_lookup[i][0] = combine_5_weights(weights_normal, i0, i1, i2, i3, i4);
m_palette_lookup[i][1] = combine_5_weights(weights_dark, i0, i1, i2, i3, i4);
m_palette_lookup[i][2] = combine_5_weights(weights_shadow, i0, i1, i2, i3, i4);
m_palette_lookup[i][3] = combine_5_weights(weights_dark_shadow, i0, i1, i2, i3, i4);
m_palette_lookup[i][0] = combine_weights(weights_normal, i0, i1, i2, i3, i4);
m_palette_lookup[i][1] = combine_weights(weights_dark, i0, i1, i2, i3, i4);
m_palette_lookup[i][2] = combine_weights(weights_shadow, i0, i1, i2, i3, i4);
m_palette_lookup[i][3] = combine_weights(weights_dark_shadow, i0, i1, i2, i3, i4);
}
}

View File

@ -335,9 +335,9 @@ void nick_device::initialize_palette()
int ba = BIT(i, 2);
int bb = BIT(i, 5);
uint8_t r = combine_3_weights(color_weights_rg, rc, rb, ra);
uint8_t g = combine_3_weights(color_weights_rg, gc, gb, ga);
uint8_t b = combine_2_weights(color_weights_b, bb, ba);
uint8_t r = combine_weights(color_weights_rg, rc, rb, ra);
uint8_t g = combine_weights(color_weights_rg, gc, gb, ga);
uint8_t b = combine_weights(color_weights_b, bb, ba);
m_palette[i] = rgb_t(r, g, b);
}

View File

@ -84,18 +84,18 @@ void pacman_state::pacman_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -45,18 +45,18 @@ void pandoras_state::pandoras_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -51,18 +51,18 @@ void pooyan_state::pooyan_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -80,18 +80,18 @@ void rallyx_state::rallyx_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}
@ -141,18 +141,18 @@ void rallyx_state::jungler_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}
@ -165,17 +165,17 @@ void rallyx_state::jungler_palette(palette_device &palette) const
// red component
bit0 = BIT((i - 0x20), 0);
bit1 = BIT((i - 0x20), 1);
int const r = combine_2_weights(rweights_star, bit0, bit1);
int const r = combine_weights(rweights_star, bit0, bit1);
// green component
bit0 = BIT(i - 0x20, 2);
bit1 = BIT(i - 0x20, 3);
int const g = combine_2_weights(gweights_star, bit0, bit1);
int const g = combine_weights(gweights_star, bit0, bit1);
// blue component
bit0 = BIT(i - 0x20, 4);
bit1 = BIT(i - 0x20, 5);
int const b = combine_2_weights(bweights_star, bit0, bit1);
int const b = combine_weights(bweights_star, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -80,9 +80,9 @@ void redalert_state::get_pens(pen_t *pens)
uint8_t b0_bit = (data >> 0) & 0x01;
uint8_t b1_bit = (data >> 7) & 0x01;
uint8_t r = combine_3_weights(charmap_rg_weights, r0_bit, r1_bit, r2_bit);
uint8_t g = combine_3_weights(charmap_rg_weights, g0_bit, g1_bit, g2_bit);
uint8_t b = combine_2_weights(charmap_b_weights, b0_bit, b1_bit);
uint8_t r = combine_weights(charmap_rg_weights, r0_bit, r1_bit, r2_bit);
uint8_t g = combine_weights(charmap_rg_weights, g0_bit, g1_bit, g2_bit);
uint8_t b = combine_weights(charmap_b_weights, b0_bit, b1_bit);
pens[offs] = rgb_t(r, g, b);
}

View File

@ -53,18 +53,18 @@ void rocnrope_state::rocnrope_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -50,21 +50,21 @@ void sbasketb_state::sbasketb_palette(palette_device &palette) const
bit1 = BIT(color_prom[i | 0x000], 1);
bit2 = BIT(color_prom[i | 0x000], 2);
bit3 = BIT(color_prom[i | 0x000], 3);
int const r = combine_4_weights(rweights, bit0, bit1, bit2, bit3);
int const r = combine_weights(rweights, bit0, bit1, bit2, bit3);
// green component
bit0 = BIT(color_prom[i | 0x100], 0);
bit1 = BIT(color_prom[i | 0x100], 1);
bit2 = BIT(color_prom[i | 0x100], 2);
bit3 = BIT(color_prom[i | 0x100], 3);
int const g = combine_4_weights(gweights, bit0, bit1, bit2, bit3);
int const g = combine_weights(gweights, bit0, bit1, bit2, bit3);
// blue component
bit0 = BIT(color_prom[i | 0x200], 0);
bit1 = BIT(color_prom[i | 0x200], 1);
bit2 = BIT(color_prom[i | 0x200], 2);
bit3 = BIT(color_prom[i | 0x200], 3);
int const b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
int const b = combine_weights(bweights, bit0, bit1, bit2, bit3);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -95,18 +95,18 @@ void segag80r_state::g80_set_palette_entry(int entry, uint8_t data)
bit0 = (r >> 0) & 0x01;
bit1 = (r >> 1) & 0x01;
bit2 = (r >> 2) & 0x01;
r = combine_3_weights(m_rweights, bit0, bit1, bit2);
r = combine_weights(m_rweights, bit0, bit1, bit2);
/* green component */
bit0 = (g >> 0) & 0x01;
bit1 = (g >> 1) & 0x01;
bit2 = (g >> 2) & 0x01;
g = combine_3_weights(m_gweights, bit0, bit1, bit2);
g = combine_weights(m_gweights, bit0, bit1, bit2);
/* blue component */
bit0 = (b >> 0) & 0x01;
bit1 = (b >> 1) & 0x01;
b = combine_2_weights(m_bweights, bit0, bit1);
b = combine_weights(m_bweights, bit0, bit1);
m_palette->set_pen_color(entry, rgb_t(r, g, b));
}
@ -138,17 +138,17 @@ void segag80r_state::spaceod_bg_init_palette()
/* red component */
bit0 = (r >> 0) & 0x01;
bit1 = (r >> 1) & 0x01;
r = combine_2_weights(trweights, bit0, bit1);
r = combine_weights(trweights, bit0, bit1);
/* green component */
bit0 = (g >> 0) & 0x01;
bit1 = (g >> 1) & 0x01;
g = combine_2_weights(tgweights, bit0, bit1);
g = combine_weights(tgweights, bit0, bit1);
/* blue component */
bit0 = (b >> 0) & 0x01;
bit1 = (b >> 1) & 0x01;
b = combine_2_weights(tbweights, bit0, bit1);
b = combine_weights(tbweights, bit0, bit1);
m_palette->set_pen_color(64 + i, rgb_t(r, g, b));
}

View File

@ -50,21 +50,21 @@ void shaolins_state::shaolins_palette(palette_device &palette) const
bit1 = BIT(color_prom[i | 0x000], 1);
bit2 = BIT(color_prom[i | 0x000], 2);
bit3 = BIT(color_prom[i | 0x000], 3);
int const r = combine_4_weights(rweights, bit0, bit1, bit2, bit3);
int const r = combine_weights(rweights, bit0, bit1, bit2, bit3);
// green component
bit0 = BIT(color_prom[i | 0x100], 0);
bit1 = BIT(color_prom[i | 0x100], 1);
bit2 = BIT(color_prom[i | 0x100], 2);
bit3 = BIT(color_prom[i | 0x100], 3);
int const g = combine_4_weights(gweights, bit0, bit1, bit2, bit3);
int const g = combine_weights(gweights, bit0, bit1, bit2, bit3);
// blue component
bit0 = BIT(color_prom[i | 0x200], 0);
bit1 = BIT(color_prom[i | 0x200], 1);
bit2 = BIT(color_prom[i | 0x200], 2);
bit3 = BIT(color_prom[i | 0x200], 3);
int const b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
int const b = combine_weights(bweights, bit0, bit1, bit2, bit3);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -68,18 +68,18 @@ void snookr10_state::snookr10_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(weights_r, bit0, bit1, bit2);
int const r = combine_weights(weights_r, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const b = combine_3_weights(weights_b, bit0, bit1, bit2);
int const b = combine_weights(weights_b, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const g = combine_2_weights(weights_g, bit0, bit1);
int const g = combine_weights(weights_g, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
}
@ -132,18 +132,18 @@ void snookr10_state::apple10_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(weights_r, bit0, bit1, bit2);
int const r = combine_weights(weights_r, bit0, bit1, bit2);
/* blue component */
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const b = combine_3_weights(weights_b, bit0, bit1, bit2);
int const b = combine_weights(weights_b, bit0, bit1, bit2);
/* green component */
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const g = combine_2_weights(weights_g, bit0, bit1);
int const g = combine_weights(weights_g, bit0, bit1);
/* encrypted color matrix */
int const cn = bitswap<8>(i, 4, 5, 6, 7, 2, 3, 0, 1);
@ -199,18 +199,18 @@ void snookr10_state::crystalc_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(weights_r, bit0, bit1, bit2);
int const r = combine_weights(weights_r, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const b = combine_3_weights(weights_b, bit0, bit1, bit2);
int const b = combine_weights(weights_b, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const g = combine_2_weights(weights_g, bit0, bit1);
int const g = combine_weights(weights_g, bit0, bit1);
// encrypted color matrix
int const cn = bitswap<8>(i, 7, 5, 6, 4, 3, 2, 1, 0);

View File

@ -135,9 +135,9 @@ void spacefb_state::get_starfield_pens(pen_t *pens)
uint8_t ra = (((i >> 4) & 0x01) || background_red) && !disable_star_field;
uint8_t rb = ((i >> 5) & 0x01) && color_contrast_r && !disable_star_field;
uint8_t r = combine_3_weights(m_color_weights_rg, 0, rb, ra);
uint8_t g = combine_3_weights(m_color_weights_rg, 0, gb, ga);
uint8_t b = combine_2_weights(m_color_weights_b, bb, ba);
uint8_t r = combine_weights(m_color_weights_rg, 0, rb, ra);
uint8_t g = combine_weights(m_color_weights_rg, 0, gb, ga);
uint8_t b = combine_weights(m_color_weights_b, bb, ba);
pens[i] = rgb_t(r, g, b);
}
@ -233,9 +233,9 @@ void spacefb_state::get_sprite_pens(pen_t *pens)
uint8_t b1 = (data >> 6) & 0x01;
uint8_t b2 = (data >> 7) & 0x01;
uint8_t r = combine_3_weights(m_color_weights_rg, r0, r1, r2);
uint8_t g = combine_3_weights(m_color_weights_rg, g0, g1, g2);
uint8_t b = combine_2_weights(m_color_weights_b, b1, b2);
uint8_t r = combine_weights(m_color_weights_rg, r0, r1, r2);
uint8_t g = combine_weights(m_color_weights_rg, g0, g1, g2);
uint8_t b = combine_weights(m_color_weights_b, b1, b2);
if (i >> 4)
{

View File

@ -131,19 +131,19 @@ WRITE16_MEMBER(segas1x_bootleg_state::sys16_paletteram_w)
int b4 = (newword >> 11) & 1;
/* Normal colors */
r = combine_6_weights(m_weights[0][0], r0, r1, r2, r3, r4, 0);
g = combine_6_weights(m_weights[0][1], g0, g1, g2, g3, g4, 0);
b = combine_6_weights(m_weights[0][2], b0, b1, b2, b3, b4, 0);
r = combine_weights(m_weights[0][0], r0, r1, r2, r3, r4, 0);
g = combine_weights(m_weights[0][1], g0, g1, g2, g3, g4, 0);
b = combine_weights(m_weights[0][2], b0, b1, b2, b3, b4, 0);
/* Shadow colors */
rs = combine_6_weights(m_weights[1][0], r0, r1, r2, r3, r4, 0);
gs = combine_6_weights(m_weights[1][1], g0, g1, g2, g3, g4, 0);
bs = combine_6_weights(m_weights[1][2], b0, b1, b2, b3, b4, 0);
rs = combine_weights(m_weights[1][0], r0, r1, r2, r3, r4, 0);
gs = combine_weights(m_weights[1][1], g0, g1, g2, g3, g4, 0);
bs = combine_weights(m_weights[1][2], b0, b1, b2, b3, b4, 0);
/* Highlight colors */
//rh = combine_6_weights(m_weights[1][0], r0, r1, r2, r3, r4, 1);
//gh = combine_6_weights(m_weights[1][1], g0, g1, g2, g3, g4, 1);
//bh = combine_6_weights(m_weights[1][2], b0, b1, b2, b3, b4, 1);
//rh = combine_weights(m_weights[1][0], r0, r1, r2, r3, r4, 1);
//gh = combine_weights(m_weights[1][1], g0, g1, g2, g3, g4, 1);
//bh = combine_weights(m_weights[1][2], b0, b1, b2, b3, b4, 1);
m_palette->set_pen_color(offset, rgb_t(r, g, b) );

View File

@ -112,21 +112,21 @@ void taitosj_state::set_pens()
bit1 = (~val >> 7) & 0x01;
val = m_paletteram[(i << 1) | 0x00];
bit2 = (~val >> 0) & 0x01;
r = combine_3_weights(rweights, bit0, bit1, bit2);
r = combine_weights(rweights, bit0, bit1, bit2);
/* green component */
val = m_paletteram[(i << 1) | 0x01];
bit0 = (~val >> 3) & 0x01;
bit1 = (~val >> 4) & 0x01;
bit2 = (~val >> 5) & 0x01;
g = combine_3_weights(gweights, bit0, bit1, bit2);
g = combine_weights(gweights, bit0, bit1, bit2);
/* blue component */
val = m_paletteram[(i << 1) | 0x01];
bit0 = (~val >> 0) & 0x01;
bit1 = (~val >> 1) & 0x01;
bit2 = (~val >> 2) & 0x01;
b = combine_3_weights(bweights, bit0, bit1, bit2);
b = combine_weights(bweights, bit0, bit1, bit2);
m_palette->set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -44,18 +44,18 @@ void timelimt_state::timelimt_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(weights_r, bit0, bit1, bit2);
int const r = combine_weights(weights_r, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(weights_g, bit0, bit1, bit2);
int const g = combine_weights(weights_g, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(weights_b, bit0, bit1);
int const b = combine_weights(weights_b, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -65,21 +65,21 @@ void tp84_state::tp84_palette(palette_device &palette) const
bit1 = BIT(color_prom[i | 0x000], 1);
bit2 = BIT(color_prom[i | 0x000], 2);
bit3 = BIT(color_prom[i | 0x000], 3);
int const r = combine_4_weights(weights, bit0, bit1, bit2, bit3);
int const r = combine_weights(weights, bit0, bit1, bit2, bit3);
// green component
bit0 = BIT(color_prom[i | 0x100], 0);
bit1 = BIT(color_prom[i | 0x100], 1);
bit2 = BIT(color_prom[i | 0x100], 2);
bit3 = BIT(color_prom[i | 0x100], 3);
int const g = combine_4_weights(weights, bit0, bit1, bit2, bit3);
int const g = combine_weights(weights, bit0, bit1, bit2, bit3);
// blue component
bit0 = BIT(color_prom[i | 0x200], 0);
bit1 = BIT(color_prom[i | 0x200], 1);
bit2 = BIT(color_prom[i | 0x200], 2);
bit3 = BIT(color_prom[i | 0x200], 3);
int const b = combine_4_weights(weights, bit0, bit1, bit2, bit3);
int const b = combine_weights(weights, bit0, bit1, bit2, bit3);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -53,18 +53,18 @@ void trackfld_state::trackfld_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -158,16 +158,16 @@ void tubep_state::tubep_palette(palette_device &palette)
bit0 = BIT(*color_prom, 0);
bit1 = BIT(*color_prom, 1);
bit2 = BIT(*color_prom, 2);
int const r = combine_3_weights(weights_txt_rg, bit0, bit1, bit2);
int const r = combine_weights(weights_txt_rg, bit0, bit1, bit2);
// green component
bit0 = BIT(*color_prom, 3);
bit1 = BIT(*color_prom, 4);
bit2 = BIT(*color_prom, 5);
int const g = combine_3_weights(weights_txt_rg, bit0, bit1, bit2);
int const g = combine_weights(weights_txt_rg, bit0, bit1, bit2);
// blue component
bit0 = BIT(*color_prom, 6);
bit1 = BIT(*color_prom, 7);
int const b = combine_2_weights(weights_txt_b, bit0, bit1);
int const b = combine_weights(weights_txt_b, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
@ -692,16 +692,16 @@ void tubep_state::rjammer_palette(palette_device &palette) const
bit0 = BIT(*color_prom, 0);
bit1 = BIT(*color_prom, 1);
bit2 = BIT(*color_prom, 2);
int const r = combine_3_weights(weights_rg, bit0, bit1, bit2);
int const r = combine_weights(weights_rg, bit0, bit1, bit2);
// green component
bit0 = BIT(*color_prom, 3);
bit1 = BIT(*color_prom, 4);
bit2 = BIT(*color_prom, 5);
int const g = combine_3_weights(weights_rg, bit0, bit1, bit2);
int const g = combine_weights(weights_rg, bit0, bit1, bit2);
// blue component
bit0 = BIT(*color_prom, 6);
bit1 = BIT(*color_prom, 7);
int const b = combine_2_weights(weights_b, bit0, bit1);
int const b = combine_weights(weights_b, bit0, bit1);
palette.set_pen_color(i, rgb_t(r,g,b));

View File

@ -42,13 +42,13 @@ void turbo_state::turbo_palette(palette_device &palette) const
for (int i = 0; i < 256; i++)
{
// red component
int const r = combine_3_weights(rweights, BIT(i, 0), BIT(i, 1), BIT(i, 2));
int const r = combine_weights(rweights, BIT(i, 0), BIT(i, 1), BIT(i, 2));
// green component
int const g = combine_3_weights(gweights, BIT(i, 3), BIT(i, 4), BIT(i, 5));
int const g = combine_weights(gweights, BIT(i, 3), BIT(i, 4), BIT(i, 5));
// blue component
int const b = combine_2_weights(bweights, BIT(i, 6), BIT(i, 7));
int const b = combine_weights(bweights, BIT(i, 6), BIT(i, 7));
palette.set_pen_color(i, rgb_t(r, g, b));
}
@ -70,13 +70,13 @@ void turbo_state::subroc3d_palette(palette_device &palette) const
for (int i = 0; i < 256; i++)
{
// red component
int const r = combine_3_weights(rweights, BIT(i, 0), BIT(i, 1), BIT(i, 2));
int const r = combine_weights(rweights, BIT(i, 0), BIT(i, 1), BIT(i, 2));
// green component
int const g = combine_3_weights(gweights, BIT(i, 3), BIT(i, 4), BIT(i, 5));
int const g = combine_weights(gweights, BIT(i, 3), BIT(i, 4), BIT(i, 5));
// blue component
int const b = combine_2_weights(bweights, BIT(i, 6), BIT(i, 7));
int const b = combine_weights(bweights, BIT(i, 6), BIT(i, 7));
palette.set_pen_color(i, rgb_t(r, g, b));
}
@ -98,13 +98,13 @@ void turbo_state::buckrog_palette(palette_device &palette) const
for (int i = 0; i < 1024; i++)
{
// red component
int const r = combine_3_weights(rweights, BIT(i, 0), BIT(i, 1), BIT(i, 2));
int const r = combine_weights(rweights, BIT(i, 0), BIT(i, 1), BIT(i, 2));
// green component
int const g = combine_3_weights(gweights, BIT(i, 3), BIT(i, 4), BIT(i, 5));
int const g = combine_weights(gweights, BIT(i, 3), BIT(i, 4), BIT(i, 5));
// blue component - note the shuffled bits
int const b = combine_4_weights(bweights, BIT(i, 8), BIT(i, 9), BIT(i, 6), BIT(i, 7));
int const b = combine_weights(bweights, BIT(i, 8), BIT(i, 9), BIT(i, 6), BIT(i, 7));
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -112,18 +112,18 @@ void warpwarp_state::warpwarp_palette(palette_device &palette) const
bit0 = BIT(i, 0);
bit1 = BIT(i, 1);
bit2 = BIT(i, 2);
int const r = combine_3_weights(weights_tiles_rg, bit0, bit1, bit2);
int const r = combine_weights(weights_tiles_rg, bit0, bit1, bit2);
// green component
bit0 = BIT(i, 3);
bit1 = BIT(i, 4);
bit2 = BIT(i, 5);
int const g = combine_3_weights(weights_tiles_rg, bit0, bit1, bit2);
int const g = combine_weights(weights_tiles_rg, bit0, bit1, bit2);
// blue component
bit0 = BIT(i, 6);
bit1 = BIT(i, 7);
int const b = combine_2_weights(weights_tiles_b, bit0, bit1);
int const b = combine_weights(weights_tiles_b, bit0, bit1);
palette.set_pen_color((i << 1) | 0, rgb_t::black());
palette.set_pen_color((i << 1) | 1, rgb_t(r, g, b));

View File

@ -330,9 +330,9 @@ void williams_state::williams_palette(palette_device &palette) const
// build a palette lookup
for (int i = 0; i < 256; i++)
{
int const r = combine_3_weights(weights_r, BIT(i, 0), BIT(i, 1), BIT(i, 2));
int const g = combine_3_weights(weights_g, BIT(i, 3), BIT(i, 4), BIT(i, 5));
int const b = combine_2_weights(weights_b, BIT(i, 6), BIT(i, 7));
int const r = combine_weights(weights_r, BIT(i, 0), BIT(i, 1), BIT(i, 2));
int const g = combine_weights(weights_g, BIT(i, 3), BIT(i, 4), BIT(i, 5));
int const b = combine_weights(weights_b, BIT(i, 6), BIT(i, 7));
palette.set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -41,18 +41,18 @@ void wiping_state::wiping_palette(palette_device &palette) const
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -50,21 +50,21 @@ void wiz_state::wiz_palette(palette_device &palette) const
bit1 = BIT(color_prom[i + 0x000], 1);
bit2 = BIT(color_prom[i + 0x000], 2);
bit3 = BIT(color_prom[i + 0x000], 3);
int const r = combine_4_weights(rweights, bit0, bit1, bit2, bit3);
int const r = combine_weights(rweights, bit0, bit1, bit2, bit3);
// green component
bit0 = BIT(color_prom[i + 0x100], 0);
bit1 = BIT(color_prom[i + 0x100], 1);
bit2 = BIT(color_prom[i + 0x100], 2);
bit3 = BIT(color_prom[i + 0x100], 3);
int const g = combine_4_weights(gweights, bit0, bit1, bit2, bit3);
int const g = combine_weights(gweights, bit0, bit1, bit2, bit3);
// blue component
bit0 = BIT(color_prom[i + 0x200], 0);
bit1 = BIT(color_prom[i + 0x200], 1);
bit2 = BIT(color_prom[i + 0x200], 2);
bit3 = BIT(color_prom[i + 0x200], 3);
int const b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
int const b = combine_weights(bweights, bit0, bit1, bit2, bit3);
m_palette->set_pen_color(i, rgb_t(r, g, b));
}

View File

@ -67,18 +67,18 @@ void zaccaria_state::zaccaria_palette(palette_device &palette) const
bit0 = BIT(color_prom[i + 0x000], 3);
bit1 = BIT(color_prom[i + 0x000], 2);
bit2 = BIT(color_prom[i + 0x000], 1);
int const r = combine_3_weights(weights_rg, bit0, bit1, bit2);
int const r = combine_weights(weights_rg, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i + 0x000], 0);
bit1 = BIT(color_prom[i + 0x200], 3);
bit2 = BIT(color_prom[i + 0x200], 2);
int const g = combine_3_weights(weights_rg, bit0, bit1, bit2);
int const g = combine_weights(weights_rg, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i + 0x200], 1);
bit1 = BIT(color_prom[i + 0x200], 0);
int const b = combine_2_weights(weights_b, bit0, bit1);
int const b = combine_weights(weights_b, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}

View File

@ -38,18 +38,18 @@ void zaxxon_state::zaxxon_palette(palette_device &palette)
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_3_weights(rweights, bit0, bit1, bit2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_3_weights(gweights, bit0, bit1, bit2);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_2_weights(bweights, bit0, bit1);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_pen_color(i, rgb_t(r, g, b));
}