int picasso_palette (void) { int i, changed; changed = 0; for (i = 0; i < 256; i++) { int r = picasso96_state.CLUT[i].Red; int g = picasso96_state.CLUT[i].Green; int b = picasso96_state.CLUT[i].Blue; uae_u32 v = (doMask256 (r, g_red_bits, g_red_shift) | doMask256 (g, g_green_bits, g_green_shift) | doMask256 (b, g_blue_bits, g_blue_shift)) | doMask256 (0xff, g_alpha_bits, g_alpha_shift); if (v != picasso_vidinfo.clut[i]) { //write_log (_T("%d:%08x\n"), i, v); picasso_vidinfo.clut[i] = v; changed = 1; } } return changed; }
static void DX_SetPalette_real (int start, int count) { if (! screen_is_picasso || picasso96_state.RGBFormat != RGBFB_CHUNKY) return; if (picasso_vidinfo.pixbytes != 1) { /* This is the case when we're emulating a 256 color display. */ while (count-- > 0) { int r = picasso96_state.CLUT[start].Red; int g = picasso96_state.CLUT[start].Green; int b = picasso96_state.CLUT[start].Blue; picasso_vidinfo.clut[start++] = (doMask256 (r, red_bits, red_shift) | doMask256 (g, green_bits, green_shift) | doMask256 (b, blue_bits, blue_shift)); } return; } while (count-- > 0) { XColor col = parsed_xcolors[start]; col.red = picasso96_state.CLUT[start].Red * 0x0101; col.green = picasso96_state.CLUT[start].Green * 0x0101; col.blue = picasso96_state.CLUT[start].Blue * 0x0101; XStoreColor (display, cmap, &col); XStoreColor (display, cmap2, &col); start++; } #ifdef USE_DGA_EXTENSION if (dgamode) { dga_colormap_installed ^= 1; if (dga_colormap_installed == 1) XF86DGAInstallColormap (display, screen, cmap2); else XF86DGAInstallColormap (display, screen, cmap); } #endif }
void DX_SetPalette(int start, int count) { if (!screen_is_picasso || picasso96_state.RGBFormat != RGBFB_CHUNKY) return; if (picasso_vidinfo.pixbytes != 1) { /* This is the case when we're emulating a 256 color display. */ while (count-- > 0) { int r = picasso96_state.CLUT[start].Red; int g = picasso96_state.CLUT[start].Green; int b = picasso96_state.CLUT[start].Blue; picasso_vidinfo.clut[start++] = (doMask256 (r, 4, 12) | doMask256 (g, 4, 8) | doMask256 (b, 4, 0)); /* picasso_vidinfo.clut[start++] = (doMask256 (r, red_bits, red_shift) */ /* | doMask256 (g, green_bits, green_shift) */ /* | doMask256 (b, blue_bits, blue_shift)); */ } } else { // TODO: Add chunky emulation pixel shaders in libglgfx to handle this abort(); } }