Index: firmware/export/lcd.h =================================================================== --- firmware/export/lcd.h (revision 14280) +++ firmware/export/lcd.h (working copy) @@ -73,6 +73,9 @@ extern void lcd_puts(int x, int y, const unsigned char *string); extern void lcd_puts_style(int x, int y, const unsigned char *string, int style); extern void lcd_puts_offset(int x, int y, const unsigned char *str, int offset); +#ifdef HAVE_LCD_BITMAP +extern void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str); +#endif extern void lcd_puts_scroll_offset(int x, int y, const unsigned char *string, int offset); extern void lcd_putc(int x, int y, unsigned long ucs); @@ -88,6 +91,12 @@ extern void lcd_yuv_blit(unsigned char * const src[3], int src_x, int src_y, int stride, int x, int y, int width, int height); +extern void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, + int style, int offset); +extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset); +extern void lcd_remote_puts_style(int x, int y, const unsigned char *str, int style); +extern void lcd_remote_puts(int x, int y, const unsigned char *str); +extern void lcd_remote_putsxy(int x, int y, const unsigned char *str); #endif #ifdef HAVE_LCD_BITMAP @@ -102,6 +111,7 @@ extern void lcd_remote_update(void); /* update a fraction of the screen */ extern void lcd_remote_update_rect(int x, int y, int width, int height); +void lcd_remote_putsxyofs(int x, int y, int ofs, const unsigned char *str); #endif /* HAVE_REMOTE_LCD */ #endif /* HAVE_LCD_BITMAP */ Index: firmware/SOURCES =================================================================== --- firmware/SOURCES (revision 14280) +++ firmware/SOURCES (working copy) @@ -59,6 +59,7 @@ /* Display */ scroll_engine.c +drivers/lcd-generic.c #ifdef HAVE_LCD_CHARCELLS drivers/lcd-charcell.c Index: firmware/drivers/lcd-1bit-vert.c =================================================================== --- firmware/drivers/lcd-1bit-vert.c (revision 14280) +++ firmware/drivers/lcd-1bit-vert.c (working copy) @@ -577,88 +577,8 @@ lcd_bitmap_part(src, 0, 0, width, x, y, width, height); } -/* put a string at a given pixel position, skipping first ofs pixel columns */ -static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str) -{ - unsigned short ch; - unsigned short *ucs; - struct font* pf = font_get(curfont); - ucs = bidi_l2v(str, 1); - while ((ch = *ucs++) != 0 && x < LCD_WIDTH) - { - int width; - const unsigned char *bits; - - /* get proportional width and glyph bits */ - width = font_get_width(pf,ch); - - if (ofs > width) - { - ofs -= width; - continue; - } - - bits = font_get_bits(pf, ch); - - lcd_mono_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, - pf->height); - - x += width - ofs; - ofs = 0; - } -} -/* put a string at a given pixel position */ -void lcd_putsxy(int x, int y, const unsigned char *str) -{ - lcd_putsxyofs(x, y, 0, str); -} - -/*** Line oriented text output ***/ - -/* put a string at a given char position */ -void lcd_puts(int x, int y, const unsigned char *str) -{ - lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0); -} - -void lcd_puts_style(int x, int y, const unsigned char *str, int style) -{ - lcd_puts_style_offset(x, y, str, style, 0); -} - -void lcd_puts_offset(int x, int y, const unsigned char *str, int offset) -{ - lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset); -} - -/* put a string at a given char position, style, and pixel position, - * skipping first offset pixel columns */ -void lcd_puts_style_offset(int x, int y, const unsigned char *str, - int style, int offset) -{ - int xpos,ypos,w,h,xrect; - int lastmode = drawmode; - - /* make sure scrolling is turned off on the line we are updating */ - lcd_scroll_info.lines &= ~(1 << y); - - if(!str || !str[0]) - return; - - lcd_getstringsize(str, &w, &h); - xpos = xmargin + x*w / utf8length(str); - ypos = ymargin + y*h; - drawmode = (style & STYLE_INVERT) ? - (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; - lcd_putsxyofs(xpos, ypos, offset, str); - drawmode ^= DRMODE_INVERSEVID; - xrect = xpos + MAX(w - offset, 0); - lcd_fillrect(xrect, ypos, LCD_WIDTH - xrect, h); - drawmode = lastmode; -} - /*** scrolling ***/ void lcd_puts_scroll(int x, int y, const unsigned char *string) { Index: firmware/drivers/lcd-2bit-vert.c =================================================================== --- firmware/drivers/lcd-2bit-vert.c (revision 14280) +++ firmware/drivers/lcd-2bit-vert.c (working copy) @@ -911,89 +911,6 @@ lcd_bitmap_part(src, 0, 0, width, x, y, width, height); } -/* put a string at a given pixel position, skipping first ofs pixel columns */ -static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str) -{ - unsigned short ch; - unsigned short *ucs; - struct font* pf = font_get(curfont); - - ucs = bidi_l2v(str, 1); - - while ((ch = *ucs++) != 0 && x < LCD_WIDTH) - { - int width; - const unsigned char *bits; - - /* get proportional width and glyph bits */ - width = font_get_width(pf,ch); - - if (ofs > width) - { - ofs -= width; - continue; - } - - bits = font_get_bits(pf, ch); - - lcd_mono_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, - pf->height); - - x += width - ofs; - ofs = 0; - } -} - -/* put a string at a given pixel position */ -void lcd_putsxy(int x, int y, const unsigned char *str) -{ - lcd_putsxyofs(x, y, 0, str); -} - -/*** line oriented text output ***/ - -/* put a string at a given char position */ -void lcd_puts(int x, int y, const unsigned char *str) -{ - lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0); -} - -void lcd_puts_style(int x, int y, const unsigned char *str, int style) -{ - lcd_puts_style_offset(x, y, str, style, 0); -} - -void lcd_puts_offset(int x, int y, const unsigned char *str, int offset) -{ - lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset); -} - -/* put a string at a given char position, style, and pixel position, - * skipping first offset pixel columns */ -void lcd_puts_style_offset(int x, int y, const unsigned char *str, - int style, int offset) -{ - int xpos,ypos,w,h,xrect; - int lastmode = drawmode; - - /* make sure scrolling is turned off on the line we are updating */ - lcd_scroll_info.lines &= ~(1 << y); - - if(!str || !str[0]) - return; - - lcd_getstringsize(str, &w, &h); - xpos = xmargin + x*w / utf8length((char *)str); - ypos = ymargin + y*h; - drawmode = (style & STYLE_INVERT) ? - (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; - lcd_putsxyofs(xpos, ypos, offset, str); - drawmode ^= DRMODE_INVERSEVID; - xrect = xpos + MAX(w - offset, 0); - lcd_fillrect(xrect, ypos, LCD_WIDTH - xrect, h); - drawmode = lastmode; -} - /*** scrolling ***/ void lcd_puts_scroll(int x, int y, const unsigned char *string) Index: firmware/drivers/lcd-2bit-horz.c =================================================================== --- firmware/drivers/lcd-2bit-horz.c (revision 14280) +++ firmware/drivers/lcd-2bit-horz.c (working copy) @@ -776,89 +776,7 @@ lcd_bitmap_part(src, 0, 0, width, x, y, width, height); } -/* put a string at a given pixel position, skipping first ofs pixel columns */ -static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str) -{ - unsigned short ch; - unsigned short *ucs; - struct font* pf = font_get(curfont); - ucs = bidi_l2v(str, 1); - - while ((ch = *ucs++) != 0 && x < LCD_WIDTH) - { - int width; - const unsigned char *bits; - - /* get proportional width and glyph bits */ - width = font_get_width(pf,ch); - - if (ofs > width) - { - ofs -= width; - continue; - } - - bits = font_get_bits(pf, ch); - - lcd_mono_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, - pf->height); - - x += width - ofs; - ofs = 0; - } -} - -/* put a string at a given pixel position */ -void lcd_putsxy(int x, int y, const unsigned char *str) -{ - lcd_putsxyofs(x, y, 0, str); -} - -/*** line oriented text output ***/ - -/* put a string at a given char position */ -void lcd_puts(int x, int y, const unsigned char *str) -{ - lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0); -} - -void lcd_puts_style(int x, int y, const unsigned char *str, int style) -{ - lcd_puts_style_offset(x, y, str, style, 0); -} - -void lcd_puts_offset(int x, int y, const unsigned char *str, int offset) -{ - lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset); -} - -/* put a string at a given char position, style, and pixel position, - * skipping first offset pixel columns */ -void lcd_puts_style_offset(int x, int y, const unsigned char *str, - int style, int offset) -{ - int xpos,ypos,w,h,xrect; - int lastmode = drawmode; - - /* make sure scrolling is turned off on the line we are updating */ - lcd_scroll_info.lines &= ~(1 << y); - - if(!str || !str[0]) - return; - - lcd_getstringsize(str, &w, &h); - xpos = xmargin + x*w / utf8length((char *)str); - ypos = ymargin + y*h; - drawmode = (style & STYLE_INVERT) ? - (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; - lcd_putsxyofs(xpos, ypos, offset, str); - drawmode ^= DRMODE_INVERSEVID; - xrect = xpos + MAX(w - offset, 0); - lcd_fillrect(xrect, ypos, LCD_WIDTH - xrect, h); - drawmode = lastmode; -} - /*** scrolling ***/ void lcd_puts_scroll(int x, int y, const unsigned char *string) { Index: firmware/drivers/lcd-remote-2bit-vi.c =================================================================== --- firmware/drivers/lcd-remote-2bit-vi.c (revision 14280) +++ firmware/drivers/lcd-remote-2bit-vi.c (working copy) @@ -912,89 +912,6 @@ lcd_remote_bitmap_part(src, 0, 0, width, x, y, width, height); } -/* put a string at a given pixel position, skipping first ofs pixel columns */ -void lcd_remote_putsxyofs(int x, int y, int ofs, const unsigned char *str) -{ - unsigned short ch; - unsigned short *ucs; - struct font* pf = font_get(curfont); - - ucs = bidi_l2v(str, 1); - - while ((ch = *ucs++) != 0 && x < LCD_REMOTE_WIDTH) - { - int width; - const unsigned char *bits; - - /* get proportional width and glyph bits */ - width = font_get_width(pf, ch); - - if (ofs > width) - { - ofs -= width; - continue; - } - - bits = font_get_bits(pf, ch); - - lcd_remote_mono_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, - pf->height); - - x += width - ofs; - ofs = 0; - } -} - -/* put a string at a given pixel position */ -void lcd_remote_putsxy(int x, int y, const unsigned char *str) -{ - lcd_remote_putsxyofs(x, y, 0, str); -} - -/*** line oriented text output ***/ - -/* put a string at a given char position */ -void lcd_remote_puts(int x, int y, const unsigned char *str) -{ - lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, 0); -} - -void lcd_remote_puts_style(int x, int y, const unsigned char *str, int style) -{ - lcd_remote_puts_style_offset(x, y, str, style, 0); -} - -void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset) -{ - lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, offset); -} - -/* put a string at a given char position, style, and pixel position, - * skipping first offset pixel columns */ -void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, - int style, int offset) -{ - int xpos,ypos,w,h,xrect; - int lastmode = drawmode; - - /* make sure scrolling is turned off on the line we are updating */ - lcd_remote_scroll_info.lines &= ~(1 << y); - - if(!str || !str[0]) - return; - - lcd_remote_getstringsize(str, &w, &h); - xpos = xmargin + x*w / utf8length((char *)str); - ypos = ymargin + y*h; - drawmode = (style & STYLE_INVERT) ? - (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; - lcd_remote_putsxyofs(xpos, ypos, offset, str); - drawmode ^= DRMODE_INVERSEVID; - xrect = xpos + MAX(w - offset, 0); - lcd_remote_fillrect(xrect, ypos, LCD_REMOTE_WIDTH - xrect, h); - drawmode = lastmode; -} - /*** scrolling ***/ void lcd_remote_puts_scroll(int x, int y, const unsigned char *string) { Index: firmware/drivers/lcd-generic.c =================================================================== --- firmware/drivers/lcd-generic.c (revision 0) +++ firmware/drivers/lcd-generic.c (revision 0) @@ -0,0 +1,225 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: lcd-16bit.c 14035 2007-07-28 08:12:05Z jethead71 $ + * + * Copyright (C) + * + * Generic LCD functions + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#include "config.h" +#include "lcd.h" +#include "font.h" +#include "system.h" +#include "rbunicode.h" +#include "bidi.h" +#include "scroll_engine.h" + +#ifdef HAVE_LCD_BITMAP + +#ifdef HAVE_LCD_COLOR +extern unsigned fg_pattern; +extern unsigned bg_pattern; +#endif + +extern int drawmode; +extern int xmargin; +extern int ymargin; +extern int curfont; + +/* put a string at a given char position, style, and pixel position, + * skipping first offset pixel columns */ +void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, + int offset) +{ + int xpos,ypos,w,h,xrect; + int lastmode = drawmode; +#ifdef HAVE_LCD_COLOR + int oldfgcolor = fg_pattern; + int oldbgcolor = bg_pattern; +#endif + + /* make sure scrolling is turned off on the line we are updating */ + lcd_scroll_info.lines &= ~(1 << y); + + if(!str || !str[0]) + return; + + lcd_getstringsize(str, &w, &h); + xpos = xmargin + x*w / utf8length(str); + ypos = ymargin + y*h; + drawmode = (style & STYLE_INVERT) ? + (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; +#ifdef HAVE_LCD_COLOR + if (style & STYLE_COLORED) { + if (drawmode == DRMODE_SOLID) + fg_pattern = style & STYLE_COLOR_MASK; + else + bg_pattern = style & STYLE_COLOR_MASK; + } +#endif + lcd_putsxyofs(xpos, ypos, offset, str); + drawmode ^= DRMODE_INVERSEVID; + xrect = xpos + MAX(w - offset, 0); + lcd_fillrect(xrect, ypos, LCD_WIDTH - xrect, h); + drawmode = lastmode; + +#ifdef HAVE_LCD_COLOR + fg_pattern = oldfgcolor; + bg_pattern = oldbgcolor; +#endif +} + +/* put a string at a given pixel position, skipping first ofs pixel columns */ +void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str) +{ + unsigned short ch; + unsigned short *ucs; + struct font* pf = font_get(curfont); + + ucs = bidi_l2v(str, 1); + + while ((ch = *ucs++) != 0 && x < LCD_WIDTH) + { + int width; + const unsigned char *bits; + + /* get proportional width and glyph bits */ + width = font_get_width(pf,ch); + + if (ofs > width) + { + ofs -= width; + continue; + } + + bits = font_get_bits(pf, ch); + + lcd_mono_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, pf->height); + + x += width - ofs; + ofs = 0; + } +} + +/* put a string at a given pixel position */ +void lcd_putsxy(int x, int y, const unsigned char *str) +{ + lcd_putsxyofs(x, y, 0, str); +} + +/*** line oriented text output ***/ + +/* put a string at a given char position */ +void lcd_puts(int x, int y, const unsigned char *str) +{ + lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0); +} + +void lcd_puts_style(int x, int y, const unsigned char *str, int style) +{ + lcd_puts_style_offset(x, y, str, style, 0); +} + +void lcd_puts_offset(int x, int y, const unsigned char *str, int offset) +{ + lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset); +} +#endif /* HAVE_LCD_BITMAP */ + +#ifdef HAVE_LCD_REMOTE + +/* put a string at a given pixel position, skipping first ofs pixel columns */ +void lcd_remote_putsxyofs(int x, int y, int ofs, const unsigned char *str) +{ + unsigned short ch; + unsigned short *ucs; + struct font* pf = font_get(curfont); + + ucs = bidi_l2v(str, 1); + + while ((ch = *ucs++) != 0 && x < LCD_REMOTE_WIDTH) + { + int width; + const unsigned char *bits; + + /* get proportional width and glyph bits */ + width = font_get_width(pf, ch); + + if (ofs > width) + { + ofs -= width; + continue; + } + + bits = font_get_bits(pf, ch); + + lcd_remote_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, + pf->height); + + x += width - ofs; + ofs = 0; + } +} + +/* put a string at a given pixel position */ +void lcd_remote_putsxy(int x, int y, const unsigned char *str) +{ + lcd_remote_putsxyofs(x, y, 0, str); +} + +/*** line oriented text output ***/ + +/* put a string at a given char position */ +void lcd_remote_puts(int x, int y, const unsigned char *str) +{ + lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, 0); +} + +void lcd_remote_puts_style(int x, int y, const unsigned char *str, int style) +{ + lcd_remote_puts_style_offset(x, y, str, style, 0); +} + +void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset) +{ + lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, offset); +} + +/* put a string at a given char position, style, and pixel position, + * skipping first offset pixel columns */ +void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, + int style, int offset) +{ + int xpos,ypos,w,h,xrect; + int lastmode = drawmode; + + /* make sure scrolling is turned off on the line we are updating */ + lcd_remote_scroll_info.lines &= ~(1 << y); + + if(!str || !str[0]) + return; + + lcd_remote_getstringsize(str, &w, &h); + xpos = xmargin + x*w / utf8length((char *)str); + ypos = ymargin + y*h; + drawmode = (style & STYLE_INVERT) ? + (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; + lcd_remote_putsxyofs(xpos, ypos, offset, str); + drawmode ^= DRMODE_INVERSEVID; + xrect = xpos + MAX(w - offset, 0); + lcd_remote_fillrect(xrect, ypos, LCD_REMOTE_WIDTH - xrect, h); + drawmode = lastmode; +} +#endif Index: firmware/drivers/lcd-16bit.c =================================================================== --- firmware/drivers/lcd-16bit.c (revision 14280) +++ firmware/drivers/lcd-16bit.c (working copy) @@ -49,17 +49,17 @@ static long lcd_backdrop_offset IDATA_ATTR = 0; #if !defined(TOSHIBA_GIGABEAT_F) || defined(SIMULATOR) -static unsigned fg_pattern IDATA_ATTR = LCD_DEFAULT_FG; -static unsigned bg_pattern IDATA_ATTR = LCD_DEFAULT_BG; +unsigned fg_pattern IDATA_ATTR = LCD_DEFAULT_FG; +unsigned bg_pattern IDATA_ATTR = LCD_DEFAULT_BG; #else unsigned fg_pattern IDATA_ATTR = LCD_DEFAULT_FG; unsigned bg_pattern IDATA_ATTR = LCD_DEFAULT_BG; #endif -static int drawmode = DRMODE_SOLID; -static int xmargin = 0; -static int ymargin = 0; -static int curfont = FONT_SYSFIXED; +int drawmode = DRMODE_SOLID; +int xmargin = 0; +int ymargin = 0; +int curfont = FONT_SYSFIXED; /* LCD init */ void lcd_init(void) @@ -730,98 +730,8 @@ lcd_bitmap_transparent_part(src, 0, 0, width, x, y, width, height); } -/* put a string at a given pixel position, skipping first ofs pixel columns */ -static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str) -{ - unsigned short ch; - unsigned short *ucs; - struct font* pf = font_get(curfont); - ucs = bidi_l2v(str, 1); - while ((ch = *ucs++) != 0 && x < LCD_WIDTH) - { - int width; - const unsigned char *bits; - - /* get proportional width and glyph bits */ - width = font_get_width(pf,ch); - - if (ofs > width) - { - ofs -= width; - continue; - } - - bits = font_get_bits(pf, ch); - - lcd_mono_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, pf->height); - - x += width - ofs; - ofs = 0; - } -} - -/* put a string at a given pixel position */ -void lcd_putsxy(int x, int y, const unsigned char *str) -{ - lcd_putsxyofs(x, y, 0, str); -} - -/*** line oriented text output ***/ - -/* put a string at a given char position */ -void lcd_puts(int x, int y, const unsigned char *str) -{ - lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0); -} - -void lcd_puts_style(int x, int y, const unsigned char *str, int style) -{ - lcd_puts_style_offset(x, y, str, style, 0); -} - -void lcd_puts_offset(int x, int y, const unsigned char *str, int offset) -{ - lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset); -} - -/* put a string at a given char position, style, and pixel position, - * skipping first offset pixel columns */ -void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, - int offset) -{ - int xpos,ypos,w,h,xrect; - int lastmode = drawmode; - int oldfgcolor = fg_pattern; - int oldbgcolor = bg_pattern; - - /* make sure scrolling is turned off on the line we are updating */ - lcd_scroll_info.lines &= ~(1 << y); - - if(!str || !str[0]) - return; - - lcd_getstringsize(str, &w, &h); - xpos = xmargin + x*w / utf8length(str); - ypos = ymargin + y*h; - drawmode = (style & STYLE_INVERT) ? - (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; - if (style & STYLE_COLORED) { - if (drawmode == DRMODE_SOLID) - fg_pattern = style & STYLE_COLOR_MASK; - else - bg_pattern = style & STYLE_COLOR_MASK; - } - lcd_putsxyofs(xpos, ypos, offset, str); - drawmode ^= DRMODE_INVERSEVID; - xrect = xpos + MAX(w - offset, 0); - lcd_fillrect(xrect, ypos, LCD_WIDTH - xrect, h); - drawmode = lastmode; - fg_pattern = oldfgcolor; - bg_pattern = oldbgcolor; -} - /*** scrolling ***/ void lcd_puts_scroll(int x, int y, const unsigned char *string) { Index: firmware/drivers/lcd-remote-1bit-v.c =================================================================== --- firmware/drivers/lcd-remote-1bit-v.c (revision 14280) +++ firmware/drivers/lcd-remote-1bit-v.c (working copy) @@ -574,89 +574,6 @@ lcd_remote_bitmap_part(src, 0, 0, width, x, y, width, height); } -/* put a string at a given pixel position, skipping first ofs pixel columns */ -void lcd_remote_putsxyofs(int x, int y, int ofs, const unsigned char *str) -{ - unsigned short ch; - unsigned short *ucs; - struct font* pf = font_get(curfont); - - ucs = bidi_l2v(str, 1); - - while ((ch = *ucs++) != 0 && x < LCD_REMOTE_WIDTH) - { - int width; - const unsigned char *bits; - - /* get proportional width and glyph bits */ - width = font_get_width(pf, ch); - - if (ofs > width) - { - ofs -= width; - continue; - } - - bits = font_get_bits(pf, ch); - - lcd_remote_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, - pf->height); - - x += width - ofs; - ofs = 0; - } -} - -/* put a string at a given pixel position */ -void lcd_remote_putsxy(int x, int y, const unsigned char *str) -{ - lcd_remote_putsxyofs(x, y, 0, str); -} - -/*** line oriented text output ***/ - -/* put a string at a given char position */ -void lcd_remote_puts(int x, int y, const unsigned char *str) -{ - lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, 0); -} - -void lcd_remote_puts_style(int x, int y, const unsigned char *str, int style) -{ - lcd_remote_puts_style_offset(x, y, str, style, 0); -} - -void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset) -{ - lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, offset); -} - -/* put a string at a given char position, style, and pixel position, - * skipping first offset pixel columns */ -void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, - int style, int offset) -{ - int xpos,ypos,w,h,xrect; - int lastmode = drawmode; - - /* make sure scrolling is turned off on the line we are updating */ - lcd_remote_scroll_info.lines &= ~(1 << y); - - if(!str || !str[0]) - return; - - lcd_remote_getstringsize(str, &w, &h); - xpos = xmargin + x*w / utf8length((char *)str); - ypos = ymargin + y*h; - drawmode = (style & STYLE_INVERT) ? - (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; - lcd_remote_putsxyofs(xpos, ypos, offset, str); - drawmode ^= DRMODE_INVERSEVID; - xrect = xpos + MAX(w - offset, 0); - lcd_remote_fillrect(xrect, ypos, LCD_REMOTE_WIDTH - xrect, h); - drawmode = lastmode; -} - /*** scrolling ***/ void lcd_remote_puts_scroll(int x, int y, const unsigned char *string)