Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4687 → Rev 4688

/branches/dd/kernel/genarch/include/fb/visuals.h
37,8 → 37,10
 
typedef enum {
VISUAL_INDIRECT_8,
VISUAL_BGR_5_5_5,
VISUAL_BGR_5_6_5,
VISUAL_RGB_5_5_5_LE,
VISUAL_RGB_5_5_5_BE,
VISUAL_RGB_5_6_5_LE,
VISUAL_RGB_5_6_5_BE,
VISUAL_BGR_8_8_8,
VISUAL_BGR_0_8_8_8,
VISUAL_BGR_8_8_8_0,
/branches/dd/kernel/genarch/src/fb/fb.c
145,21 → 145,31
((uint8_t *) dst)[2] = RED(rgb, 8);
}
 
static void bgr_555(void *dst, uint32_t rgb)
static void rgb_555_be(void *dst, uint32_t rgb)
{
uint8_t hi = (BLUE(rgb, 5) | (GREEN(rgb, 5) << 5)) & 0xff;
uint8_t lo = (GREEN(rgb, 5) >> 3) | (RED(rgb, 5) << 2);
*((uint16_t *) dst) = host2uint16_t_be((hi << 8) | lo);
*((uint16_t *) dst) = host2uint16_t_be(RED(rgb, 5) << 10 |
GREEN(rgb, 5) << 5 | BLUE(rgb, 5));
}
 
static void bgr_565(void *dst, uint32_t rgb)
static void rgb_555_le(void *dst, uint32_t rgb)
{
uint8_t hi = (BLUE(rgb, 5) | (GREEN(rgb, 6) << 5)) & 0xff;
uint8_t lo = (GREEN(rgb, 6) >> 3) | (RED(rgb, 5) << 3);
*((uint16_t *) dst) = host2uint16_t_be((hi << 8) | lo);
*((uint16_t *) dst) = host2uint16_t_le(RED(rgb, 5) << 10 |
GREEN(rgb, 5) << 5 | BLUE(rgb, 5));
}
 
static void rgb_565_be(void *dst, uint32_t rgb)
{
*((uint16_t *) dst) = host2uint16_t_be(RED(rgb, 5) << 11 |
GREEN(rgb, 6) << 5 | BLUE(rgb, 5));
}
 
static void rgb_565_le(void *dst, uint32_t rgb)
{
*((uint16_t *) dst) = host2uint16_t_le(RED(rgb, 5) << 11 |
GREEN(rgb, 6) << 5 | BLUE(rgb, 5));
}
 
 
/** BGR 3:2:3
*
* Even though we try 3:2:3 color scheme here, an 8-bit framebuffer
454,14 → 464,22
rgb_conv = bgr_323;
pixelbytes = 1;
break;
case VISUAL_BGR_5_5_5:
rgb_conv = bgr_555;
case VISUAL_RGB_5_5_5_LE:
rgb_conv = rgb_555_le;
pixelbytes = 2;
break;
case VISUAL_BGR_5_6_5:
rgb_conv = bgr_565;
case VISUAL_RGB_5_5_5_BE:
rgb_conv = rgb_555_be;
pixelbytes = 2;
break;
case VISUAL_RGB_5_6_5_LE:
rgb_conv = rgb_565_le;
pixelbytes = 2;
break;
case VISUAL_RGB_5_6_5_BE:
rgb_conv = rgb_565_be;
pixelbytes = 2;
break;
case VISUAL_RGB_8_8_8:
rgb_conv = rgb_888;
pixelbytes = 3;
/branches/dd/kernel/generic/include/string.h
88,7 → 88,7
extern void str_ncpy(char *dest, size_t size, const char *src, size_t n);
extern void wstr_nstr(char *dst, const wchar_t *src, size_t size);
 
extern const char *str_chr(const char *str, wchar_t ch);
extern char *str_chr(const char *str, wchar_t ch);
 
extern bool wstr_linsert(wchar_t *str, wchar_t ch, size_t pos, size_t max_pos);
extern bool wstr_remove(wchar_t *str, size_t pos);
/branches/dd/kernel/generic/src/lib/string.c
637,7 → 637,7
* @return Pointer to character in @a str or NULL if not found.
*
*/
const char *str_chr(const char *str, wchar_t ch)
char *str_chr(const char *str, wchar_t ch)
{
wchar_t acc;
size_t off = 0;
645,7 → 645,7
while ((acc = str_decode(str, &off, STR_NO_LIMIT)) != 0) {
if (acc == ch)
return (str + last);
return (char *) (str + last);
last = off;
}
/branches/dd/kernel/arch/sparc64/src/drivers/scr.c
133,7 → 133,7
break;
case 16:
fb_scanline = fb_linebytes * (fb_depth >> 3);
visual = VISUAL_BGR_5_6_5;
visual = VISUAL_RGB_5_6_5_BE;
break;
case 24:
fb_scanline = fb_linebytes * 4;
177,7 → 177,7
break;
case 16:
fb_scanline = fb_linebytes * (fb_depth >> 3);
visual = VISUAL_BGR_5_6_5;
visual = VISUAL_RGB_5_6_5_BE;
break;
case 24:
fb_scanline = fb_linebytes * 4;
/branches/dd/kernel/arch/ppc32/src/ppc32.c
92,7 → 92,7
visual = VISUAL_INDIRECT_8;
break;
case 16:
visual = VISUAL_BGR_5_5_5;
visual = VISUAL_RGB_5_5_5_BE;
break;
case 24:
visual = VISUAL_BGR_8_8_8;
/branches/dd/kernel/arch/ia32/src/drivers/vesa.c
85,9 → 85,9
if ((vesa_red_mask == 5) && (vesa_red_pos == 10)
&& (vesa_green_mask == 5) && (vesa_green_pos == 5)
&& (vesa_blue_mask == 5) && (vesa_blue_pos == 0))
visual = VISUAL_BGR_5_5_5;
visual = VISUAL_RGB_5_5_5_LE;
else
visual = VISUAL_BGR_5_6_5;
visual = VISUAL_RGB_5_6_5_LE;
break;
case 24:
visual = VISUAL_BGR_8_8_8;