void nubus_procolor816_device::device_reset() { m_count = 0; m_clutoffs = 0; m_vbl_disable = 1; m_mode = 3; memset(m_vram, 0, VRAM_SIZE); memset(m_palette, 0, sizeof(m_palette)); m_palette[0] = MAKE_RGB(255, 255, 255); m_palette[0x80] = MAKE_RGB(0, 0, 0); }
GFXDECODE_END void lazercmd_state::palette_init() { palette_set_color(machine(), 0, MAKE_RGB(0xb0, 0xb0, 0xb0)); /* white */ palette_set_color(machine(), 1, MAKE_RGB(0x00, 0x00, 0x00)); /* black */ palette_set_color(machine(), 2, MAKE_RGB(0x00, 0x00, 0x00)); /* black */ palette_set_color(machine(), 3, MAKE_RGB(0xb0, 0xb0, 0xb0)); /* white */ palette_set_color(machine(), 4, MAKE_RGB(0xff, 0xff, 0xff)); /* bright white */ }
void nubus_radiustpd_device::device_reset() { m_count = 0; m_clutoffs = 0; m_vbl_disable = 1; m_mode = 0; memset(m_vram, 0, VRAM_SIZE); memset(m_palette, 0, sizeof(m_palette)); m_palette[1] = MAKE_RGB(255, 255, 255); m_palette[0] = MAKE_RGB(0, 0, 0); }
GFXDECODE_END static PALETTE_INIT( lazercmd ) { palette_set_color(machine, 0, MAKE_RGB(0xb0, 0xb0, 0xb0)); /* white */ palette_set_color(machine, 1, MAKE_RGB(0x00, 0x00, 0x00)); /* black */ palette_set_color(machine, 2, MAKE_RGB(0x00, 0x00, 0x00)); /* black */ palette_set_color(machine, 3, MAKE_RGB(0xb0, 0xb0, 0xb0)); /* white */ palette_set_color(machine, 4, MAKE_RGB(0xff, 0xff, 0xff)); /* bright white */ }
void AddDebugBone( const Mth::Vector& p1, const Mth::Vector& p2, float red, float green, float blue ) { #ifdef __DEBUG_CODE__ // GJ: Pretty much the same as AddDebugLine, but with // a more convenient interface for the skeleton code Gfx::AddDebugLine( p1, p2, MAKE_RGB( (int)(red * 255), (int)(green * 255), (int)(blue * 255) ), MAKE_RGB( (int)(red * 255), (int)(green * 255), (int)(blue * 255) ), 1 ); #endif }
INPUT_PORTS_END #endif //************************************************************************** // PALETTE //************************************************************************** void px4_state::palette_init() { palette_set_color(machine(), 0, MAKE_RGB(138, 146, 148)); palette_set_color(machine(), 1, MAKE_RGB(92, 83, 88)); }
INPUT_PORTS_END /*************************************************************************** PALETTE ***************************************************************************/ void apricot_state::palette_init() { palette_set_color(machine(), 0, MAKE_RGB(0x00, 0x00, 0x00)); /* black */ palette_set_color(machine(), 1, MAKE_RGB(0x00, 0x7f, 0x00)); /* low intensity */ palette_set_color(machine(), 2, MAKE_RGB(0x00, 0xff, 0x00)); /* high intensitiy */ }
INPUT_PORTS_END //************************************************************************** // VIDEO //************************************************************************** void portfolio_state::palette_init() { palette_set_color(machine(), 0, MAKE_RGB(138, 146, 148)); palette_set_color(machine(), 1, MAKE_RGB(92, 83, 88)); }
INPUT_PORTS_END /*************************************************************************** PALETTE ***************************************************************************/ static PALETTE_INIT( apricot ) { palette_set_color(machine, 0, MAKE_RGB(0x00, 0x00, 0x00)); /* black */ palette_set_color(machine, 1, MAKE_RGB(0x00, 0x7f, 0x00)); /* low intensity */ palette_set_color(machine, 2, MAKE_RGB(0x00, 0xff, 0x00)); /* high intensitiy */ }
void uv201_device::initialize_palette() { UINT8 offlointensity = 0x00; UINT8 offhiintensity = 0xc0; UINT8 onlointensity = 0xa0; UINT8 onhiintensity = 0xff; for (int i = 0; i < 4; i++) { int offset = i * 8; UINT8 onvalue, offvalue; if (offset < 16) { offvalue = offlointensity; onvalue = onlointensity; } else { offvalue = offhiintensity; onvalue = onhiintensity; } m_palette[offset + 0] = MAKE_RGB(offvalue, offvalue, offvalue); // black m_palette[offset + 1] = MAKE_RGB(onvalue, offvalue, offvalue); // red m_palette[offset + 2] = MAKE_RGB(offvalue, onvalue, offvalue); // green m_palette[offset + 3] = MAKE_RGB(onvalue, onvalue, offvalue); // red-green m_palette[offset + 4] = MAKE_RGB(offvalue, offvalue, onvalue); // blue m_palette[offset + 5] = MAKE_RGB(onvalue, offvalue, onvalue); // red-blue m_palette[offset + 6] = MAKE_RGB(offvalue, onvalue, onvalue); // green-blue m_palette[offset + 7] = MAKE_RGB(onvalue, onvalue, onvalue); // white } }
static void gfxset_draw_item(running_machine &machine, gfx_element *gfx, int index, bitmap_rgb32 &bitmap, int dstx, int dsty, int color, int rotate) { static const pen_t default_palette[] = { MAKE_RGB(0,0,0), MAKE_RGB(0,0,255), MAKE_RGB(0,255,0), MAKE_RGB(0,255,255), MAKE_RGB(255,0,0), MAKE_RGB(255,0,255), MAKE_RGB(255,255,0), MAKE_RGB(255,255,255) }; int width = (rotate & ORIENTATION_SWAP_XY) ? gfx->height() : gfx->width(); int height = (rotate & ORIENTATION_SWAP_XY) ? gfx->width() : gfx->height(); const rgb_t *palette = (machine.total_colors() != 0) ? palette_entry_list_raw(machine.palette) : NULL; UINT32 palette_mask = ~0; int x, y; if (palette != NULL) palette += gfx->colorbase() + color * gfx->granularity(); else { palette = default_palette; palette_mask = 7; } /* loop over rows in the cell */ for (y = 0; y < height; y++) { UINT32 *dest = &bitmap.pix32(dsty + y, dstx); const UINT8 *src = gfx->get_data(index); /* loop over columns in the cell */ for (x = 0; x < width; x++) { int effx = x, effy = y; const UINT8 *s; /* compute effective x,y values after rotation */ if (!(rotate & ORIENTATION_SWAP_XY)) { if (rotate & ORIENTATION_FLIP_X) effx = gfx->width() - 1 - effx; if (rotate & ORIENTATION_FLIP_Y) effy = gfx->height() - 1 - effy; } else { int temp; if (rotate & ORIENTATION_FLIP_X) effx = gfx->height() - 1 - effx; if (rotate & ORIENTATION_FLIP_Y) effy = gfx->width() - 1 - effy; temp = effx; effx = effy; effy = temp; } /* get a pointer to the start of this source row */ s = src + effy * gfx->rowbytes(); /* extract the pixel */ *dest++ = 0xff000000 | palette[s[effx] & palette_mask]; } } }
void qt_convert_NV21_to_ARGB32(const uchar *yuv, quint32 *rgb, int width, int height) { const uchar *y0 = yuv; const uchar *y1 = yuv + width; const uchar *vu = yuv + width * height; quint32 *rgb0 = rgb; quint32 *rgb1 = rgb + width; for (int i = 0; i < height; i += 2) { for (int j = 0; j < width; j += 2) { int v = *vu++; int u = *vu++; int ruv = coefficientsRV[v] >> 15; int guv = (coefficientsGU[u] + coefficientsGV[v]) >> 15; int buv = coefficientsBU[u] >> 15; int y = coefficientsY[*y0++] >> 15; int r = y + ruv; int g = y + guv; int b = y + buv; *rgb0++ = MAKE_RGB(r, g, b); y = coefficientsY[*y0++] >> 15; r = y + ruv; g = y + guv; b = y + buv; *rgb0++ = MAKE_RGB(r, g, b); y = coefficientsY[*y1++] >> 15; r = y + ruv; g = y + guv; b = y + buv; *rgb1++ = MAKE_RGB(r, g, b); y = coefficientsY[*y1++] >> 15; r = y + ruv; g = y + guv; b = y + buv; *rgb1++ = MAKE_RGB(r, g, b); } rgb0 += width; rgb1 += width; y0 += width; y1 += width; } }
INPUT_PORTS_END //************************************************************************** // VIDEO //************************************************************************** //------------------------------------------------- // PALETTE_INIT( portfolio ) //------------------------------------------------- static PALETTE_INIT( portfolio ) { palette_set_color(machine, 0, MAKE_RGB(138, 146, 148)); palette_set_color(machine, 1, MAKE_RGB(92, 83, 88)); }
void strnskil_state::palette_init() { const UINT8 *color_prom = memregion("proms")->base(); int i; /* allocate the colortable */ machine().colortable = colortable_alloc(machine(), 0x100); /* create a lookup table for the palette */ for (i = 0; i < 0x100; i++) { int r = pal4bit(color_prom[i + 0x000]); int g = pal4bit(color_prom[i + 0x100]); int b = pal4bit(color_prom[i + 0x200]); colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b)); } /* color_prom now points to the beginning of the lookup table */ color_prom += 0x300; /* sprites lookup table */ for (i = 0; i < 0x400; i++) { UINT8 ctabentry = color_prom[i]; colortable_entry_set_value(machine().colortable, i, ctabentry); } }
void retofinv_state::palette_init() { const UINT8 *color_prom = machine().root_device().memregion("proms")->base(); int i; /* allocate the colortable */ machine().colortable = colortable_alloc(machine(), 0x100); /* create a lookup table for the palette */ for (i = 0; i < 0x100; i++) { int r = pal4bit(color_prom[i + 0x000]); int g = pal4bit(color_prom[i + 0x100]); int b = pal4bit(color_prom[i + 0x200]); colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b)); } /* color_prom now points to the beginning of the lookup table */ color_prom += 0x300; /* fg chars (1bpp) */ for (i = 0; i < 0x200; i++) { UINT8 ctabentry; if (i & 0x01) ctabentry = i >> 1; else ctabentry = 0; colortable_entry_set_value(machine().colortable, i, ctabentry); }
const pen_t *tlc34076_get_pens(device_t *device) { tlc34076_state *state = get_safe_token(device); offs_t i; for (i = 0; i < 0x100; i++) { int r, g, b; if ((i & state->regs[PIXEL_READ_MASK]) == i) { r = state->local_paletteram[3 * i + 0]; g = state->local_paletteram[3 * i + 1]; b = state->local_paletteram[3 * i + 2]; if (state->dacbits == 6) { r = pal6bit(r); g = pal6bit(g); b = pal6bit(b); } } else { r = 0; g = 0; b = 0; } state->pens[i] = MAKE_RGB(r, g, b); } return state->pens; }
/*************************************************************************** Convert the color PROMs into a more useable format. Mat Mania is unusual in that it has both PROMs and RAM to control the palette. PROMs are used for characters and background tiles, RAM for sprites. I don't know for sure how the PROMs are connected to the RGB output, but it's probably the usual: bit 7 -- 220 ohm resistor -- GREEN -- 470 ohm resistor -- GREEN -- 1 kohm resistor -- GREEN -- 2.2kohm resistor -- GREEN -- 220 ohm resistor -- RED -- 470 ohm resistor -- RED -- 1 kohm resistor -- RED bit 0 -- 2.2kohm resistor -- RED bit 3 -- 220 ohm resistor -- BLUE -- 470 ohm resistor -- BLUE -- 1 kohm resistor -- BLUE bit 0 -- 2.2kohm resistor -- BLUE ***************************************************************************/ void matmania_state::palette_init() { const UINT8 *color_prom = memregion("proms")->base(); int i; for (i = 0; i < 64; i++) { int bit0, bit1, bit2, bit3, r, g, b; bit0 = BIT(color_prom[0], 0); bit1 = BIT(color_prom[0], 1); bit2 = BIT(color_prom[0], 2); bit3 = BIT(color_prom[0], 3); r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; bit0 = BIT(color_prom[0], 4); bit1 = BIT(color_prom[0], 5); bit2 = BIT(color_prom[0], 6); bit3 = BIT(color_prom[0], 7); g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; bit0 = BIT(color_prom[64], 0); bit1 = BIT(color_prom[64], 1); bit2 = BIT(color_prom[64], 2); bit3 = BIT(color_prom[64], 3); b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; palette_set_color(machine(),i,MAKE_RGB(r,g,b)); color_prom++; } }
const pen_t *tlc34076_device::get_pens() { offs_t i; for (i = 0; i < 0x100; i++) { int r, g, b; if ((i & m_regs[PIXEL_READ_MASK]) == i) { r = m_local_paletteram[3 * i + 0]; g = m_local_paletteram[3 * i + 1]; b = m_local_paletteram[3 * i + 2]; if (m_dacbits == 6) { r = pal6bit(r); g = pal6bit(g); b = pal6bit(b); } } else { r = 0; g = 0; b = 0; } m_pens[i] = MAKE_RGB(r, g, b); } return m_pens; }
//绘制文字 void TS_DrawText(IDisplay* pIDisplay, AEEFont nFont, AECHAR* pText, AEERect *rect) { RGBVAL oldColor; oldColor = IDISPLAY_SetColor(pIDisplay, CLR_USER_TEXT, MAKE_RGB(255, 255, 255)); IDISPLAY_DrawText(pIDisplay, nFont, pText, -1, rect->x, rect->y, rect, IDF_TEXT_TRANSPARENT); IDISPLAY_SetColor(pIDisplay, CLR_USER_TEXT, oldColor); }
static void create_palette_lookup(running_machine &machine) { williams_state *state = machine.driver_data<williams_state>(); static const int resistances_rg[3] = { 1200, 560, 330 }; static const int resistances_b[2] = { 560, 330 }; double weights_r[3], weights_g[3], weights_b[2]; int i; /* compute palette information */ /* note that there really are pullup/pulldown resistors, but this situation is complicated */ /* by the use of transistors, so we ignore that and just use the relative resistor weights */ compute_resistor_weights(0, 255, -1.0, 3, resistances_rg, weights_r, 0, 0, 3, resistances_rg, weights_g, 0, 0, 2, resistances_b, weights_b, 0, 0); /* build a palette lookup */ state->m_palette_lookup = auto_alloc_array(machine, rgb_t, 256); for (i = 0; i < 256; i++) { int r = combine_3_weights(weights_r, BIT(i,0), BIT(i,1), BIT(i,2)); int g = combine_3_weights(weights_g, BIT(i,3), BIT(i,4), BIT(i,5)); int b = combine_2_weights(weights_b, BIT(i,6), BIT(i,7)); state->m_palette_lookup[i] = MAKE_RGB(r, g, b); } }
void palette_normalize_range(palette_t *palette, UINT32 start, UINT32 end, int lum_min, int lum_max) { UINT32 ymin = 1000 * 255, ymax = 0; UINT32 tmin, tmax; UINT32 index; /* clamp within range */ start = MAX(start, 0); end = MIN(end, palette->numcolors - 1); /* find the minimum and maximum brightness of all the colors in the range */ for (index = start; index <= end; index++) { rgb_t rgb = palette->entry_color[index]; UINT32 y = 299 * RGB_RED(rgb) + 587 * RGB_GREEN(rgb) + 114 * RGB_BLUE(rgb); ymin = MIN(ymin, y); ymax = MAX(ymax, y); } /* determine target minimum/maximum */ tmin = (lum_min < 0) ? ((ymin + 500) / 1000) : lum_min; tmax = (lum_max < 0) ? ((ymax + 500) / 1000) : lum_max; /* now normalize the palette */ for (index = start; index <= end; index++) { rgb_t rgb = palette->entry_color[index]; UINT32 y = 299 * RGB_RED(rgb) + 587 * RGB_GREEN(rgb) + 114 * RGB_BLUE(rgb); UINT32 target = tmin + ((y - ymin) * (tmax - tmin + 1)) / (ymax - ymin); UINT8 r = (y == 0) ? 0 : rgb_clamp(RGB_RED(rgb) * 1000 * target / y); UINT8 g = (y == 0) ? 0 : rgb_clamp(RGB_GREEN(rgb) * 1000 * target / y); UINT8 b = (y == 0) ? 0 : rgb_clamp(RGB_BLUE(rgb) * 1000 * target / y); palette_entry_set_color(palette, index, MAKE_RGB(r, g, b)); } }
/* basically an add/subtract function with clamping */ static rgb_t jal_blend_func(rgb_t dest, rgb_t addMe, UINT8 alpha) { int r = (float)RGB_RED (addMe) ; int g = (float)RGB_GREEN(addMe) ; int b = (float)RGB_BLUE (addMe) ; int rd = (float)RGB_RED (dest) ; int gd = (float)RGB_GREEN(dest) ; int bd = (float)RGB_BLUE (dest) ; int finalR, finalG, finalB ; int subR = (alpha & 0x04) >> 2 ; int subG = (alpha & 0x02) >> 1 ; int subB = (alpha & 0x01) ; if (subR) finalR = rd - r ; else finalR = rd + r ; if (finalR < 0) finalR = 0 ; else if (finalR > 255) finalR = 255 ; if (subG) finalG = gd - g ; else finalG = gd + g ; if (finalG < 0) finalG = 0 ; else if (finalG > 255) finalG = 255 ; if (subB) finalB = bd - b ; else finalB = bd + b ; if (finalB < 0) finalB = 0 ; else if (finalB > 255) finalB = 255 ; return MAKE_RGB((UINT8)finalR,(UINT8)finalG,(UINT8)finalB) ; }
bool consoleDirectionalColor (ParameterList* params, std::string* errorMessage) { gRenderer.setDirectionalLightColor( MAKE_RGB(params->Ints[0], params->Ints[1], params->Ints[2])); return 1; }
static PALETTE_INIT( mogura ) { const UINT8 *color_prom = machine.root_device().memregion("proms")->base(); int i, j; j = 0; for (i = 0; i < 0x20; i++) { int bit0, bit1, bit2, r, g, b; /* red component */ bit0 = BIT(color_prom[i], 0); bit1 = BIT(color_prom[i], 1); bit2 = BIT(color_prom[i], 2); r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; /* green component */ bit0 = BIT(color_prom[i], 3); bit1 = BIT(color_prom[i], 4); bit2 = BIT(color_prom[i], 5); g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; /* blue component */ bit0 = 0; bit1 = BIT(color_prom[i], 6); bit2 = BIT(color_prom[i], 7); b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; palette_set_color(machine, j, MAKE_RGB(r, g, b)); j += 4; if (j > 31) j -= 31; } }
inline void cdp1862_device::initialize_palette() { int i; double res_total = m_chr_r + m_chr_g + m_chr_b + m_chr_bkg; int weight_r = (m_chr_r / res_total) * 100; int weight_g = (m_chr_g / res_total) * 100; int weight_b = (m_chr_b / res_total) * 100; int weight_bkg = (m_chr_bkg / res_total) * 100; for (i = 0; i < 16; i++) { int r, g, b, luma = 0; luma += (i & 4) ? weight_r : 0; luma += (i & 1) ? weight_g : 0; luma += (i & 2) ? weight_b : 0; luma += (i & 8) ? 0 : weight_bkg; luma = (luma * 0xff) / 100; r = (i & 4) ? luma : 0; g = (i & 1) ? luma : 0; b = (i & 2) ? luma : 0; m_palette[i] = MAKE_RGB(r, g, b); } }
PALETTE_INIT_MEMBER(equites_state,splndrbt) { const UINT8 *color_prom = machine().root_device().memregion("proms")->base(); int i; machine().colortable = colortable_alloc(machine(), 256); for (i = 0; i < 0x100; i++) colortable_palette_set_color(machine().colortable, i, MAKE_RGB(pal4bit(color_prom[i]), pal4bit(color_prom[i + 0x100]), pal4bit(color_prom[i + 0x200]))); for (i = 0; i < 0x100; i++) colortable_entry_set_value(machine().colortable, i, i); // point to the bg CLUT color_prom += 0x300; for (i = 0; i < 0x80; i++) colortable_entry_set_value(machine().colortable, i + 0x100, color_prom[i] + 0x10); // point to the sprite CLUT color_prom += 0x100; for (i = 0; i < 0x100; i++) colortable_entry_set_value(machine().colortable, i + 0x180, color_prom[i]); }
PALETTE_INIT_MEMBER(ojankohs_state,ojankoy) { const UINT8 *color_prom = memregion("proms")->base(); int i; int bit0, bit1, bit2, bit3, bit4, r, g, b; for (i = 0; i < machine().total_colors(); i++) { bit0 = BIT(color_prom[0], 2); bit1 = BIT(color_prom[0], 3); bit2 = BIT(color_prom[0], 4); bit3 = BIT(color_prom[0], 5); bit4 = BIT(color_prom[0], 6); r = 0x08 * bit0 + 0x11 * bit1 + 0x21 * bit2 + 0x43 * bit3 + 0x82 * bit4; bit0 = BIT(color_prom[machine().total_colors()], 5); bit1 = BIT(color_prom[machine().total_colors()], 6); bit2 = BIT(color_prom[machine().total_colors()], 7); bit3 = BIT(color_prom[0], 0); bit4 = BIT(color_prom[0], 1); g = 0x08 * bit0 + 0x11 * bit1 + 0x21 * bit2 + 0x43 * bit3 + 0x82 * bit4; bit0 = BIT(color_prom[machine().total_colors()], 0); bit1 = BIT(color_prom[machine().total_colors()], 1); bit2 = BIT(color_prom[machine().total_colors()], 2); bit3 = BIT(color_prom[machine().total_colors()], 3); bit4 = BIT(color_prom[machine().total_colors()], 4); b = 0x08 * bit0 + 0x11 * bit1 + 0x21 * bit2 + 0x43 * bit3 + 0x82 * bit4; palette_set_color(machine(), i, MAKE_RGB(r, g, b)); color_prom++; } }
PALETTE_INIT_MEMBER(clshroad_state,firebatl) { const UINT8 *color_prom = memregion("proms")->base(); int i; /* allocate the colortable */ machine().colortable = colortable_alloc(machine(), 0x100); /* create a lookup table for the palette */ for (i = 0; i < 0x100; i++) { int r = pal4bit(color_prom[i + 0x000]); int g = pal4bit(color_prom[i + 0x100]); int b = pal4bit(color_prom[i + 0x200]); colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b)); } /* color_prom now points to the beginning of the lookup table */ color_prom += 0x300; for (i = 0; i < 0x200; i++) colortable_entry_set_value(machine().colortable, i, i & 0xff); for (i = 0x200; i < 0x300; i++) { UINT8 ctabentry = ((color_prom[(i - 0x200) + 0x000] & 0x0f) << 4) | (color_prom[(i - 0x200) + 0x100] & 0x0f); colortable_entry_set_value(machine().colortable, i, ctabentry); } }
bool consoleAmbient (ParameterList* params, std::string* errorMessage) { gRenderer.setAmbientLightColor( MAKE_RGB(params->Ints[0], params->Ints[1], params->Ints[2])); return 1; }
void megazone_state::palette_init() { const UINT8 *color_prom = machine().root_device().memregion("proms")->base(); static const int resistances_rg[3] = { 1000, 470, 220 }; static const int resistances_b [2] = { 470, 220 }; double rweights[3], gweights[3], bweights[2]; int i; /* compute the color output resistor weights */ compute_resistor_weights(0, 255, -1.0, 3, &resistances_rg[0], rweights, 1000, 0, 3, &resistances_rg[0], gweights, 1000, 0, 2, &resistances_b[0], bweights, 1000, 0); /* allocate the colortable */ machine().colortable = colortable_alloc(machine(), 0x20); /* create a lookup table for the palette */ for (i = 0; i < 0x20; i++) { int bit0, bit1, bit2; int r, g, b; /* red component */ bit0 = BIT(color_prom[i], 0); bit1 = BIT(color_prom[i], 1); bit2 = BIT(color_prom[i], 2); r = combine_3_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); g = combine_3_weights(gweights, bit0, bit1, bit2); /* blue component */ bit0 = BIT(color_prom[i], 6); bit1 = BIT(color_prom[i], 7); b = combine_2_weights(bweights, bit0, bit1); colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b)); } /* color_prom now points to the beginning of the lookup table */ color_prom += 0x20; /* sprites */ for (i = 0; i < 0x100; i++) { UINT8 ctabentry = color_prom[i] & 0x0f; colortable_entry_set_value(machine().colortable, i, ctabentry); } /* characters */ for (i = 0x100; i < 0x200; i++) { UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10; colortable_entry_set_value(machine().colortable, i, ctabentry); } }