diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/lcd-16bit.c | 9 | ||||
-rw-r--r-- | firmware/export/lcd-remote.h | 4 | ||||
-rw-r--r-- | firmware/export/lcd.h | 6 |
3 files changed, 12 insertions, 7 deletions
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c index 44e42ad617..16c97c9e99 100644 --- a/firmware/drivers/lcd-16bit.c +++ b/firmware/drivers/lcd-16bit.c | |||
@@ -807,6 +807,7 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, | |||
807 | { | 807 | { |
808 | int xpos,ypos,w,h,xrect; | 808 | int xpos,ypos,w,h,xrect; |
809 | int lastmode = drawmode; | 809 | int lastmode = drawmode; |
810 | int oldcolor = fg_pattern; | ||
810 | 811 | ||
811 | /* make sure scrolling is turned off on the line we are updating */ | 812 | /* make sure scrolling is turned off on the line we are updating */ |
812 | scrolling_lines &= ~(1 << y); | 813 | scrolling_lines &= ~(1 << y); |
@@ -819,11 +820,15 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, | |||
819 | ypos = ymargin + y*h; | 820 | ypos = ymargin + y*h; |
820 | drawmode = (style & STYLE_INVERT) ? | 821 | drawmode = (style & STYLE_INVERT) ? |
821 | (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; | 822 | (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; |
823 | if (drawmode == DRMODE_SOLID && style & STYLE_COLORED) { | ||
824 | fg_pattern = style & STYLE_COLOR_MASK; | ||
825 | } | ||
822 | lcd_putsxyofs(xpos, ypos, offset, str); | 826 | lcd_putsxyofs(xpos, ypos, offset, str); |
823 | drawmode ^= DRMODE_INVERSEVID; | 827 | drawmode ^= DRMODE_INVERSEVID; |
824 | xrect = xpos + MAX(w - offset, 0); | 828 | xrect = xpos + MAX(w - offset, 0); |
825 | lcd_fillrect(xrect, ypos, LCD_WIDTH - xrect, h); | 829 | lcd_fillrect(xrect, ypos, LCD_WIDTH - xrect, h); |
826 | drawmode = lastmode; | 830 | drawmode = lastmode; |
831 | fg_pattern = oldcolor; | ||
827 | } | 832 | } |
828 | 833 | ||
829 | /*** scrolling ***/ | 834 | /*** scrolling ***/ |
@@ -896,10 +901,8 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string, | |||
896 | s->invert = false; | 901 | s->invert = false; |
897 | if (style & STYLE_INVERT) { | 902 | if (style & STYLE_INVERT) { |
898 | s->invert = true; | 903 | s->invert = true; |
899 | lcd_puts_style_offset(x,y,string,STYLE_INVERT,offset); | ||
900 | } | 904 | } |
901 | else | 905 | lcd_puts_style_offset(x,y,string,style,offset); |
902 | lcd_puts_offset(x,y,string,offset); | ||
903 | 906 | ||
904 | lcd_getstringsize(string, &w, &h); | 907 | lcd_getstringsize(string, &w, &h); |
905 | 908 | ||
diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h index ad311a8255..cfb643ff96 100644 --- a/firmware/export/lcd-remote.h +++ b/firmware/export/lcd-remote.h | |||
@@ -43,8 +43,8 @@ int remote_type(void); | |||
43 | extern struct event_queue remote_scroll_queue; | 43 | extern struct event_queue remote_scroll_queue; |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | #define STYLE_DEFAULT 0 | 46 | #define STYLE_DEFAULT 0x00000000 |
47 | #define STYLE_INVERT 1 | 47 | #define STYLE_INVERT 0x20000000 |
48 | 48 | ||
49 | #if LCD_REMOTE_DEPTH <= 8 | 49 | #if LCD_REMOTE_DEPTH <= 8 |
50 | #if (LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED) \ | 50 | #if (LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED) \ |
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index 077664040e..cebcf54c9b 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h | |||
@@ -24,8 +24,10 @@ | |||
24 | #include "cpu.h" | 24 | #include "cpu.h" |
25 | #include "config.h" | 25 | #include "config.h" |
26 | 26 | ||
27 | #define STYLE_DEFAULT 0 | 27 | #define STYLE_DEFAULT 0x00000000 |
28 | #define STYLE_INVERT 1 | 28 | #define STYLE_INVERT 0x20000000 |
29 | #define STYLE_COLORED 0x10000000 | ||
30 | #define STYLE_COLOR_MASK 0x0000FFFF | ||
29 | 31 | ||
30 | #ifdef SIMULATOR | 32 | #ifdef SIMULATOR |
31 | #ifndef MAX_PATH | 33 | #ifndef MAX_PATH |