--- src/coloredit.c 1995-06-20 11:46:59.000000000 -0400 +++ src/coloredit.c 2026-04-30 02:19:50.000000000 -0400 @@ -2736,7 +2736,9 @@ cols[n].blue = dacbox[n][2] * 256; cols[n].green = dacbox[n][1] * 256; - XStoreColor(display, colormap, &cols[n]); + if (colormap) + XStoreColor(display, colormap, &cols[n]); + else pixtab[n] = (dacbox[n][0] << 16) | (dacbox[n][1] << 8) | dacbox[n][2]; paledit.palette_colorbox_rect[n].intred = (int)cols[n].red / 256; paledit.palette_colorbox_rect[n].intblue = (int)cols[n].blue / 256; @@ -2781,7 +2783,9 @@ cols[n].blue = dacbox[n][2] * 256; cols[n].green = dacbox[n][1] * 256; - XStoreColor(display, colormap, &cols[n]); + if (colormap) + XStoreColor(display, colormap, &cols[n]); + else pixtab[n] = (dacbox[n][0] << 16) | (dacbox[n][1] << 8) | dacbox[n][2]; paledit.palette_colorbox_rect[n].intred = (int)cols[n].red / 256; @@ -2835,7 +2839,9 @@ cols[n].blue = dacbox[n][2] * 256; cols[n].green = dacbox[n][1] * 256; - XStoreColor(display, colormap, &cols[n]); + if (colormap) + XStoreColor(display, colormap, &cols[n]); + else pixtab[n] = (dacbox[n][0] << 16) | (dacbox[n][1] << 8) | dacbox[n][2]; paledit.palette_colorbox_rect[n].intred = (int)cols[n].red / 256; @@ -2944,8 +2950,15 @@ cols[paledit.active_color_register_color].green = dacbox[paledit.active_color_register_color][1] * 256; - XStoreColor(display, colormap, - &cols[paledit.active_color_register_color]); + if (colormap) { + XStoreColor(display, colormap, + &cols[paledit.active_color_register_color]); + } else { + pixtab[paledit.active_color_register_color] = + (dacbox[paledit.active_color_register_color][0] << 16) | + (dacbox[paledit.active_color_register_color][1] << 8) | + dacbox[paledit.active_color_register_color][2]; + } change_xor_gc(0); @@ -2992,8 +3005,15 @@ cols[paledit.active_color_register_color].green = dacbox[paledit.active_color_register_color][1] * 256; - XStoreColor(display, colormap, - &cols[paledit.active_color_register_color]); + if (colormap) { + XStoreColor(display, colormap, + &cols[paledit.active_color_register_color]); + } else { + pixtab[paledit.active_color_register_color] = + (dacbox[paledit.active_color_register_color][0] << 16) | + (dacbox[paledit.active_color_register_color][1] << 8) | + dacbox[paledit.active_color_register_color][2]; + } change_xor_gc(0); @@ -3212,8 +3232,15 @@ cols[paledit.active_color_register_color].green = dacbox[paledit.active_color_register_color][1] * 256; - XStoreColor(display, colormap, - &cols[paledit.active_color_register_color]); + if (colormap) { + XStoreColor(display, colormap, + &cols[paledit.active_color_register_color]); + } else { + pixtab[paledit.active_color_register_color] = + (dacbox[paledit.active_color_register_color][0] << 16) | + (dacbox[paledit.active_color_register_color][1] << 8) | + dacbox[paledit.active_color_register_color][2]; + } i = paledit.active_color_register_color; @@ -3329,7 +3356,9 @@ cols[i].blue = dacbox[i][2] * 256; cols[i].green = dacbox[i][1] * 256; - XStoreColor(display, colormap, &cols[i]); + if (colormap) + XStoreColor(display, colormap, &cols[i]); + else pixtab[i] = (dacbox[i][0] << 16) | (dacbox[i][1] << 8) | dacbox[i][2]; paledit.palette_colorbox_rect[i].red = dacbox[i][0]; paledit.palette_colorbox_rect[i].blue = dacbox[i][2]; @@ -3402,7 +3431,9 @@ cols[i].blue = dacbox[i][2] * 256; cols[i].green = dacbox[i][1] * 256; - XStoreColor(display, colormap, &cols[i]); + if (colormap) + XStoreColor(display, colormap, &cols[i]); + else pixtab[i] = (dacbox[i][0] << 16) | (dacbox[i][1] << 8) | dacbox[i][2]; paledit.palette_colorbox_rect[i].red = dacbox[i][0]; paledit.palette_colorbox_rect[i].blue = dacbox[i][2]; @@ -3519,7 +3550,9 @@ cols[i].blue = dacbox[i][2] * 256; cols[i].green = dacbox[i][1] * 256; - XStoreColor(display, colormap, &cols[i]); + if (colormap) + XStoreColor(display, colormap, &cols[i]); + else pixtab[i] = (dacbox[i][0] << 16) | (dacbox[i][1] << 8) | dacbox[i][2]; paledit.palette_colorbox_rect[i].red = dacbox[i][0]; paledit.palette_colorbox_rect[i].blue = dacbox[i][2]; @@ -3572,7 +3605,9 @@ cols[i].blue = dacbox[i][2] * 256; cols[i].green = dacbox[i][1] * 256; - XStoreColor(display, colormap, &cols[i]); + if (colormap) + XStoreColor(display, colormap, &cols[i]); + else pixtab[i] = (dacbox[i][0] << 16) | (dacbox[i][1] << 8) | dacbox[i][2]; paledit.palette_colorbox_rect[i].red = dacbox[i][0]; paledit.palette_colorbox_rect[i].blue = dacbox[i][2]; @@ -3607,7 +3642,9 @@ cols[i].blue = dacbox[i][2] * 256; cols[i].green = dacbox[i][1] * 256; - XStoreColor(display, colormap, &cols[i]); + if (colormap) + XStoreColor(display, colormap, &cols[i]); + else pixtab[i] = (dacbox[i][0] << 16) | (dacbox[i][1] << 8) | dacbox[i][2]; paledit.palette_colorbox_rect[i].red = dacbox[i][0]; paledit.palette_colorbox_rect[i].blue = dacbox[i][2]; @@ -3685,7 +3722,9 @@ cols[oldcolor].blue = dacbox[oldcolor][2] * 256; cols[oldcolor].green = dacbox[oldcolor][1] * 256; - XStoreColor(display, colormap, &cols[oldcolor]); + if (colormap) + XStoreColor(display, colormap, &cols[oldcolor]); + else pixtab[oldcolor] = (dacbox[oldcolor][0] << 16) | (dacbox[oldcolor][1] << 8) | dacbox[oldcolor][2]; change_xor_gc(0); update_undo_index(); @@ -3751,7 +3790,9 @@ cols[oldcolor].blue = dacbox[oldcolor][2] * 256; cols[oldcolor].green = dacbox[oldcolor][1] * 256; - XStoreColor(display, colormap, &cols[oldcolor]); + if (colormap) + XStoreColor(display, colormap, &cols[oldcolor]); + else pixtab[oldcolor] = (dacbox[oldcolor][0] << 16) | (dacbox[oldcolor][1] << 8) | dacbox[oldcolor][2]; change_xor_gc(0); update_undo_index(); @@ -3871,7 +3912,9 @@ cols[n].blue = dacbox[n][2] * 256; cols[n].green = dacbox[n][1] * 256; - XStoreColor(display, colormap, &cols[n]); + if (colormap) + XStoreColor(display, colormap, &cols[n]); + else pixtab[n] = (dacbox[n][0] << 16) | (dacbox[n][1] << 8) | dacbox[n][2]; paledit.palette_colorbox_rect[n].intred = (int)cols[n].red / 256; paledit.palette_colorbox_rect[n].intblue = (int)cols[n].blue / 256; @@ -3948,7 +3991,9 @@ cols[n].blue = dacbox[n][2] * 256; cols[n].green = dacbox[n][1] * 256; - XStoreColor(display, colormap, &cols[n]); + if (colormap) + XStoreColor(display, colormap, &cols[n]); + else pixtab[n] = (dacbox[n][0] << 16) | (dacbox[n][1] << 8) | dacbox[n][2]; paledit.palette_colorbox_rect[n].intred = (int)cols[n].red / 256; paledit.palette_colorbox_rect[n].intblue = (int)cols[n].blue / 256; @@ -4460,7 +4505,9 @@ cols[i].blue = dacbox[i][2] * 256; cols[i].green = dacbox[i][1] * 256; - XStoreColor(display, colormap, &cols[i]); + if (colormap) + XStoreColor(display, colormap, &cols[i]); + else pixtab[i] = (dacbox[i][0] << 16) | (dacbox[i][1] << 8) | dacbox[i][2]; paledit.palette_colorbox_rect[i].red = dacbox[i][0]; paledit.palette_colorbox_rect[i].blue = dacbox[i][2]; @@ -4565,7 +4612,9 @@ cols[i].blue = dacbox[i][2] * 256; cols[i].green = dacbox[i][1] * 256; - XStoreColor(display, colormap, &cols[i]); + if (colormap) + XStoreColor(display, colormap, &cols[i]); + else pixtab[i] = (dacbox[i][0] << 16) | (dacbox[i][1] << 8) | dacbox[i][2]; paledit.palette_colorbox_rect[i].red = dacbox[i][0]; paledit.palette_colorbox_rect[i].blue = dacbox[i][2]; @@ -5775,7 +5824,13 @@ cols[freestyle.color].blue = dacbox[freestyle.color][2] * 256; cols[freestyle.color].green = dacbox[freestyle.color][1] * 256; - XStoreColor(display, colormap, &cols[freestyle.color]); + if (colormap) + XStoreColor(display, colormap, &cols[freestyle.color]); + else { + pixtab[freestyle.color] = (dacbox[freestyle.color][0] << 16) | + (dacbox[freestyle.color][1] << 8) | + dacbox[freestyle.color][2]; + } paledit.palette_colorbox_rect[freestyle.color].red = dacbox[freestyle.color][0]; @@ -6138,7 +6193,10 @@ cols[n].red = dacbox[n][0] * 256; cols[n].blue = dacbox[n][2] * 256; cols[n].green = dacbox[n][1] * 256; - XStoreColor(display, colormap, &cols[n]); + if (colormap) + XStoreColor(display, colormap, &cols[n]); + else pixtab[n] = (dacbox[n][0] << 16) | (dacbox[n][1] << 8) | dacbox[n][2]; + paledit.palette_colorbox_rect[n].intred = (int)cols[n].red / 256; paledit.palette_colorbox_rect[n].intblue = --- src/file_menu.c 1995-06-20 11:47:00.000000000 -0400 +++ src/file_menu.c 2026-04-30 02:10:14.000000000 -0400 @@ -884,7 +884,7 @@ { XSetWindowAttributes winattrs; int backing_store; - char msg[128]; + char msg[256]; int ret; if(editpal_cursor != 0) --- src/globals.c 2026-04-30 02:09:18.000000000 -0400 +++ src/globals.c 2026-04-30 02:10:14.000000000 -0400 @@ -477,6 +477,7 @@ int slides; int soundflag; int started_resaves; +int staticcolormap; int sxdots; int sxoffs; int sydots; --- src/globals.h 2026-04-30 02:09:18.000000000 -0400 +++ src/globals.h 2026-04-30 02:10:14.000000000 -0400 @@ -480,6 +480,7 @@ extern int slides; extern int soundflag; extern int started_resaves; +extern int staticcolormap; extern int sxdots; extern int sxoffs; extern int sydots; --- src/init_data.c 1995-06-20 11:47:04.000000000 -0400 +++ src/init_data.c 2026-04-30 02:10:14.000000000 -0400 @@ -312,12 +312,14 @@ videotable[1].ydots = 0; videotable[1].colors = 0; + colormap = None; switch(visual->class) { case DirectColor: case PseudoColor: case GrayScale: gotrealdac=1; + staticcolormap=0; break; case TrueColor: @@ -325,6 +327,7 @@ case StaticGray: default: gotrealdac=0; + staticcolormap=1; break; } --- src/resize_window.c 1995-06-20 11:47:09.000000000 -0400 +++ src/resize_window.c 2026-04-30 02:10:14.000000000 -0400 @@ -63,7 +63,7 @@ image = XCreateImage(display, visual, XDefaultDepth(display, screen_number), - ZPixmap, 0, NULL, sxdots, sydots, 8, xdots); + ZPixmap, 0, NULL, sxdots, sydots, 32, xdots << 2); if (image == NULL) { --- src/rotate.c 1995-06-20 11:47:09.000000000 -0400 +++ src/rotate.c 2026-04-30 02:10:14.000000000 -0400 @@ -538,7 +538,8 @@ cols[n].blue = dacbox[n][2] * 256; cols[n].green = dacbox[n][1] * 256; - XStoreColor(display, colormap, &cols[n]); + if (colormap) + XStoreColor(display, colormap, &cols[n]); } spindac(0, 0); } --- src/util.c 1995-06-20 11:47:13.000000000 -0400 +++ src/util.c 2026-04-30 02:10:14.000000000 -0400 @@ -1431,7 +1431,7 @@ image = XCreateImage(display, visual, XDefaultDepth(display, screen_number), - ZPixmap, 0, NULL, sxdots, sydots, 8, xdots); + ZPixmap, 0, NULL, sxdots, sydots, 32, xdots << 2); if (image == NULL) { --- src/video.c 1995-06-20 11:47:13.000000000 -0400 +++ src/video.c 2026-04-30 02:38:27.000000000 -0400 @@ -164,7 +164,17 @@ int readvideo(int x, int y) { - return ipixtab[XGetPixel(image, x, y)]; + unsigned int i = 0; + Pixel p = XGetPixel(image, x, y); + + if (colormap) + return ipixtab[p & 0xff]; + + for (i = 0; i < 256; i++) { + if (p == pixtab[i]) + return ipixtab[i]; + } + return 0; } void @@ -224,6 +234,18 @@ { int i; + if (usepixtab && !colormap) { + for (i = 0; i < 256; i++) { + cols[i].pixel = pixtab[i] = (dacbox[i][0] << 16) | + (dacbox[i][1] << 8) | + dacbox[i][2]; + cols[i].red = dacbox[i][0] * 256; + cols[i].green = dacbox[i][1] * 256; + cols[i].blue = dacbox[i][2] * 256; + } + return 0; + } + if (!gotrealdac) return -1; @@ -236,9 +258,10 @@ cols[i].blue = dacbox[i][2] * 256; } - XStoreColors(display, colormap, cols, colors); - - XFlush(display); + if (colormap) { + XStoreColors(display, colormap, cols, colors); + XFlush(display); + } return 0; } @@ -277,7 +300,10 @@ ipixtab[i] = 999; } - if (!gotrealdac) + if (staticcolormap) { + gotrealdac = 0; + usepixtab = 1; + } else if (!gotrealdac) { colors = 2; } @@ -285,6 +311,7 @@ { colors = 256; gotrealdac = 0; + sharecolor = 1; } else if (privatecolor) {