2 #include "oswald_strings.h"
5 #include "LcdDisplay.h"
7 #define NUM_LCD_ROWS 96
8 #define NUM_LCD_COL_BYTES ( 12 )
9 #define MAX_FONT_ROWS ( 19 )
12 void DrawLcdLineBresenham(u8t xstart, u8t ystart, u8t xend, u8t yend)
14 int x, y, t, dx, dy, incx, incy, pdx, pdy, ddx, ddy, es, el, err;
19 incx = (dx >= 0) ? 1 : -1;
20 incy = (dy >= 0) ? 1 : -1;
40 lcd_set_pixel(x, y, TRUE);
42 for (t = 0; t < el; ++t) {
52 lcd_set_pixel(x, y, TRUE);
56 void DrawLcdLineBresenhamWW(u8t xstart, u8t ystart, u8t xend, u8t yend, u8t thickness)
58 int i, x, y, t, dx, dy, incx, incy, pdx, pdy, ddx, ddy, es, el, err;
63 incx = (dx >= 0) ? 1 : -1;
64 incy = (dy >= 0) ? 1 : -1;
84 lcd_set_pixel(x, y, TRUE);
85 for (i=1; i<thickness; i++) {
86 lcd_set_pixel(x-i, y, TRUE);
87 lcd_set_pixel(x+i, y, TRUE);
88 lcd_set_pixel(x, y-i, TRUE);
89 lcd_set_pixel(x, y+i, TRUE);
92 for (t = 0; t < el; ++t) {
102 lcd_set_pixel(x, y, TRUE);
103 for (i=1; i<thickness; i++) {
104 lcd_set_pixel(x-i, y, TRUE);
105 lcd_set_pixel(x+i, y, TRUE);
106 lcd_set_pixel(x, y-i, TRUE);
107 lcd_set_pixel(x, y+i, TRUE);
113 u8t WriteLcdCharacter(u8t x, u8t y, u8t Character)
115 u8t CharacterHeight = GetCharacterHeight();
116 u8t CharacterWidth = GetCharacterWidth(Character);
117 unsigned int bitmap[MAX_FONT_ROWS];
120 GetCharacterBitmap(Character,(unsigned int*)&bitmap);
122 // printf("cw=%d ch=%d\n", CharacterWidth, CharacterHeight);
123 for (ly=0; ly<CharacterHeight; ly++) {
124 for (lx=0; lx<CharacterWidth; lx++) {
125 if (bitmap[ly] & (1<<lx)) {
126 lcd_set_pixel(lx+x, ly+y, TRUE);
129 lcd_set_pixel(lx+x, ly+y, FALSE);
136 return CharacterWidth + GetFontSpacing();
139 void WriteLcdString(u8t x, u8t y, u8t *str)
141 register lx, i, strl;
143 strl = oswald_strlen(str);
148 for (i=0; i<strl; i++) {
149 lx += WriteLcdCharacter(lx, y, str[i]);