putchar.c 698 Bytes
#include "libfb.h"
/*---------------------------------------------------------------------
                  Display character on the screen
  ---------------------------------------------------------------------*/
void
fbPutChar(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);

  if (c < 0x20) return;
  for (j = 0; j < FB_CHAR_HT; j ++, pc++) {
    for (i = FB_CHAR_WD - 1; i >= 0; i --) {
      if (*pc & (1 << i)) {
	*p = color;
      } else {
	*p = FB_BGCOLOR;
      }
      p ++;
    }
    p += FB_SCREEN_WD - FB_CHAR_WD;
  }
}