for(int x = 0; x < 240; x++) { u32 color = *line; int r = (color & 0x1F); int g = ((color >> 5) & 0x1F); int b = ((color >> 10) & 0x1F);  r = r - ((r * coeff) >> 4); g = g - ((g * coeff) >> 4); b = b - ((b * coeff) >> 4); if(r < 0) r = 0; if(g < 0) g = 0; if(b < 0) b = 0; *line++ = (color & 0xFFFF0000) | (b << 10) | (g << 5) | r; }
int r = (color & 0x1F); int g = ((color >> 5) & 0x1F); int b = ((color >> 10) & 0x1F);  r = r - ((r * coeff) >> 4); g = g - ((g * coeff) >> 4); b = b - ((b * coeff) >> 4); if(r < 0) r = 0; if(g < 0) g = 0; if(b < 0) b = 0; color = (color & 0xFFFF0000) | (b << 10) | (g << 5) | r;  return color;
inline void gfxDecreaseBrightness(u32 *line, int coeff){  for(int x = 0; x < 240; x++) {    u32 color = *line;    int r = (color & 0x1F);    int g = ((color >> 5) & 0x1F);    int b = ((color >> 10) & 0x1F);        r = r - ((r * coeff) >> 4);    g = g - ((g * coeff) >> 4);    b = b - ((b * coeff) >> 4);    if(r < 0)      r = 0;    if(g < 0)      g = 0;    if(b < 0)      b = 0;    *line++ = (color & 0xFFFF0000) | (b << 10) | (g << 5) | r;  }}