summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2019-02-09 21:28:39 +1100
committer Vas Crabb <vas@vastheman.com>2019-02-09 21:28:39 +1100
commit422d365332f6868e6c09db48812d5ff9df52f259 (patch)
treeaa2ad472bbb0db9dcbb45b0a8dbe01af4160f258
parent536408762930a91f92208d85e2ecac270f5ec140 (diff)
get rid of some copy/pasted macros for different numbers of arguments (nw)
-rw-r--r--src/devices/sound/cdp1864.cpp12
-rw-r--r--src/devices/video/mb_vcu.cpp12
-rw-r--r--src/emu/video/resnet.h23
-rw-r--r--src/mame/audio/tx1.cpp8
-rw-r--r--src/mame/drivers/beezer.cpp6
-rw-r--r--src/mame/drivers/berzerk.cpp6
-rw-r--r--src/mame/drivers/dacholer.cpp6
-rw-r--r--src/mame/drivers/dmndrby.cpp6
-rw-r--r--src/mame/drivers/ettrivia.cpp6
-rw-r--r--src/mame/drivers/fortecar.cpp6
-rw-r--r--src/mame/drivers/jangou.cpp6
-rw-r--r--src/mame/drivers/looping.cpp6
-rw-r--r--src/mame/drivers/meijinsn.cpp6
-rw-r--r--src/mame/drivers/monzagp.cpp6
-rw-r--r--src/mame/drivers/mpu4dealem.cpp6
-rw-r--r--src/mame/drivers/mrgame.cpp6
-rw-r--r--src/mame/drivers/nightgal.cpp6
-rw-r--r--src/mame/drivers/segaxbd.cpp6
-rw-r--r--src/mame/drivers/shougi.cpp6
-rw-r--r--src/mame/drivers/supercrd.cpp6
-rw-r--r--src/mame/drivers/superdq.cpp6
-rw-r--r--src/mame/drivers/wallc.cpp12
-rw-r--r--src/mame/includes/m52.h3
-rw-r--r--src/mame/machine/segaic16.cpp6
-rw-r--r--src/mame/video/ampoker2.cpp6
-rw-r--r--src/mame/video/astrocde.cpp6
-rw-r--r--src/mame/video/bagman.cpp6
-rw-r--r--src/mame/video/bking.cpp6
-rw-r--r--src/mame/video/ccastles.cpp6
-rw-r--r--src/mame/video/cclimber.cpp6
-rw-r--r--src/mame/video/champbas.cpp6
-rw-r--r--src/mame/video/circusc.cpp6
-rw-r--r--src/mame/video/cloak.cpp6
-rw-r--r--src/mame/video/cloud9.cpp6
-rw-r--r--src/mame/video/divebomb.cpp6
-rw-r--r--src/mame/video/exerion.cpp6
-rw-r--r--src/mame/video/fastfred.cpp6
-rw-r--r--src/mame/video/finalizr.cpp6
-rw-r--r--src/mame/video/foodf.cpp6
-rw-r--r--src/mame/video/funworld.cpp6
-rw-r--r--src/mame/video/galaxian.cpp6
-rw-r--r--src/mame/video/gottlieb.cpp6
-rw-r--r--src/mame/video/gotya.cpp6
-rw-r--r--src/mame/video/grchamp.cpp6
-rw-r--r--src/mame/video/gyruss.cpp6
-rw-r--r--src/mame/video/hyperspt.cpp6
-rw-r--r--src/mame/video/ironhors.cpp6
-rw-r--r--src/mame/video/kingobox.cpp6
-rw-r--r--src/mame/video/ladybug.cpp6
-rw-r--r--src/mame/video/lucky74.cpp12
-rw-r--r--src/mame/video/m52.cpp25
-rw-r--r--src/mame/video/m58.cpp18
-rw-r--r--src/mame/video/mappy.cpp18
-rw-r--r--src/mame/video/megazone.cpp6
-rw-r--r--src/mame/video/mikie.cpp6
-rw-r--r--src/mame/video/mystston.cpp6
-rw-r--r--src/mame/video/naughtyb.cpp6
-rw-r--r--src/mame/video/neogeo.cpp8
-rw-r--r--src/mame/video/nick.cpp6
-rw-r--r--src/mame/video/pacman.cpp6
-rw-r--r--src/mame/video/pandoras.cpp6
-rw-r--r--src/mame/video/pooyan.cpp6
-rw-r--r--src/mame/video/rallyx.cpp18
-rw-r--r--src/mame/video/redalert.cpp6
-rw-r--r--src/mame/video/rocnrope.cpp6
-rw-r--r--src/mame/video/sbasketb.cpp6
-rw-r--r--src/mame/video/segag80r.cpp12
-rw-r--r--src/mame/video/shaolins.cpp6
-rw-r--r--src/mame/video/snookr10.cpp18
-rw-r--r--src/mame/video/spacefb.cpp12
-rw-r--r--src/mame/video/system16.cpp18
-rw-r--r--src/mame/video/taitosj.cpp6
-rw-r--r--src/mame/video/timelimt.cpp6
-rw-r--r--src/mame/video/tp84.cpp6
-rw-r--r--src/mame/video/trackfld.cpp6
-rw-r--r--src/mame/video/tubep.cpp12
-rw-r--r--src/mame/video/turbo.cpp18
-rw-r--r--src/mame/video/warpwarp.cpp6
-rw-r--r--src/mame/video/williams.cpp6
-rw-r--r--src/mame/video/wiping.cpp6
-rw-r--r--src/mame/video/wiz.cpp6
-rw-r--r--src/mame/video/zaccaria.cpp6
-rw-r--r--src/mame/video/zaxxon.cpp6
83 files changed, 321 insertions, 328 deletions
diff --git a/src/devices/sound/cdp1864.cpp b/src/devices/sound/cdp1864.cpp
index 58697352b8d..de39b3390c8 100644
--- a/src/devices/sound/cdp1864.cpp
+++ b/src/devices/sound/cdp1864.cpp
@@ -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);
}
diff --git a/src/devices/video/mb_vcu.cpp b/src/devices/video/mb_vcu.cpp
index 8d0f921be12..1624a045ceb 100644
--- a/src/devices/video/mb_vcu.cpp
+++ b/src/devices/video/mb_vcu.cpp
@@ -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));
}
diff --git a/src/emu/video/resnet.h b/src/emu/video/resnet.h
index e3f8ad78a68..acc62bece79 100644
--- a/src/emu/video/resnet.h
+++ b/src/emu/video/resnet.h
@@ -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 );
diff --git a/src/mame/audio/tx1.cpp b/src/mame/audio/tx1.cpp
index d7eaf9d009a..b8fcd87e4c8 100644
--- a/src/mame/audio/tx1.cpp
+++ b/src/mame/audio/tx1.cpp
@@ -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());
diff --git a/src/mame/drivers/beezer.cpp b/src/mame/drivers/beezer.cpp
index 12eedb3a903..c8c7b38e165 100644
--- a/src/mame/drivers/beezer.cpp
+++ b/src/mame/drivers/beezer.cpp
@@ -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));
}
diff --git a/src/mame/drivers/berzerk.cpp b/src/mame/drivers/berzerk.cpp
index ad462685c16..3443db68d81 100644
--- a/src/mame/drivers/berzerk.cpp
+++ b/src/mame/drivers/berzerk.cpp
@@ -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);
}
diff --git a/src/mame/drivers/dacholer.cpp b/src/mame/drivers/dacholer.cpp
index 6ccbbb186b1..26d330b5eab 100644
--- a/src/mame/drivers/dacholer.cpp
+++ b/src/mame/drivers/dacholer.cpp
@@ -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));
}
diff --git a/src/mame/drivers/dmndrby.cpp b/src/mame/drivers/dmndrby.cpp
index 24daa0a89df..00f63ad35a8 100644
--- a/src/mame/drivers/dmndrby.cpp
+++ b/src/mame/drivers/dmndrby.cpp
@@ -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));
}
diff --git a/src/mame/drivers/ettrivia.cpp b/src/mame/drivers/ettrivia.cpp
index abcead4b5eb..3001195975a 100644
--- a/src/mame/drivers/ettrivia.cpp
+++ b/src/mame/drivers/ettrivia.cpp
@@ -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));
}
diff --git a/src/mame/drivers/fortecar.cpp b/src/mame/drivers/fortecar.cpp
index c6efb77ede0..549c2d6e45d 100644
--- a/src/mame/drivers/fortecar.cpp
+++ b/src/mame/drivers/fortecar.cpp
@@ -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));
}
diff --git a/src/mame/drivers/jangou.cpp b/src/mame/drivers/jangou.cpp
index 229cdda4e04..7b9844585e2 100644
--- a/src/mame/drivers/jangou.cpp
+++ b/src/mame/drivers/jangou.cpp
@@ -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));
}
diff --git a/src/mame/drivers/looping.cpp b/src/mame/drivers/looping.cpp
index ff23f1f710b..2169d23fd03 100644
--- a/src/mame/drivers/looping.cpp
+++ b/src/mame/drivers/looping.cpp
@@ -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));
}
diff --git a/src/mame/drivers/meijinsn.cpp b/src/mame/drivers/meijinsn.cpp
index fc911c71e69..bb3ffb08ee6 100644
--- a/src/mame/drivers/meijinsn.cpp
+++ b/src/mame/drivers/meijinsn.cpp
@@ -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));
}
diff --git a/src/mame/drivers/monzagp.cpp b/src/mame/drivers/monzagp.cpp
index a62001a871b..074edd9f8a5 100644
--- a/src/mame/drivers/monzagp.cpp
+++ b/src/mame/drivers/monzagp.cpp
@@ -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));
}
diff --git a/src/mame/drivers/mpu4dealem.cpp b/src/mame/drivers/mpu4dealem.cpp
index 1da3915b423..a94ca7edc8b 100644
--- a/src/mame/drivers/mpu4dealem.cpp
+++ b/src/mame/drivers/mpu4dealem.cpp
@@ -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++;
diff --git a/src/mame/drivers/mrgame.cpp b/src/mame/drivers/mrgame.cpp
index e966ad5c383..668be86582f 100644
--- a/src/mame/drivers/mrgame.cpp
+++ b/src/mame/drivers/mrgame.cpp
@@ -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));
diff --git a/src/mame/drivers/nightgal.cpp b/src/mame/drivers/nightgal.cpp
index 03f27f4a183..efe2d4af8c7 100644
--- a/src/mame/drivers/nightgal.cpp
+++ b/src/mame/drivers/nightgal.cpp
@@ -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));
}
diff --git a/src/mame/drivers/segaxbd.cpp b/src/mame/drivers/segaxbd.cpp
index e4a110cb409..38452f859a1 100644
--- a/src/mame/drivers/segaxbd.cpp
+++ b/src/mame/drivers/segaxbd.cpp
@@ -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);
}
}
diff --git a/src/mame/drivers/shougi.cpp b/src/mame/drivers/shougi.cpp
index 8f5e5476d7e..08014c47354 100644
--- a/src/mame/drivers/shougi.cpp
+++ b/src/mame/drivers/shougi.cpp
@@ -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));
}
diff --git a/src/mame/drivers/supercrd.cpp b/src/mame/drivers/supercrd.cpp
index ff3e1dd79d2..d0b1addea3b 100644
--- a/src/mame/drivers/supercrd.cpp
+++ b/src/mame/drivers/supercrd.cpp
@@ -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));
}
diff --git a/src/mame/drivers/superdq.cpp b/src/mame/drivers/superdq.cpp
index 8179867cb92..98c6cbb662b 100644
--- a/src/mame/drivers/superdq.cpp
+++ b/src/mame/drivers/superdq.cpp
@@ -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));
}
diff --git a/src/mame/drivers/wallc.cpp b/src/mame/drivers/wallc.cpp
index 50ae92b81cb..1663704cf3a 100644
--- a/src/mame/drivers/wallc.cpp
+++ b/src/mame/drivers/wallc.cpp
@@ -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));
}
diff --git a/src/mame/includes/m52.h b/src/mame/includes/m52.h
index 5a5eccd6f5d..58f0d441ffe 100644
--- a/src/mame/includes/m52.h
+++ b/src/mame/includes/m52.h
@@ -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);
diff --git a/src/mame/machine/segaic16.cpp b/src/mame/machine/segaic16.cpp
index 5f80c323933..2cdf44af85b 100644
--- a/src/mame/machine/segaic16.cpp
+++ b/src/mame/machine/segaic16.cpp
@@ -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);
}
}
diff --git a/src/mame/video/ampoker2.cpp b/src/mame/video/ampoker2.cpp
index 358b720e20d..fafd36e60c7 100644
--- a/src/mame/video/ampoker2.cpp
+++ b/src/mame/video/ampoker2.cpp
@@ -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));
}
diff --git a/src/mame/video/astrocde.cpp b/src/mame/video/astrocde.cpp
index 2dbb9991410..63e35e6184c 100644
--- a/src/mame/video/astrocde.cpp
+++ b/src/mame/video/astrocde.cpp
@@ -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));
}
diff --git a/src/mame/video/bagman.cpp b/src/mame/video/bagman.cpp
index 41e61a97311..6b0e9036074 100644
--- a/src/mame/video/bagman.cpp
+++ b/src/mame/video/bagman.cpp
@@ -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));
}
diff --git a/src/mame/video/bking.cpp b/src/mame/video/bking.cpp
index 678482e5d7b..59d43fbc4dc 100644
--- a/src/mame/video/bking.cpp
+++ b/src/mame/video/bking.cpp
@@ -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));
}
diff --git a/src/mame/video/ccastles.cpp b/src/mame/video/ccastles.cpp
index 96981f086d2..79571327ddd 100644
--- a/src/mame/video/ccastles.cpp
+++ b/src/mame/video/ccastles.cpp
@@ -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));
}
diff --git a/src/mame/video/cclimber.cpp b/src/mame/video/cclimber.cpp
index 370f2987f09..2e7ff665d84 100644
--- a/src/mame/video/cclimber.cpp
+++ b/src/mame/video/cclimber.cpp
@@ -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));
}
diff --git a/src/mame/video/champbas.cpp b/src/mame/video/champbas.cpp
index 8357dfa7581..f329bc31622 100644
--- a/src/mame/video/champbas.cpp
+++ b/src/mame/video/champbas.cpp
@@ -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));
}
diff --git a/src/mame/video/circusc.cpp b/src/mame/video/circusc.cpp
index f8d06ff65b7..fa50b26a0a8 100644
--- a/src/mame/video/circusc.cpp
+++ b/src/mame/video/circusc.cpp
@@ -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));
}
diff --git a/src/mame/video/cloak.cpp b/src/mame/video/cloak.cpp
index d550499533f..351379a4ada 100644
--- a/src/mame/video/cloak.cpp
+++ b/src/mame/video/cloak.cpp
@@ -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));
}
diff --git a/src/mame/video/cloud9.cpp b/src/mame/video/cloud9.cpp
index af1d5d5c6d1..f126bf98acb 100644
--- a/src/mame/video/cloud9.cpp
+++ b/src/mame/video/cloud9.cpp
@@ -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));
}
diff --git a/src/mame/video/divebomb.cpp b/src/mame/video/divebomb.cpp
index 801f8940794..1b5bd73fdee 100644
--- a/src/mame/video/divebomb.cpp
+++ b/src/mame/video/divebomb.cpp
@@ -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));
diff --git a/src/mame/video/exerion.cpp b/src/mame/video/exerion.cpp
index feaaa9246f4..459824cb202 100644
--- a/src/mame/video/exerion.cpp
+++ b/src/mame/video/exerion.cpp
@@ -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));
}
diff --git a/src/mame/video/fastfred.cpp b/src/mame/video/fastfred.cpp
index 73aad7722d0..13ae8f0c554 100644
--- a/src/mame/video/fastfred.cpp
+++ b/src/mame/video/fastfred.cpp
@@ -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));
}
diff --git a/src/mame/video/finalizr.cpp b/src/mame/video/finalizr.cpp
index 279e77bced8..e0f05132bb8 100644
--- a/src/mame/video/finalizr.cpp
+++ b/src/mame/video/finalizr.cpp
@@ -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));
}
diff --git a/src/mame/video/foodf.cpp b/src/mame/video/foodf.cpp
index b2ea49556b3..92ab95dc0ff 100644
--- a/src/mame/video/foodf.cpp
+++ b/src/mame/video/foodf.cpp
@@ -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));
}
diff --git a/src/mame/video/funworld.cpp b/src/mame/video/funworld.cpp
index 60443c921d2..82345499aa2 100644
--- a/src/mame/video/funworld.cpp
+++ b/src/mame/video/funworld.cpp
@@ -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));
}
diff --git a/src/mame/video/galaxian.cpp b/src/mame/video/galaxian.cpp
index 6147fcbce11..f3a192ad024 100644
--- a/src/mame/video/galaxian.cpp
+++ b/src/mame/video/galaxian.cpp
@@ -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));
}
diff --git a/src/mame/video/gottlieb.cpp b/src/mame/video/gottlieb.cpp
index b92fb9ef792..f108ad2c512 100644
--- a/src/mame/video/gottlieb.cpp
+++ b/src/mame/video/gottlieb.cpp
@@ -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;
diff --git a/src/mame/video/gotya.cpp b/src/mame/video/gotya.cpp
index 0fe00462fc9..473676eef7e 100644
--- a/src/mame/video/gotya.cpp
+++ b/src/mame/video/gotya.cpp
@@ -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));
}
diff --git a/src/mame/video/grchamp.cpp b/src/mame/video/grchamp.cpp
index b95d3e2846a..03eb3b23b6f 100644
--- a/src/mame/video/grchamp.cpp
+++ b/src/mame/video/grchamp.cpp
@@ -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));
}
diff --git a/src/mame/video/gyruss.cpp b/src/mame/video/gyruss.cpp
index 61ddfee37b2..c4787fa72ee 100644
--- a/src/mame/video/gyruss.cpp
+++ b/src/mame/video/gyruss.cpp
@@ -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));
}
diff --git a/src/mame/video/hyperspt.cpp b/src/mame/video/hyperspt.cpp
index 95ae4941cdf..e6e21823296 100644
--- a/src/mame/video/hyperspt.cpp
+++ b/src/mame/video/hyperspt.cpp
@@ -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));
}
diff --git a/src/mame/video/ironhors.cpp b/src/mame/video/ironhors.cpp
index 973d0f0318f..eda424a1e15 100644
--- a/src/mame/video/ironhors.cpp
+++ b/src/mame/video/ironhors.cpp
@@ -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));
}
diff --git a/src/mame/video/kingobox.cpp b/src/mame/video/kingobox.cpp
index a4a10cbda46..70e62dac753 100644
--- a/src/mame/video/kingobox.cpp
+++ b/src/mame/video/kingobox.cpp
@@ -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));
}
diff --git a/src/mame/video/ladybug.cpp b/src/mame/video/ladybug.cpp
index b6b0c4f5878..ae69cb4d321 100644
--- a/src/mame/video/ladybug.cpp
+++ b/src/mame/video/ladybug.cpp
@@ -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));
}
diff --git a/src/mame/video/lucky74.cpp b/src/mame/video/lucky74.cpp
index b295311e6c2..adf9b5a5623 100644
--- a/src/mame/video/lucky74.cpp
+++ b/src/mame/video/lucky74.cpp
@@ -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
diff --git a/src/mame/video/m52.cpp b/src/mame/video/m52.cpp
index 5d73df8fcd6..dedb6bb33ad 100644
--- a/src/mame/video/m52.cpp
+++ b/src/mame/video/m52.cpp
@@ -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));
}
diff --git a/src/mame/video/m58.cpp b/src/mame/video/m58.cpp
index 55dca247574..413cca1e90f 100644
--- a/src/mame/video/m58.cpp
+++ b/src/mame/video/m58.cpp
@@ -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));
}
diff --git a/src/mame/video/mappy.cpp b/src/mame/video/mappy.cpp
index 81828b961a7..ccb2a54715c 100644
--- a/src/mame/video/mappy.cpp
+++ b/src/mame/video/mappy.cpp
@@ -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));
}
diff --git a/src/mame/video/megazone.cpp b/src/mame/video/megazone.cpp
index fb3356010fa..908aef20564 100644
--- a/src/mame/video/megazone.cpp
+++ b/src/mame/video/megazone.cpp
@@ -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));
}
diff --git a/src/mame/video/mikie.cpp b/src/mame/video/mikie.cpp
index ec37c32e220..434bbbf82e9 100644
--- a/src/mame/video/mikie.cpp
+++ b/src/mame/video/mikie.cpp
@@ -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));
}
diff --git a/src/mame/video/mystston.cpp b/src/mame/video/mystston.cpp
index db8335090e8..efa90c607ef 100644
--- a/src/mame/video/mystston.cpp
+++ b/src/mame/video/mystston.cpp
@@ -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));
}
diff --git a/src/mame/video/naughtyb.cpp b/src/mame/video/naughtyb.cpp
index 650183619bb..ef6ebf5f485 100644
--- a/src/mame/video/naughtyb.cpp
+++ b/src/mame/video/naughtyb.cpp
@@ -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));
}
diff --git a/src/mame/video/neogeo.cpp b/src/mame/video/neogeo.cpp
index 47e88ab434c..4360a7c6dde 100644
--- a/src/mame/video/neogeo.cpp
+++ b/src/mame/video/neogeo.cpp
@@ -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);
}
}
diff --git a/src/mame/video/nick.cpp b/src/mame/video/nick.cpp
index 79a8e4b4625..a70c2d12081 100644
--- a/src/mame/video/nick.cpp
+++ b/src/mame/video/nick.cpp
@@ -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);
}
diff --git a/src/mame/video/pacman.cpp b/src/mame/video/pacman.cpp
index 6325500b408..cda16a3ea48 100644
--- a/src/mame/video/pacman.cpp
+++ b/src/mame/video/pacman.cpp
@@ -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));
}
diff --git a/src/mame/video/pandoras.cpp b/src/mame/video/pandoras.cpp
index bf2afb944f8..f47f83e1826 100644
--- a/src/mame/video/pandoras.cpp
+++ b/src/mame/video/pandoras.cpp
@@ -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));
}
diff --git a/src/mame/video/pooyan.cpp b/src/mame/video/pooyan.cpp
index 255c69324ce..e1fbc6f2875 100644
--- a/src/mame/video/pooyan.cpp
+++ b/src/mame/video/pooyan.cpp
@@ -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));
}
diff --git a/src/mame/video/rallyx.cpp b/src/mame/video/rallyx.cpp
index 8df8741902d..0823b3fc8e7 100644
--- a/src/mame/video/rallyx.cpp
+++ b/src/mame/video/rallyx.cpp
@@ -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));
}
diff --git a/src/mame/video/redalert.cpp b/src/mame/video/redalert.cpp
index e045aee9e26..817804bb736 100644
--- a/src/mame/video/redalert.cpp
+++ b/src/mame/video/redalert.cpp
@@ -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);
}
diff --git a/src/mame/video/rocnrope.cpp b/src/mame/video/rocnrope.cpp
index b0b029b0903..f8a253cddec 100644
--- a/src/mame/video/rocnrope.cpp
+++ b/src/mame/video/rocnrope.cpp
@@ -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));
}
diff --git a/src/mame/video/sbasketb.cpp b/src/mame/video/sbasketb.cpp
index fb0381d0bb6..f7fc1e0345c 100644
--- a/src/mame/video/sbasketb.cpp
+++ b/src/mame/video/sbasketb.cpp
@@ -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));
}
diff --git a/src/mame/video/segag80r.cpp b/src/mame/video/segag80r.cpp
index c92f4db537e..af00f8240f1 100644
--- a/src/mame/video/segag80r.cpp
+++ b/src/mame/video/segag80r.cpp
@@ -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));
}
diff --git a/src/mame/video/shaolins.cpp b/src/mame/video/shaolins.cpp
index d78d5169dc3..eab6c5d169b 100644
--- a/src/mame/video/shaolins.cpp
+++ b/src/mame/video/shaolins.cpp
@@ -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));
}
diff --git a/src/mame/video/snookr10.cpp b/src/mame/video/snookr10.cpp
index 34ea2d82094..ecc5529d71f 100644
--- a/src/mame/video/snookr10.cpp
+++ b/src/mame/video/snookr10.cpp
@@ -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);
diff --git a/src/mame/video/spacefb.cpp b/src/mame/video/spacefb.cpp
index 69c4e4e5f2b..8556da42b7a 100644
--- a/src/mame/video/spacefb.cpp
+++ b/src/mame/video/spacefb.cpp
@@ -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)
{
diff --git a/src/mame/video/system16.cpp b/src/mame/video/system16.cpp
index d7e66cf9c21..8fdec421bf1 100644
--- a/src/mame/video/system16.cpp
+++ b/src/mame/video/system16.cpp
@@ -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) );
diff --git a/src/mame/video/taitosj.cpp b/src/mame/video/taitosj.cpp
index 69f6896e82e..4a4366eb79c 100644
--- a/src/mame/video/taitosj.cpp
+++ b/src/mame/video/taitosj.cpp
@@ -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));
}
diff --git a/src/mame/video/timelimt.cpp b/src/mame/video/timelimt.cpp
index 1d3f1020e55..3dc75daf30b 100644
--- a/src/mame/video/timelimt.cpp
+++ b/src/mame/video/timelimt.cpp
@@ -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));
}
diff --git a/src/mame/video/tp84.cpp b/src/mame/video/tp84.cpp
index 14a64748c89..726b97417ff 100644
--- a/src/mame/video/tp84.cpp
+++ b/src/mame/video/tp84.cpp
@@ -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));
}
diff --git a/src/mame/video/trackfld.cpp b/src/mame/video/trackfld.cpp
index 0e89d6f1869..807ee3961f0 100644
--- a/src/mame/video/trackfld.cpp
+++ b/src/mame/video/trackfld.cpp
@@ -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));
}
diff --git a/src/mame/video/tubep.cpp b/src/mame/video/tubep.cpp
index dbc89df3845..100df948494 100644
--- a/src/mame/video/tubep.cpp
+++ b/src/mame/video/tubep.cpp
@@ -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));
diff --git a/src/mame/video/turbo.cpp b/src/mame/video/turbo.cpp
index 7d61bbfc61a..a23d7370906 100644
--- a/src/mame/video/turbo.cpp
+++ b/src/mame/video/turbo.cpp
@@ -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));
}
diff --git a/src/mame/video/warpwarp.cpp b/src/mame/video/warpwarp.cpp
index a6bc99ce8ac..10bb73b47f2 100644
--- a/src/mame/video/warpwarp.cpp
+++ b/src/mame/video/warpwarp.cpp
@@ -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));
diff --git a/src/mame/video/williams.cpp b/src/mame/video/williams.cpp
index 77f16f5d58a..ae81e4d3638 100644
--- a/src/mame/video/williams.cpp
+++ b/src/mame/video/williams.cpp
@@ -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));
}
diff --git a/src/mame/video/wiping.cpp b/src/mame/video/wiping.cpp
index 8539998fbe4..01260184c2c 100644
--- a/src/mame/video/wiping.cpp
+++ b/src/mame/video/wiping.cpp
@@ -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));
}
diff --git a/src/mame/video/wiz.cpp b/src/mame/video/wiz.cpp
index e1b23685ca7..381862a1532 100644
--- a/src/mame/video/wiz.cpp
+++ b/src/mame/video/wiz.cpp
@@ -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));
}
diff --git a/src/mame/video/zaccaria.cpp b/src/mame/video/zaccaria.cpp
index 9616b66ec24..99e898b0c27 100644
--- a/src/mame/video/zaccaria.cpp
+++ b/src/mame/video/zaccaria.cpp
@@ -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));
}
diff --git a/src/mame/video/zaxxon.cpp b/src/mame/video/zaxxon.cpp
index 76b11ba6a98..ae7be184bf3 100644
--- a/src/mame/video/zaxxon.cpp
+++ b/src/mame/video/zaxxon.cpp
@@ -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));
}