Changeset 925fdd7 in mainline
- Timestamp:
- 2008-12-10T21:41:22Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bb74e8ab
- Parents:
- 8af9950
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/genarch/ofw.c
r8af9950 r925fdd7 299 299 unsigned int sc = ofw_get_size_cells(ofw_memory) / 300 300 (sizeof(uintptr_t) / sizeof(uint32_t)); 301 printf("address cells: %d, size cells: %d. ", ac, sc);302 301 303 302 uintptr_t buf[((ac + sc) * MEMMAP_MAX_RECORDS)]; … … 406 405 return false; 407 406 408 /* setup the palette so that the 3:2:3 scheme is usable */407 /* setup the palette so that the (inverted) 3:2:3 scheme is usable */ 409 408 unsigned int i; 410 409 for (i = 0; i < 256; i++) 411 410 if (ofw_call("call-method", 6, 1, NULL, "color!", screen, 412 i,411 255 - i, 413 412 i << 5, 414 413 (i >> 3) << 6, -
kernel/genarch/src/fb/fb.c
r8af9950 r925fdd7 178 178 } 179 179 180 /** Put pixel - 8-bit depth (color palette/3:2:3 )180 /** Put pixel - 8-bit depth (color palette/3:2:3, inverted) 181 181 * 182 182 * Even though we try 3:2:3 color scheme here, an 8-bit framebuffer … … 185 185 * palette. This could be fixed by supporting custom palette 186 186 * and setting it to simulate the 8-bit truecolor. 187 * 188 * Currently we set the palette on the sparc64 port. 189 * 190 * Note that the byte is being inverted by this function. The reason is 191 * that we would like to use a color palette where the white color code 192 * is 0 and the black color code is 255, as some machines (SunBlade 1500) 193 * use these codes for black and white and prevent to set codes 194 * 0 and 255 to other colors. 187 195 */ 188 196 static void rgb_byte8(void *dst, int rgb) 189 197 { 190 *((uint8_t *) dst) = RED(rgb, 3) << 5 | GREEN(rgb, 2) << 3 |191 BLUE(rgb, 3) ;198 *((uint8_t *) dst) = 255 - (RED(rgb, 3) << 5 | GREEN(rgb, 2) << 3 | 199 BLUE(rgb, 3)); 192 200 } 193 201 … … 198 206 static int byte8_rgb(void *src) 199 207 { 200 int color = *(uint8_t *)src;208 int color = 255 - (*(uint8_t *)src); 201 209 return (((color >> 5) & 0x7) << (16 + 5)) | 202 210 (((color >> 3) & 0x3) << (8 + 6)) | ((color & 0x7) << 5); … … 484 492 485 493 /* Map the framebuffer */ 486 fbaddress = (uint8_t *) hw_map((uintptr_t) props->addr + props->offset,487 fbsize );494 fbaddress = (uint8_t *) hw_map((uintptr_t) props->addr, 495 fbsize + props->offset); 488 496 fbaddress += props->offset; 489 497 … … 495 503 columns = props->x / COL_WIDTH; 496 504 497 fb_parea.pbase = (uintptr_t) props->addr ;505 fb_parea.pbase = (uintptr_t) props->addr + props->offset; 498 506 fb_parea.vbase = (uintptr_t) fbaddress; 499 507 fb_parea.frames = SIZE2FRAMES(fbsize); -
uspace/srv/fb/fb.c
r8af9950 r925fdd7 243 243 rgb_byte8(void *dst, int rgb) 244 244 { 245 *(uint8_t *)dst = RED(rgb, 3) << 5 | GREEN(rgb, 2) << 3 | BLUE(rgb, 3); 245 *(uint8_t *)dst = 255 - (RED(rgb, 3) << 5 | GREEN(rgb, 2) << 3 | 246 BLUE(rgb, 3)); 246 247 } 247 248 … … 250 251 byte8_rgb(void *src) 251 252 { 252 int color = *(uint8_t *)src;253 int color = 255 - (*(uint8_t *)src); 253 254 return (((color >> 5) & 0x7) << (16 + 5)) | 254 255 (((color >> 3) & 0x3) << (8 + 6)) | ((color & 0x7) << 5); … … 566 567 } 567 568 568 screen.fbaddress = (unsigned char *) (((uintptr_t) addr) + offset);569 screen.fbaddress = (unsigned char *) (((uintptr_t) addr)); 569 570 screen.xres = xres; 570 571 screen.yres = yres;
Note:
See TracChangeset
for help on using the changeset viewer.