Index: uspace/fb/fb.c
===================================================================
--- uspace/fb/fb.c	(revision d7e3f1ade9ff58d20053f91aafb424534a868c2e)
+++ uspace/fb/fb.c	(revision 27ab6a7c0ae5ecb4768a58e568c321a2c017a35b)
@@ -71,10 +71,11 @@
 
 struct {
-	uint8_t *fbaddress ;
-
-	unsigned int xres ;
-	unsigned int yres ;
-	unsigned int scanline ;
-	unsigned int pixelbytes ;
+	uint8_t *fbaddress;
+
+	unsigned int xres;
+	unsigned int yres;
+	unsigned int scanline;
+	unsigned int pixelbytes;
+	unsigned int invert_colors;
 
 	conv2scr_fn_t rgb2scr;
@@ -141,4 +142,9 @@
 #define POINTPOS(x, y)	((y) * screen.scanline + (x) * screen.pixelbytes)
 
+static inline int COLOR(int color)
+{
+	return screen.invert_colors ? ~color : color;
+}
+
 /* Conversion routines between different color representations */
 static void rgb_4byte(void *dst, int rgb)
@@ -164,6 +170,4 @@
 	scr[0] = BLUE(rgb, 8);
 #endif
-
-
 }
 
@@ -218,10 +222,10 @@
 
 	if (! (vport->paused && vport->dbdata))
-		(*screen.rgb2scr)(&screen.fbaddress[POINTPOS(dx,dy)],color);
+		(*screen.rgb2scr)(&screen.fbaddress[POINTPOS(dx,dy)], COLOR(color));
 
 	if (vport->dbdata) {
 		int dline = (y + vport->dboffset) % vport->height;
 		int doffset = screen.pixelbytes * (dline * vport->width + x);
-		(*screen.rgb2scr)(&vport->dbdata[doffset],color);
+		(*screen.rgb2scr)(&vport->dbdata[doffset], COLOR(color));
 	}
 }
@@ -233,5 +237,5 @@
 	int dy = vport->y + y;
 
-	return (*screen.scr2rgb)(&screen.fbaddress[POINTPOS(dx,dy)]);
+	return COLOR((*screen.scr2rgb)(&screen.fbaddress[POINTPOS(dx,dy)]));
 }
 
@@ -239,5 +243,5 @@
 				int color)
 {
-	(*screen.rgb2scr)(&mem[POINTPOS(x,y)],color);
+	(*screen.rgb2scr)(&mem[POINTPOS(x,y)], COLOR(color));
 }
 
@@ -455,8 +459,10 @@
  * @param scan Bytes per one scanline
  * @param align Alignment for 24bpp mode.
+ * @param invert_colors Inverted colors.
  *
  */
 static void
-screen_init(void *addr, unsigned int xres, unsigned int yres, unsigned int bpp, unsigned int scan, int align)
+screen_init(void *addr, unsigned int xres, unsigned int yres, unsigned int bpp, unsigned int scan,
+	int align, int invert_colors)
 {
 	switch (bpp) {
@@ -491,4 +497,5 @@
 	screen.yres = yres;
 	screen.scanline = scan;
+	screen.invert_colors = invert_colors;
 	
 	/* Create first viewport */
@@ -594,5 +601,5 @@
 	int pos = (y * pmap->width + x) * screen.pixelbytes;
 
-	(*screen.rgb2scr)(&pmap->data[pos],color);
+	(*screen.rgb2scr)(&pmap->data[pos],COLOR(color));
 }
 
@@ -1224,4 +1231,5 @@
 	unsigned int fb_bpp_align;
 	unsigned int fb_scanline;
+	unsigned int fb_invert_colors;
 	void *fb_addr;
 	size_t asz;
@@ -1235,4 +1243,5 @@
 	fb_bpp_align=sysinfo_value("fb.bpp-align");
 	fb_scanline=sysinfo_value("fb.scanline");
+	fb_invert_colors=sysinfo_value("fb.invert-colors");
 
 	asz = fb_scanline*fb_height;
@@ -1242,5 +1251,5 @@
 		    AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
 	
-	screen_init(fb_addr, fb_width, fb_height, fb_bpp, fb_scanline, fb_bpp_align);
+	screen_init(fb_addr, fb_width, fb_height, fb_bpp, fb_scanline, fb_bpp_align, fb_invert_colors);
 
 	return 0;
