Changeset 925fdd7 in mainline for uspace/srv/fb/fb.c


Ignore:
Timestamp:
2008-12-10T21:41:22Z (16 years ago)
Author:
Pavel Rimsky <rimskyp@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bb74e8ab
Parents:
8af9950
Message:

Fixed the bug when on SunBlade1500 we wrote to an address outside the framebuffer memory. A nasty hack to the 8-bit palette so that on sb1500 we do not have to turn black into white and white into black.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fb/fb.c

    r8af9950 r925fdd7  
    243243rgb_byte8(void *dst, int rgb)
    244244{
    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));
    246247}
    247248
     
    250251byte8_rgb(void *src)
    251252{
    252         int color = *(uint8_t *)src;
     253        int color = 255 - (*(uint8_t *)src);
    253254        return (((color >> 5) & 0x7) << (16 + 5)) |
    254255            (((color >> 3) & 0x3) << (8 + 6)) | ((color & 0x7) << 5);
     
    566567        }
    567568
    568         screen.fbaddress = (unsigned char *) (((uintptr_t) addr) + offset);
     569        screen.fbaddress = (unsigned char *) (((uintptr_t) addr));
    569570        screen.xres = xres;
    570571        screen.yres = yres;
Note: See TracChangeset for help on using the changeset viewer.