FS#9051 - remove LCD margins... use viewports if you need them...
[Rockbox.git] / firmware / drivers / lcd-1bit-vert.c
blobffc78bd53a88972921d650fc2dbe5f9d12f21366
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Alan Korr
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #include "config.h"
22 #include "lcd.h"
23 #include "kernel.h"
24 #include "thread.h"
25 #include <string.h>
26 #include <stdlib.h>
27 #include "file.h"
28 #include "debug.h"
29 #include "system.h"
30 #include "font.h"
31 #include "rbunicode.h"
32 #include "bidi.h"
33 #include "scroll_engine.h"
35 #ifndef LCDFN /* Not compiling for remote - define macros for main LCD. */
36 #define LCDFN(fn) lcd_ ## fn
37 #define FBFN(fn) fb_ ## fn
38 #define LCDM(ma) LCD_ ## ma
39 #define LCDNAME "lcd_"
40 #define MAIN_LCD
41 #endif
43 /*** globals ***/
45 FBFN(data) LCDFN(framebuffer)[LCDM(FBHEIGHT)][LCDM(FBWIDTH)]
46 #if CONFIG_CPU != SH7034
47 IBSS_ATTR
48 #endif
51 static struct viewport default_vp =
53 .x = 0,
54 .y = 0,
55 .width = LCDM(WIDTH),
56 .height = LCDM(HEIGHT),
57 .font = FONT_SYSFIXED,
58 .drawmode = DRMODE_SOLID,
61 static struct viewport* current_vp = &default_vp;
63 /*** Viewports ***/
65 void LCDFN(set_viewport)(struct viewport* vp)
67 if (vp == NULL)
68 current_vp = &default_vp;
69 else
70 current_vp = vp;
73 void LCDFN(update_viewport)(void)
75 LCDFN(update_rect)(current_vp->x, current_vp->y,
76 current_vp->width, current_vp->height);
79 void LCDFN(update_viewport_rect)(int x, int y, int width, int height)
81 LCDFN(update_rect)(current_vp->x + x, current_vp->y + y, width, height);
84 /* LCD init */
85 void LCDFN(init)(void)
87 LCDFN(clear_display)();
88 #ifndef SIMULATOR
89 LCDFN(init_device)();
90 #endif
91 #ifdef MAIN_LCD
92 scroll_init();
93 #endif
96 /*** parameter handling ***/
98 void LCDFN(set_drawmode)(int mode)
100 current_vp->drawmode = mode & (DRMODE_SOLID|DRMODE_INVERSEVID);
103 int LCDFN(get_drawmode)(void)
105 return current_vp->drawmode;
108 int LCDFN(getwidth)(void)
110 return current_vp->width;
113 int LCDFN(getheight)(void)
115 return current_vp->height;
118 void LCDFN(setfont)(int newfont)
120 current_vp->font = newfont;
123 int LCDFN(getfont)(void)
125 return current_vp->font;
128 int LCDFN(getstringsize)(const unsigned char *str, int *w, int *h)
130 return font_getstringsize(str, w, h, current_vp->font);
133 /*** low-level drawing functions ***/
135 static void setpixel(int x, int y)
137 LCDFN(framebuffer)[y>>3][x] |= 1 << (y & 7);
140 static void clearpixel(int x, int y)
142 LCDFN(framebuffer)[y>>3][x] &= ~(1 << (y & 7));
145 static void flippixel(int x, int y)
147 LCDFN(framebuffer)[y>>3][x] ^= 1 << (y & 7);
150 static void nopixel(int x, int y)
152 (void)x;
153 (void)y;
156 LCDFN(pixelfunc_type)* const LCDFN(pixelfuncs)[8] = {
157 flippixel, nopixel, setpixel, setpixel,
158 nopixel, clearpixel, nopixel, clearpixel
161 static void ICODE_ATTR flipblock(FBFN(data) *address, unsigned mask,
162 unsigned bits)
164 *address ^= bits & mask;
167 static void ICODE_ATTR bgblock(FBFN(data) *address, unsigned mask,
168 unsigned bits)
170 *address &= bits | ~mask;
173 static void ICODE_ATTR fgblock(FBFN(data) *address, unsigned mask,
174 unsigned bits)
176 *address |= bits & mask;
179 static void ICODE_ATTR solidblock(FBFN(data) *address, unsigned mask,
180 unsigned bits)
182 unsigned data = *(char*)address;
184 bits ^= data;
185 *address = data ^ (bits & mask);
188 static void ICODE_ATTR flipinvblock(FBFN(data) *address, unsigned mask,
189 unsigned bits)
191 *address ^= ~bits & mask;
194 static void ICODE_ATTR bginvblock(FBFN(data) *address, unsigned mask,
195 unsigned bits)
197 *address &= ~(bits & mask);
200 static void ICODE_ATTR fginvblock(FBFN(data) *address, unsigned mask,
201 unsigned bits)
203 *address |= ~bits & mask;
206 static void ICODE_ATTR solidinvblock(FBFN(data) *address, unsigned mask,
207 unsigned bits)
209 unsigned data = *(char *)address;
211 bits = ~bits ^ data;
212 *address = data ^ (bits & mask);
215 LCDFN(blockfunc_type)* const LCDFN(blockfuncs)[8] = {
216 flipblock, bgblock, fgblock, solidblock,
217 flipinvblock, bginvblock, fginvblock, solidinvblock
220 /*** drawing functions ***/
222 /* Clear the whole display */
223 void LCDFN(clear_display)(void)
225 unsigned bits = (current_vp->drawmode & DRMODE_INVERSEVID) ? 0xFFu : 0;
227 memset(LCDFN(framebuffer), bits, sizeof LCDFN(framebuffer));
228 LCDFN(scroll_info).lines = 0;
231 /* Clear the current viewport */
232 void LCDFN(clear_viewport)(void)
234 int oldmode;
236 if (current_vp == &default_vp)
238 LCDFN(clear_display)();
240 else
242 oldmode = current_vp->drawmode;
244 /* Invert the INVERSEVID bit and set basic mode to SOLID */
245 current_vp->drawmode = (~current_vp->drawmode & DRMODE_INVERSEVID) |
246 DRMODE_SOLID;
248 LCDFN(fillrect)(0, 0, current_vp->width, current_vp->height);
250 current_vp->drawmode = oldmode;
252 LCDFN(scroll_stop)(current_vp);
256 /* Set a single pixel */
257 void LCDFN(drawpixel)(int x, int y)
259 if (((unsigned)x < (unsigned)current_vp->width) &&
260 ((unsigned)y < (unsigned)current_vp->height))
261 LCDFN(pixelfuncs)[current_vp->drawmode](current_vp->x + x, current_vp->y + y);
264 /* Draw a line */
265 void LCDFN(drawline)(int x1, int y1, int x2, int y2)
267 int numpixels;
268 int i;
269 int deltax, deltay;
270 int d, dinc1, dinc2;
271 int x, xinc1, xinc2;
272 int y, yinc1, yinc2;
273 LCDFN(pixelfunc_type) *pfunc = LCDFN(pixelfuncs)[current_vp->drawmode];
275 deltax = abs(x2 - x1);
276 if (deltax == 0)
278 DEBUGF(LCDNAME "drawline() called for vertical line - optimisation.\n");
279 LCDFN(vline)(x1, y1, y2);
280 return;
282 deltay = abs(y2 - y1);
283 if (deltay == 0)
285 DEBUGF(LCDNAME "drawline() called for horizontal line - optimisation.\n");
286 LCDFN(hline)(x1, x2, y1);
287 return;
289 xinc2 = 1;
290 yinc2 = 1;
292 if (deltax >= deltay)
294 numpixels = deltax;
295 d = 2 * deltay - deltax;
296 dinc1 = deltay * 2;
297 dinc2 = (deltay - deltax) * 2;
298 xinc1 = 1;
299 yinc1 = 0;
301 else
303 numpixels = deltay;
304 d = 2 * deltax - deltay;
305 dinc1 = deltax * 2;
306 dinc2 = (deltax - deltay) * 2;
307 xinc1 = 0;
308 yinc1 = 1;
310 numpixels++; /* include endpoints */
312 if (x1 > x2)
314 xinc1 = -xinc1;
315 xinc2 = -xinc2;
318 if (y1 > y2)
320 yinc1 = -yinc1;
321 yinc2 = -yinc2;
324 x = x1;
325 y = y1;
327 for (i = 0; i < numpixels; i++)
329 if (((unsigned)x < (unsigned)current_vp->width)
330 && ((unsigned)y < (unsigned)current_vp->height))
331 pfunc(current_vp->x + x, current_vp->y + y);
333 if (d < 0)
335 d += dinc1;
336 x += xinc1;
337 y += yinc1;
339 else
341 d += dinc2;
342 x += xinc2;
343 y += yinc2;
348 /* Draw a horizontal line (optimised) */
349 void LCDFN(hline)(int x1, int x2, int y)
351 int x, width;
352 unsigned char *dst, *dst_end;
353 unsigned mask;
354 LCDFN(blockfunc_type) *bfunc;
356 /* direction flip */
357 if (x2 < x1)
359 x = x1;
360 x1 = x2;
361 x2 = x;
364 /* nothing to draw? */
365 if (((unsigned)y >= (unsigned)current_vp->height) || (x1 >= current_vp->width)
366 || (x2 < 0))
367 return;
369 /* clipping */
370 if (x1 < 0)
371 x1 = 0;
372 if (x2 >= current_vp->width)
373 x2 = current_vp->width-1;
375 width = x2 - x1 + 1;
377 /* adjust to viewport */
378 x1 += current_vp->x;
379 y += current_vp->y;
381 bfunc = LCDFN(blockfuncs)[current_vp->drawmode];
382 dst = &LCDFN(framebuffer)[y>>3][x1];
383 mask = 1 << (y & 7);
385 dst_end = dst + width;
387 bfunc(dst++, mask, 0xFFu);
388 while (dst < dst_end);
391 /* Draw a vertical line (optimised) */
392 void LCDFN(vline)(int x, int y1, int y2)
394 int ny;
395 FBFN(data) *dst;
396 unsigned mask, mask_bottom;
397 LCDFN(blockfunc_type) *bfunc;
399 /* direction flip */
400 if (y2 < y1)
402 ny = y1;
403 y1 = y2;
404 y2 = ny;
407 /* nothing to draw? */
408 if (((unsigned)x >= (unsigned)current_vp->width) || (y1 >= current_vp->height)
409 || (y2 < 0))
410 return;
412 /* clipping */
413 if (y1 < 0)
414 y1 = 0;
415 if (y2 >= current_vp->height)
416 y2 = current_vp->height-1;
418 /* adjust for viewport */
419 y1 += current_vp->y;
420 y2 += current_vp->y;
421 x += current_vp->x;
423 bfunc = LCDFN(blockfuncs)[current_vp->drawmode];
424 dst = &LCDFN(framebuffer)[y1>>3][x];
425 ny = y2 - (y1 & ~7);
426 mask = 0xFFu << (y1 & 7);
427 mask_bottom = 0xFFu >> (~ny & 7);
429 for (; ny >= 8; ny -= 8)
431 bfunc(dst, mask, 0xFFu);
432 dst += LCDM(WIDTH);
433 mask = 0xFFu;
435 mask &= mask_bottom;
436 bfunc(dst, mask, 0xFFu);
439 /* Draw a rectangular box */
440 void LCDFN(drawrect)(int x, int y, int width, int height)
442 if ((width <= 0) || (height <= 0))
443 return;
445 int x2 = x + width - 1;
446 int y2 = y + height - 1;
448 LCDFN(vline)(x, y, y2);
449 LCDFN(vline)(x2, y, y2);
450 LCDFN(hline)(x, x2, y);
451 LCDFN(hline)(x, x2, y2);
454 /* Fill a rectangular area */
455 void LCDFN(fillrect)(int x, int y, int width, int height)
457 int ny;
458 FBFN(data) *dst, *dst_end;
459 unsigned mask, mask_bottom;
460 unsigned bits = 0;
461 LCDFN(blockfunc_type) *bfunc;
462 bool fillopt = false;
464 /* nothing to draw? */
465 if ((width <= 0) || (height <= 0) || (x >= current_vp->width)
466 || (y >= current_vp->height) || (x + width <= 0) || (y + height <= 0))
467 return;
469 /* clipping */
470 if (x < 0)
472 width += x;
473 x = 0;
475 if (y < 0)
477 height += y;
478 y = 0;
480 if (x + width > current_vp->width)
481 width = current_vp->width - x;
482 if (y + height > current_vp->height)
483 height = current_vp->height - y;
485 /* adjust for viewport */
486 x += current_vp->x;
487 y += current_vp->y;
489 if (current_vp->drawmode & DRMODE_INVERSEVID)
491 if (current_vp->drawmode & DRMODE_BG)
493 fillopt = true;
496 else
498 if (current_vp->drawmode & DRMODE_FG)
500 fillopt = true;
501 bits = 0xFFu;
504 bfunc = LCDFN(blockfuncs)[current_vp->drawmode];
505 dst = &LCDFN(framebuffer)[y>>3][x];
506 ny = height - 1 + (y & 7);
507 mask = 0xFFu << (y & 7);
508 mask_bottom = 0xFFu >> (~ny & 7);
510 for (; ny >= 8; ny -= 8)
512 if (fillopt && (mask == 0xFFu))
513 memset(dst, bits, width);
514 else
516 FBFN(data) *dst_row = dst;
518 dst_end = dst_row + width;
520 bfunc(dst_row++, mask, 0xFFu);
521 while (dst_row < dst_end);
524 dst += LCDM(WIDTH);
525 mask = 0xFFu;
527 mask &= mask_bottom;
529 if (fillopt && (mask == 0xFFu))
530 memset(dst, bits, width);
531 else
533 dst_end = dst + width;
535 bfunc(dst++, mask, 0xFFu);
536 while (dst < dst_end);
540 /* About Rockbox' internal bitmap format:
542 * A bitmap contains one bit for every pixel that defines if that pixel is
543 * black (1) or white (0). Bits within a byte are arranged vertically, LSB
544 * at top.
545 * The bytes are stored in row-major order, with byte 0 being top left,
546 * byte 1 2nd from left etc. The first row of bytes defines pixel rows
547 * 0..7, the second row defines pixel row 8..15 etc.
549 * This is the same as the internal lcd hw format. */
551 /* Draw a partial bitmap */
552 void ICODE_ATTR LCDFN(bitmap_part)(const unsigned char *src, int src_x,
553 int src_y, int stride, int x, int y,
554 int width, int height)
556 int shift, ny;
557 FBFN(data) *dst, *dst_end;
558 unsigned mask, mask_bottom;
559 LCDFN(blockfunc_type) *bfunc;
561 /* nothing to draw? */
562 if ((width <= 0) || (height <= 0) || (x >= current_vp->width)
563 || (y >= current_vp->height) || (x + width <= 0) || (y + height <= 0))
564 return;
566 /* clipping */
567 if (x < 0)
569 width += x;
570 src_x -= x;
571 x = 0;
573 if (y < 0)
575 height += y;
576 src_y -= y;
577 y = 0;
579 if (x + width > current_vp->width)
580 width = current_vp->width - x;
581 if (y + height > current_vp->height)
582 height = current_vp->height - y;
584 /* adjust for viewport */
585 x += current_vp->x;
586 y += current_vp->y;
588 src += stride * (src_y >> 3) + src_x; /* move starting point */
589 src_y &= 7;
590 y -= src_y;
591 dst = &LCDFN(framebuffer)[y>>3][x];
592 shift = y & 7;
593 ny = height - 1 + shift + src_y;
595 bfunc = LCDFN(blockfuncs)[current_vp->drawmode];
596 mask = 0xFFu << (shift + src_y);
597 mask_bottom = 0xFFu >> (~ny & 7);
599 if (shift == 0)
601 bool copyopt = (current_vp->drawmode == DRMODE_SOLID);
603 for (; ny >= 8; ny -= 8)
605 if (copyopt && (mask == 0xFFu))
606 memcpy(dst, src, width);
607 else
609 const unsigned char *src_row = src;
610 FBFN(data) *dst_row = dst;
612 dst_end = dst_row + width;
614 bfunc(dst_row++, mask, *src_row++);
615 while (dst_row < dst_end);
618 src += stride;
619 dst += LCDM(WIDTH);
620 mask = 0xFFu;
622 mask &= mask_bottom;
624 if (copyopt && (mask == 0xFFu))
625 memcpy(dst, src, width);
626 else
628 dst_end = dst + width;
630 bfunc(dst++, mask, *src++);
631 while (dst < dst_end);
634 else
636 dst_end = dst + width;
639 const unsigned char *src_col = src++;
640 FBFN(data) *dst_col = dst++;
641 unsigned mask_col = mask;
642 unsigned data = 0;
644 for (y = ny; y >= 8; y -= 8)
646 data |= *src_col << shift;
648 if (mask_col & 0xFFu)
650 bfunc(dst_col, mask_col, data);
651 mask_col = 0xFFu;
653 else
654 mask_col >>= 8;
656 src_col += stride;
657 dst_col += LCDM(WIDTH);
658 data >>= 8;
660 data |= *src_col << shift;
661 bfunc(dst_col, mask_col & mask_bottom, data);
663 while (dst < dst_end);
667 /* Draw a full bitmap */
668 void LCDFN(bitmap)(const unsigned char *src, int x, int y, int width,
669 int height)
671 LCDFN(bitmap_part)(src, 0, 0, width, x, y, width, height);
674 /* put a string at a given pixel position, skipping first ofs pixel columns */
675 static void LCDFN(putsxyofs)(int x, int y, int ofs, const unsigned char *str)
677 unsigned short ch;
678 unsigned short *ucs;
679 struct font* pf = font_get(current_vp->font);
681 ucs = bidi_l2v(str, 1);
683 while ((ch = *ucs++) != 0 && x < current_vp->width)
685 int width;
686 const unsigned char *bits;
688 /* get proportional width and glyph bits */
689 width = font_get_width(pf, ch);
691 if (ofs > width)
693 ofs -= width;
694 continue;
697 bits = font_get_bits(pf, ch);
699 LCDFN(mono_bitmap_part)(bits, ofs, 0, width, x, y, width - ofs,
700 pf->height);
702 x += width - ofs;
703 ofs = 0;
706 /* put a string at a given pixel position */
707 void LCDFN(putsxy)(int x, int y, const unsigned char *str)
709 LCDFN(putsxyofs)(x, y, 0, str);
712 /*** Line oriented text output ***/
714 /* put a string at a given char position */
715 void LCDFN(puts)(int x, int y, const unsigned char *str)
717 LCDFN(puts_style_offset)(x, y, str, STYLE_DEFAULT, 0);
720 void LCDFN(puts_style)(int x, int y, const unsigned char *str, int style)
722 LCDFN(puts_style_offset)(x, y, str, style, 0);
725 void LCDFN(puts_offset)(int x, int y, const unsigned char *str, int offset)
727 LCDFN(puts_style_offset)(x, y, str, STYLE_DEFAULT, offset);
730 /* put a string at a given char position, style, and pixel position,
731 * skipping first offset pixel columns */
732 void LCDFN(puts_style_offset)(int x, int y, const unsigned char *str,
733 int style, int offset)
735 int xpos,ypos,w,h,xrect;
736 int lastmode = current_vp->drawmode;
738 /* make sure scrolling is turned off on the line we are updating */
739 LCDFN(scroll_stop_line)(current_vp, y);
741 if(!str || !str[0])
742 return;
744 LCDFN(getstringsize)(str, &w, &h);
745 xpos = x*w / utf8length(str);
746 ypos = y*h;
747 current_vp->drawmode = (style & STYLE_INVERT) ?
748 (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
749 LCDFN(putsxyofs)(xpos, ypos, offset, str);
750 current_vp->drawmode ^= DRMODE_INVERSEVID;
751 xrect = xpos + MAX(w - offset, 0);
752 LCDFN(fillrect)(xrect, ypos, current_vp->width - xrect, h);
753 current_vp->drawmode = lastmode;
756 /*** scrolling ***/
758 void LCDFN(puts_scroll)(int x, int y, const unsigned char *string)
760 LCDFN(puts_scroll_style)(x, y, string, STYLE_DEFAULT);
763 void LCDFN(puts_scroll_style)(int x, int y, const unsigned char *string,
764 int style)
766 LCDFN(puts_scroll_style_offset)(x, y, string, style, 0);
769 void LCDFN(puts_scroll_offset)(int x, int y, const unsigned char *string,
770 int offset)
772 LCDFN(puts_scroll_style_offset)(x, y, string, STYLE_DEFAULT, offset);
775 void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
776 int style, int offset)
778 struct scrollinfo* s;
779 int w, h;
781 if ((unsigned)y >= (unsigned)current_vp->height)
782 return;
784 /* remove any previously scrolling line at the same location */
785 LCDFN(scroll_stop_line)(current_vp, y);
787 if (LCDFN(scroll_info.lines) >= LCDM(SCROLLABLE_LINES)) return;
789 s = &LCDFN(scroll_info).scroll[LCDFN(scroll_info).lines];
791 s->start_tick = current_tick + LCDFN(scroll_info).delay;
792 s->style = style;
793 if (style & STYLE_INVERT) {
794 LCDFN(puts_style_offset)(x,y,string,STYLE_INVERT,offset);
796 else
797 LCDFN(puts_offset)(x,y,string,offset);
799 LCDFN(getstringsize)(string, &w, &h);
801 if (current_vp->width - x * 8 < w) {
802 /* prepare scroll line */
803 char *end;
805 memset(s->line, 0, sizeof s->line);
806 strcpy(s->line, string);
808 /* get width */
809 s->width = LCDFN(getstringsize)(s->line, &w, &h);
811 /* scroll bidirectional or forward only depending on the string
812 width */
813 if ( LCDFN(scroll_info).bidir_limit ) {
814 s->bidir = s->width < (current_vp->width) *
815 (100 + LCDFN(scroll_info).bidir_limit) / 100;
817 else
818 s->bidir = false;
820 if (!s->bidir) { /* add spaces if scrolling in the round */
821 strcat(s->line, " ");
822 /* get new width incl. spaces */
823 s->width = LCDFN(getstringsize)(s->line, &w, &h);
826 end = strchr(s->line, '\0');
827 strncpy(end, string, current_vp->width/2);
829 s->vp = current_vp;
830 s->y = y;
831 s->len = utf8length(string);
832 s->offset = offset;
833 s->startx = x * s->width / s->len;;
834 s->backward = false;
836 LCDFN(scroll_info).lines++;
840 void LCDFN(scroll_fn)(void)
842 struct font* pf;
843 struct scrollinfo* s;
844 int index;
845 int xpos, ypos;
846 int lastmode;
847 struct viewport* old_vp = current_vp;
849 for ( index = 0; index < LCDFN(scroll_info).lines; index++ ) {
850 s = &LCDFN(scroll_info).scroll[index];
852 /* check pause */
853 if (TIME_BEFORE(current_tick, s->start_tick))
854 continue;
856 LCDFN(set_viewport)(s->vp);
858 if (s->backward)
859 s->offset -= LCDFN(scroll_info).step;
860 else
861 s->offset += LCDFN(scroll_info).step;
863 pf = font_get(current_vp->font);
864 xpos = s->startx;
865 ypos = s->y * pf->height;
867 if (s->bidir) { /* scroll bidirectional */
868 if (s->offset <= 0) {
869 /* at beginning of line */
870 s->offset = 0;
871 s->backward = false;
872 s->start_tick = current_tick + LCDFN(scroll_info).delay * 2;
874 if (s->offset >= s->width - (current_vp->width - xpos)) {
875 /* at end of line */
876 s->offset = s->width - (current_vp->width - xpos);
877 s->backward = true;
878 s->start_tick = current_tick + LCDFN(scroll_info).delay * 2;
881 else {
882 /* scroll forward the whole time */
883 if (s->offset >= s->width)
884 s->offset %= s->width;
887 lastmode = current_vp->drawmode;
888 current_vp->drawmode = (s->style&STYLE_INVERT) ?
889 (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
890 LCDFN(putsxyofs)(xpos, ypos, s->offset, s->line);
891 current_vp->drawmode = lastmode;
892 LCDFN(update_viewport_rect)(xpos, ypos, current_vp->width - xpos, pf->height);
895 LCDFN(set_viewport)(old_vp);