Changeset 253f35a1 in mainline for kernel/genarch/src/fb/fb.c
- Timestamp:
- 2006-09-07T19:56:44Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ab1ae2d9
- Parents:
- 801579fe
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/fb/fb.c
r801579fe r253f35a1 61 61 static unsigned int bitspp = 0; 62 62 static unsigned int pixelbytes = 0; 63 #ifdef FB_INVERT_COLORS 64 static bool invert_colors = true; 65 #else 66 static bool invert_colors = false; 67 #endif 63 68 64 69 static unsigned int position = 0; … … 66 71 static unsigned int rows = 0; 67 72 68 69 73 #define COL_WIDTH 8 70 74 #define ROW_BYTES (scanline * FONT_SCANLINES) … … 85 89 static void (*rgb2scr)(void *, int); 86 90 static int (*scr2rgb)(void *); 91 92 static inline int COLOR(int color) 93 { 94 return invert_colors ? ~color : color; 95 } 87 96 88 97 /* Conversion routines between different color representations */ … … 160 169 static void putpixel(unsigned int x, unsigned int y, int color) 161 170 { 162 (*rgb2scr)(&fbaddress[POINTPOS(x,y)], color);171 (*rgb2scr)(&fbaddress[POINTPOS(x,y)], COLOR(color)); 163 172 164 173 if (dbbuffer) { 165 174 int dline = (y + dboffset) % yres; 166 (*rgb2scr)(&dbbuffer[POINTPOS(x,dline)], color);175 (*rgb2scr)(&dbbuffer[POINTPOS(x,dline)], COLOR(color)); 167 176 } 168 177 } … … 173 182 if (dbbuffer) { 174 183 int dline = (y + dboffset) % yres; 175 return (*scr2rgb)(&dbbuffer[POINTPOS(x,dline)]);176 } 177 return (*scr2rgb)(&fbaddress[POINTPOS(x,y)]);184 return COLOR((*scr2rgb)(&dbbuffer[POINTPOS(x,dline)])); 185 } 186 return COLOR((*scr2rgb)(&fbaddress[POINTPOS(x,y)])); 178 187 } 179 188 … … 275 284 byte >>= x % 8; 276 285 if (byte & 1) 277 putpixel(startx + x, starty + y, LOGOCOLOR);286 putpixel(startx + x, starty + y, COLOR(LOGOCOLOR)); 278 287 } 279 288 } … … 398 407 sysinfo_set_item_val("fb.scanline", NULL, scan); 399 408 sysinfo_set_item_val("fb.address.physical", NULL, addr); 409 sysinfo_set_item_val("fb.invert-colors", NULL, invert_colors); 400 410 401 411 /* Allocate double buffer */ … … 417 427 if (!blankline) 418 428 panic("Failed to allocate blank line for framebuffer."); 419 for (y=0; y < FONT_SCANLINES; y++) 420 for (x=0; x < xres; x++) 421 (*rgb2scr)(&blankline[POINTPOS(x,y)],BGCOLOR); 429 for (y=0; y < FONT_SCANLINES; y++) { 430 for (x=0; x < xres; x++) { 431 (*rgb2scr)(&blankline[POINTPOS(x,y)], COLOR(BGCOLOR)); 432 } 433 } 422 434 423 435 clear_screen();
Note:
See TracChangeset
for help on using the changeset viewer.