pacman/pacman_v.cpp: Made code less confusing.

This commit is contained in:
Vas Crabb 2024-03-24 01:25:03 +11:00
parent 467e577ee4
commit f2f62c0d66

View File

@ -120,11 +120,11 @@ void pacman_state::pacman_rbg_palette(palette_device &palette) const
static constexpr int resistances[3] = { 1000, 470, 220 };
// compute the color output resistor weights
double rweights[3], gweights[3], bweights[2];
double rweights[3], bweights[3], gweights[2];
compute_resistor_weights(0, 255, -1.0,
3, &resistances[0], rweights, 0, 0,
3, &resistances[0], gweights, 0, 0,
2, &resistances[1], bweights, 0, 0);
3, &resistances[0], bweights, 0, 0,
2, &resistances[1], gweights, 0, 0);
// create a lookup table for the palette
for (int i = 0; i < 32; i++)
@ -137,18 +137,18 @@ void pacman_state::pacman_rbg_palette(palette_device &palette) const
bit2 = BIT(color_prom[i], 2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
// blue component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_weights(gweights, bit0, bit1, bit2);
int const b = combine_weights(bweights, bit0, bit1, bit2);
// blue component
// green component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_weights(bweights, bit0, bit1);
int const g = combine_weights(gweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, b, g));
palette.set_indirect_color(i, rgb_t(r, g, b));
}
// color_prom now points to the beginning of the lookup table