aboutsummaryrefslogtreecommitdiffstats
path: root/include/gdisp/lld/emulation.c
diff options
context:
space:
mode:
Diffstat (limited to 'include/gdisp/lld/emulation.c')
-rw-r--r--include/gdisp/lld/emulation.c187
1 files changed, 0 insertions, 187 deletions
diff --git a/include/gdisp/lld/emulation.c b/include/gdisp/lld/emulation.c
index c897a92d..cb0c9c4b 100644
--- a/include/gdisp/lld/emulation.c
+++ b/include/gdisp/lld/emulation.c
@@ -461,185 +461,6 @@ GDISPDriver GDISP;
}
#endif
-#if GDISP_NEED_TEXT && !GDISP_HARDWARE_TEXT
- #include "gdisp/fonts.h"
-#endif
-
-#if GDISP_NEED_TEXT && !GDISP_HARDWARE_TEXT
- void gdisp_lld_draw_char(coord_t x, coord_t y, char c, font_t font, color_t color) {
- const fontcolumn_t *ptr;
- fontcolumn_t column;
- coord_t width, height, xscale, yscale;
- coord_t i, j, xs, ys;
-
- /* Check we actually have something to print */
- width = _getCharWidth(font, c);
- if (!width) return;
-
- xscale = font->xscale;
- yscale = font->yscale;
- height = font->height * yscale;
- width *= xscale;
-
- ptr = _getCharData(font, c);
-
- /* Loop through the data and display. The font data is LSBit first, down the column */
- for(i=0; i < width; i+=xscale) {
- /* Get the font bitmap data for the column */
- column = *ptr++;
-
- /* Draw each pixel */
- for(j=0; j < height; j+=yscale, column >>= 1) {
- if (column & 0x01) {
- for(xs=0; xs < xscale; xs++)
- for(ys=0; ys < yscale; ys++)
- gdisp_lld_draw_pixel(x+i+xs, y+j+ys, color);
- }
- }
- }
- }
-#endif
-
-#if GDISP_NEED_TEXT && !GDISP_HARDWARE_TEXTFILLS
- void gdisp_lld_fill_char(coord_t x, coord_t y, char c, font_t font, color_t color, color_t bgcolor) {
- coord_t width, height;
- coord_t xscale, yscale;
-
- /* Check we actually have something to print */
- width = _getCharWidth(font, c);
- if (!width) return;
-
- xscale = font->xscale;
- yscale = font->yscale;
- height = font->height * yscale;
- width *= xscale;
-
- /* Method 1: Use background fill and then draw the text */
- #if GDISP_HARDWARE_TEXT || GDISP_SOFTWARE_TEXTFILLDRAW
-
- /* Fill the area */
- gdisp_lld_fill_area(x, y, width, height, bgcolor);
-
- /* Draw the text */
- gdisp_lld_draw_char(x, y, c, font, color);
-
- /* Method 2: Create a single column bitmap and then blit it */
- #elif GDISP_HARDWARE_BITFILLS && GDISP_SOFTWARE_TEXTBLITCOLUMN
- {
- const fontcolumn_t *ptr;
- fontcolumn_t column;
- coord_t i, j, xs, ys;
-
- /* Working buffer for fast non-transparent text rendering [patch by Badger]
- This needs to be larger than the largest character we can print.
- Assume the max is double sized by one column.
- */
- static pixel_t buf[sizeof(fontcolumn_t)*8*2];
-
- #if GDISP_NEED_VALIDATION
- /* Check our buffer is big enough */
- if ((unsigned)height > sizeof(buf)/sizeof(buf[0])) return;
- #endif
-
- ptr = _getCharData(font, c);
-
- /* Loop through the data and display. The font data is LSBit first, down the column */
- for(i = 0; i < width; i+=xscale) {
- /* Get the font bitmap data for the column */
- column = *ptr++;
-
- /* Draw each pixel */
- for(j = 0; j < height; j+=yscale, column >>= 1) {
- if (column & 0x01) {
- for(ys=0; ys < yscale; ys++)
- gdispPackPixels(buf, 1, j+ys, 0, color);
- } else {
- for(ys=0; ys < yscale; ys++)
- gdispPackPixels(buf, 1, j+ys, 0, bgcolor);
- }
- }
-
- for(xs=0; xs < xscale; xs++)
- gdisp_lld_blit_area_ex(x+i+xs, y, 1, height, 0, 0, 1, buf);
- }
- }
-
- /* Method 3: Create a character bitmap and then blit it */
- #elif GDISP_HARDWARE_BITFILLS
- {
- const fontcolumn_t *ptr;
- fontcolumn_t column;
- coord_t i, j, xs, ys;
-
- /* Working buffer for fast non-transparent text rendering [patch by Badger]
- This needs to be larger than the largest character we can print.
- Assume the max is double sized.
- */
- static pixel_t buf[20*(sizeof(fontcolumn_t)*8)*2];
-
- #if GDISP_NEED_VALIDATION
- /* Check our buffer is big enough */
- if ((unsigned)(width * height) > sizeof(buf)/sizeof(buf[0])) return;
- #endif
-
- ptr = _getCharData(font, c);
-
- /* Loop through the data and display. The font data is LSBit first, down the column */
- for(i = 0; i < width; i+=xscale) {
- /* Get the font bitmap data for the column */
- column = *ptr++;
-
- /* Draw each pixel */
- for(j = 0; j < height; j+=yscale, column >>= 1) {
- if (column & 0x01) {
- for(xs=0; xs < xscale; xs++)
- for(ys=0; ys < yscale; ys++)
- gdispPackPixels(buf, width, i+xs, j+ys, color);
- } else {
- for(xs=0; xs < xscale; xs++)
- for(ys=0; ys < yscale; ys++)
- gdispPackPixels(buf, width, i+xs, j+ys, bgcolor);
- }
- }
- }
-
- /* [Patch by Badger] Write all in one stroke */
- gdisp_lld_blit_area_ex(x, y, width, height, 0, 0, width, buf);
- }
-
- /* Method 4: Draw pixel by pixel */
- #else
- {
- const fontcolumn_t *ptr;
- fontcolumn_t column;
- coord_t i, j, xs, ys;
-
- ptr = _getCharData(font, c);
-
- /* Loop through the data and display. The font data is LSBit first, down the column */
- for(i = 0; i < width; i+=xscale) {
- /* Get the font bitmap data for the column */
- column = *ptr++;
-
- /* Draw each pixel */
- for(j = 0; j < height; j+=yscale, column >>= 1) {
- if (column & 0x01) {
- for(xs=0; xs < xscale; xs++)
- for(ys=0; ys < yscale; ys++)
- gdisp_lld_draw_pixel(x+i+xs, y+j+ys, color);
- } else {
- for(xs=0; xs < xscale; xs++)
- for(ys=0; ys < yscale; ys++)
- gdisp_lld_draw_pixel(x+i+xs, y+j+ys, bgcolor);
- }
- }
- }
- }
- #endif
- }
-#endif
-
-
#if GDISP_NEED_CONTROL && !GDISP_HARDWARE_CONTROL
void gdisp_lld_control(unsigned what, void *value) {
(void)what;
@@ -707,14 +528,6 @@ void *gdisp_lld_query(unsigned what) {
gdisp_lld_fill_circle(msg->fillarc.x, msg->fillarc.y, msg->fillarc.radius, msg->fillarc.startangle, msg->fillarc.endangle, msg->fillarc.color);
break;
#endif
- #if GDISP_NEED_TEXT
- case GDISP_LLD_MSG_DRAWCHAR:
- gdisp_lld_draw_char(msg->drawchar.x, msg->drawchar.y, msg->drawchar.c, msg->drawchar.font, msg->drawchar.color);
- break;
- case GDISP_LLD_MSG_FILLCHAR:
- gdisp_lld_fill_char(msg->fillchar.x, msg->fillchar.y, msg->fillchar.c, msg->fillchar.font, msg->fillchar.color, msg->fillchar.bgcolor);
- break;
- #endif
#if GDISP_NEED_PIXELREAD
case GDISP_LLD_MSG_GETPIXELCOLOR:
msg->getpixelcolor.result = gdisp_lld_get_pixel_color(msg->getpixelcolor.x, msg->getpixelcolor.y);