Subversion Repositories HelenOS

Compare Revisions

Regard whitespace Rev 3829 → Rev 3861

/trunk/boot/genarch/ofw.h
123,7 → 123,7
extern int ofw_memmap(memmap_t *map);
extern int ofw_screen(screen_t *screen);
extern int ofw_macio(macio_t *macio);
extern int setup_palette(void);
extern int ofw_setup_palette(void);
extern void ofw_quiesce(void);
 
#endif
/trunk/boot/genarch/ofw.c
372,6 → 372,12
return true;
}
 
#define RED(i) (((i) >> 5) & ((1 << 3) - 1))
#define GREEN(i) (((i) >> 3) & ((1 << 2) - 1))
#define BLUE(i) ((i) & ((1 << 3) - 1))
#define CLIP(i) ((i) <= 255 ? (i) : 255)
 
 
/**
* Sets up the palette for the 8-bit color depth configuration so that the
* 3:2:3 color scheme can be used. Checks that setting the palette makes sense
379,8 → 385,9
* than 8).
*
* @return true if the palette has been set, false otherwise
*
*/
int setup_palette(void)
int ofw_setup_palette(void)
{
char device_name[BUF_SIZE];
407,11 → 414,8
/* setup the palette so that the (inverted) 3:2:3 scheme is usable */
unsigned int i;
for (i = 0; i < 256; i++)
if (ofw_call("call-method", 6, 1, NULL, "color!", screen,
255 - i,
i << 5,
(i >> 3) << 6,
(i >> 5) << 5) != 0);
ofw_call("call-method", 6, 1, NULL, "color!", screen,
255 - i, CLIP(BLUE(i) * 37), GREEN(i) * 85, CLIP(RED(i) * 37));
return true;
}