bigputc.c 1.23 KB
#include "libfb.h"

/*---------------------------------------------------------------------
                  Display Big character on the screen
  ---------------------------------------------------------------------*/
void
fbBigPutc(u16 color, int curs_x, int curs_y, char c, int xsize, int ysize)
{
  int	i, j, k, l, x, y;
  u16	*p;

  x = curs_x*FB_CHAR_WD;
  p = (u16 *)osViGetNextFramebuffer();

  if ( ysize ) {
    y = curs_y*FB_CHAR_HT;
    
    for (j = 0; j < FB_CHAR_HT; j ++) {
      for (i = 0; i < 8; i ++) {
	if (fb_font[c-0x20][j] & (1 << (8-i))) {
	  for (k = 0; k < xsize; k ++){
	    for (l = 0; l < ysize; l ++){
	      p[x + FB_SCREEN_WD*(y-8+l) + k] = color;
	    }
	  }
	} else {
#if	0
	  for (k = 0; k < xsize; k ++){
	    for (l = 0; l < ysize; l ++){
	    	p[x + SCREEN_WD*(y-8+l) + k] = BGCOLOR;
	    }
	  }
#endif
	}
	x += xsize;
      }
      x = curs_x*FB_CHAR_WD;
      y += ysize;
    }
  } else {
    y = curs_y*FB_CHAR_HT/2;

    for (j = 0; j < FB_CHAR_HT; j += 2) {
      for (i = FB_CHAR_WD - 1; i >= 0; i --) {
	if (fb_font[c-0x20][j] & (1 << i)) {
	  p[x + FB_SCREEN_WD*(y-8)] = color;
#if	0
	} else {
	  p[x + FB_SCREEN_WD*(y-8)] = FB_BGCOLOR;
#endif
	}
	x++;
      }
      x = curs_x*FB_CHAR_WD;
      y ++;
    }
  }
}