revchar.c
682 Bytes
#include "libfb.h"
/*---------------------------------------------------------------------
Display reverse character on the screen
---------------------------------------------------------------------*/
void fbRevChar(u16 color, int curs_x, int curs_y, char c)
{
int i, j;
int x = curs_x*FB_CHAR_WD;
int y = curs_y*FB_CHAR_HT;
u8 *pc = fb_font[c-0x20];
u16 *p = (u16 *)osViGetNextFramebuffer() + x + FB_SCREEN_WD*(y-8);
for (j = 0; j < FB_CHAR_HT; j ++, pc++) {
for (i = FB_CHAR_WD - 1; i >= 0; i --) {
if (*pc & (1 << i)) {
*p = FB_BGCOLOR;
} else {
*p = color;
}
p ++;
}
p += FB_SCREEN_WD - FB_CHAR_WD;
}
}