defpal[i+16].rgbtRed = r * 0x33; defpal[i+16].rgbtGreen = g * 0x33; defpal[i+16].rgbtBlue = b * 0x33;
defpal[i+16].rgbtRed = r ? r * 40 + 55 : 0; defpal[i+16].rgbtGreen = g ? g * 40 + 55 : 0; defpal[i+16].rgbtBlue = b ? b * 40 + 55 : 0;
static void cfgtopalette(void){    int i;    static const int ww[] = {	256, 257, 258, 259, 260, 261,	0, 8, 1, 9, 2, 10, 3, 11,	4, 12, 5, 13, 6, 14, 7, 15    };    for (i = 0; i < 22; i++) {	int w = ww[i];	defpal[w].rgbtRed = cfg.colours[i][0];	defpal[w].rgbtGreen = cfg.colours[i][1];	defpal[w].rgbtBlue = cfg.colours[i][2];    }    for (i = 0; i < NEXTCOLOURS; i++) {	if (i < 216) {	    int r = i / 36, g = (i / 6) % 6, b = i % 6;	    defpal[i+16].rgbtRed = r * 0x33;	    defpal[i+16].rgbtGreen = g * 0x33;	    defpal[i+16].rgbtBlue = b * 0x33;	} else {	    int shade = i - 216;	    shade = (shade + 1) * 0xFF / (NEXTCOLOURS - 216 + 1);	    defpal[i+16].rgbtRed = defpal[i+16].rgbtGreen =		defpal[i+16].rgbtBlue = shade;	}    }    /* Override with system colours if appropriate */    if (cfg.system_colour)        systopalette();}