X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=mware%2Ftext.c;h=5def533fa011ee6ad51089fb9ee5ecf607043354;hb=edce74d23db44bb7857440e8144484dc73c22ee9;hp=ae8669cef75b4d1ed1f9a29bb3091919b56fdd0d;hpb=79736373558decc45719f06e34cc6d67ef04f23d;p=bertos.git diff --git a/mware/text.c b/mware/text.c index ae8669ce..5def533f 100755 --- a/mware/text.c +++ b/mware/text.c @@ -6,16 +6,27 @@ * This file is part of DevLib - See devlib/README for information. * --> * - * \version $Id$ + * \brief Text graphic routines * + * \version $Id$ * \author Bernardo Innocenti * \author Stefano Fedrigo - * - * \brief Text graphic routines */ /*#* *#* $Log$ + *#* Revision 1.10 2005/01/08 09:20:12 bernie + *#* Really make it work on both architectures. + *#* + *#* Revision 1.9 2004/12/31 16:44:29 bernie + *#* Sanitize for non-Harvard processors. + *#* + *#* Revision 1.8 2004/11/16 21:16:28 bernie + *#* Update to new naming scheme in mware/gfx.c. + *#* + *#* Revision 1.7 2004/09/20 03:28:28 bernie + *#* Fix header. + *#* *#* Revision 1.6 2004/09/14 20:57:15 bernie *#* Use debug.h instead of kdebug.h. *#* @@ -53,8 +64,10 @@ #include "gfx.h" #include "font.h" #include "text.h" + #include + /*! * Flags degli stili algoritmici * @@ -143,7 +156,11 @@ static int text_putglyph(char c, struct Bitmap *bm) /* Per ogni colonna di dot del glyph... */ for (i = 0; i < glyph_width; ++i) { - dots = pgm_read_byte(glyph); + #if CPU_HARVARD + dots = PGM_READ_CHAR(glyph); + #else + dots = *glyph; + #endif /* Advance to next column in glyph. * Expand: advances only once every two columns @@ -181,7 +198,13 @@ static int text_putglyph(char c, struct Bitmap *bm) } else /* No style: fast vanilla copy of glyph to line buffer */ while (glyph_width--) - *buf++ = pgm_read_byte(glyph++); + { + #if CPU_HARVARD + *buf++ = PGM_READ_CHAR(glyph++); + #else + *buf++ = *glyph++; + #endif + } return c; } @@ -199,7 +222,7 @@ int text_putchar(char c, struct Bitmap *bm) switch (c) { case ANSI_ESC_CLEARSCREEN: - gfx_ClearBitmap(bm); + gfx_bitmapClear(bm); bm->penX = 0; bm->penY = 0; text_style(0, STYLEF_MASK); @@ -241,7 +264,7 @@ void text_clear(struct Bitmap *bmp) void text_clearLine(struct Bitmap *bmp, int line) { - gfx_ClearRect(bmp, 0, line * FONT_HEIGHT, bmp->width, (line + 1) * FONT_HEIGHT); + gfx_rectClear(bmp, 0, line * FONT_HEIGHT, bmp->width, (line + 1) * FONT_HEIGHT); }