++#define CNVT_TOHW(val,width) ((((val)<<(width))+0x7FFF-(val))>>16)
++ red = CNVT_TOHW(red, fb->var.red.length);
++ green = CNVT_TOHW(green, fb->var.green.length);
++ blue = CNVT_TOHW(blue, fb->var.blue.length);
++ transp = CNVT_TOHW(transp, fb->var.transp.length);
++#undef CNVT_TOHW
++
++ color = (red << fb->var.red.offset) |
++ (green << fb->var.green.offset) |
++ (blue << fb->var.blue.offset) |
++ (transp << fb->var.transp.offset);
++
++ ((uint32_t*)(fb->pseudo_palette))[regno] = color;