diff options
author | Dave Chapman <dave@dchapman.com> | 2006-02-05 18:25:41 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2006-02-05 18:25:41 +0000 |
commit | 2924a48ca55e0207d939998307d82e4b7f4502f8 (patch) | |
tree | 5271d5b8917a5db9778a2cce6b35fe578c75b02b /firmware/drivers/lcd-2bit-horz.c | |
parent | 75a60fbf69fb7d7be5839b35efc8253d682a1c7d (diff) | |
download | rockbox-2924a48ca55e0207d939998307d82e4b7f4502f8.tar.gz rockbox-2924a48ca55e0207d939998307d82e4b7f4502f8.zip |
Create config file for iPod 4G greyscale and various iPod 3G/4G greyscale fixes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8585 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd-2bit-horz.c')
-rw-r--r-- | firmware/drivers/lcd-2bit-horz.c | 53 |
1 files changed, 37 insertions, 16 deletions
diff --git a/firmware/drivers/lcd-2bit-horz.c b/firmware/drivers/lcd-2bit-horz.c index 01f5d93cf3..de1af90213 100644 --- a/firmware/drivers/lcd-2bit-horz.c +++ b/firmware/drivers/lcd-2bit-horz.c | |||
@@ -610,8 +610,27 @@ void lcd_putsxy(int x, int y, const unsigned char *str) | |||
610 | 610 | ||
611 | /*** line oriented text output ***/ | 611 | /*** line oriented text output ***/ |
612 | 612 | ||
613 | /* put a string at a given char position */ | ||
614 | void lcd_puts(int x, int y, const unsigned char *str) | ||
615 | { | ||
616 | lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0); | ||
617 | } | ||
618 | |||
613 | void lcd_puts_style(int x, int y, const unsigned char *str, int style) | 619 | void lcd_puts_style(int x, int y, const unsigned char *str, int style) |
614 | { | 620 | { |
621 | lcd_puts_style_offset(x, y, str, style, 0); | ||
622 | } | ||
623 | |||
624 | void lcd_puts_offset(int x, int y, const unsigned char *str, int offset) | ||
625 | { | ||
626 | lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset); | ||
627 | } | ||
628 | |||
629 | /* put a string at a given char position, style, and pixel position, | ||
630 | * skipping first offset pixel columns */ | ||
631 | void lcd_puts_style_offset(int x, int y, const unsigned char *str, | ||
632 | int style, int offset) | ||
633 | { | ||
615 | int xpos,ypos,w,h; | 634 | int xpos,ypos,w,h; |
616 | int lastmode = drawmode; | 635 | int lastmode = drawmode; |
617 | 636 | ||
@@ -624,23 +643,14 @@ void lcd_puts_style(int x, int y, const unsigned char *str, int style) | |||
624 | lcd_getstringsize(str, &w, &h); | 643 | lcd_getstringsize(str, &w, &h); |
625 | xpos = xmargin + x*w / utf8length((char *)str); | 644 | xpos = xmargin + x*w / utf8length((char *)str); |
626 | ypos = ymargin + y*h; | 645 | ypos = ymargin + y*h; |
627 | lcd_putsxy(xpos, ypos, str); | 646 | drawmode = (style & STYLE_INVERT) ? |
628 | drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); | 647 | (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; |
648 | lcd_putsxyofs(xpos, ypos, offset, str); | ||
649 | drawmode ^= DRMODE_INVERSEVID; | ||
629 | lcd_fillrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h); | 650 | lcd_fillrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h); |
630 | if (style & STYLE_INVERT) | ||
631 | { | ||
632 | drawmode = DRMODE_COMPLEMENT; | ||
633 | lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, h); | ||
634 | } | ||
635 | drawmode = lastmode; | 651 | drawmode = lastmode; |
636 | } | 652 | } |
637 | 653 | ||
638 | /* put a string at a given char position */ | ||
639 | void lcd_puts(int x, int y, const unsigned char *str) | ||
640 | { | ||
641 | lcd_puts_style(x, y, str, STYLE_DEFAULT); | ||
642 | } | ||
643 | |||
644 | /*** scrolling ***/ | 654 | /*** scrolling ***/ |
645 | 655 | ||
646 | /* Reverse the invert setting of the scrolling line (if any) at given char | 656 | /* Reverse the invert setting of the scrolling line (if any) at given char |
@@ -687,6 +697,17 @@ void lcd_puts_scroll(int x, int y, const unsigned char *string) | |||
687 | 697 | ||
688 | void lcd_puts_scroll_style(int x, int y, const unsigned char *string, int style) | 698 | void lcd_puts_scroll_style(int x, int y, const unsigned char *string, int style) |
689 | { | 699 | { |
700 | lcd_puts_scroll_style_offset(x, y, string, style, 0); | ||
701 | } | ||
702 | |||
703 | void lcd_puts_scroll_offset(int x, int y, const unsigned char *string, int offset) | ||
704 | { | ||
705 | lcd_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset); | ||
706 | } | ||
707 | |||
708 | void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string, | ||
709 | int style, int offset) | ||
710 | { | ||
690 | struct scrollinfo* s; | 711 | struct scrollinfo* s; |
691 | int w, h; | 712 | int w, h; |
692 | 713 | ||
@@ -696,10 +717,10 @@ void lcd_puts_scroll_style(int x, int y, const unsigned char *string, int style) | |||
696 | s->invert = false; | 717 | s->invert = false; |
697 | if (style & STYLE_INVERT) { | 718 | if (style & STYLE_INVERT) { |
698 | s->invert = true; | 719 | s->invert = true; |
699 | lcd_puts_style(x,y,string,STYLE_INVERT); | 720 | lcd_puts_style_offset(x,y,string,STYLE_INVERT,offset); |
700 | } | 721 | } |
701 | else | 722 | else |
702 | lcd_puts(x,y,string); | 723 | lcd_puts_offset(x,y,string,offset); |
703 | 724 | ||
704 | lcd_getstringsize(string, &w, &h); | 725 | lcd_getstringsize(string, &w, &h); |
705 | 726 | ||
@@ -732,7 +753,7 @@ void lcd_puts_scroll_style(int x, int y, const unsigned char *string, int style) | |||
732 | strncpy(end, (char *)string, LCD_WIDTH/2); | 753 | strncpy(end, (char *)string, LCD_WIDTH/2); |
733 | 754 | ||
734 | s->len = utf8length((char *)string); | 755 | s->len = utf8length((char *)string); |
735 | s->offset = 0; | 756 | s->offset = offset; |
736 | s->startx = x; | 757 | s->startx = x; |
737 | s->backward = false; | 758 | s->backward = false; |
738 | scrolling_lines |= (1<<y); | 759 | scrolling_lines |= (1<<y); |