summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/drivers/lcd-16bit.c20
-rw-r--r--firmware/drivers/lcd-h100-remote.c21
-rw-r--r--firmware/drivers/lcd-h100.c23
-rw-r--r--firmware/drivers/lcd-recorder.c19
4 files changed, 23 insertions, 60 deletions
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c
index 4a6348f..2153b69 100644
--- a/firmware/drivers/lcd-16bit.c
+++ b/firmware/drivers/lcd-16bit.c
@@ -675,15 +675,11 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, in
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_SOLID|DRMODE_INVERSEVID);
- (void)style;
+ drawmode ^= DRMODE_INVERSEVID;
lcd_fillrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h);
- if (style & STYLE_INVERT)
- {
- drawmode = DRMODE_COMPLEMENT;
- lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, h);
- }
drawmode = lastmode;
}
@@ -854,15 +850,9 @@ static void scroll_thread(void)
}
lastmode = drawmode;
- drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID);
- lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
- drawmode = DRMODE_SOLID;
+ drawmode = s->invert ?
+ (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
lcd_putsxyofs(xpos, ypos, s->offset, s->line);
- if (s->invert)
- {
- drawmode = DRMODE_COMPLEMENT;
- lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
- }
drawmode = lastmode;
lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
}
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c
index 3be907a..5d6e044 100644
--- a/firmware/drivers/lcd-h100-remote.c
+++ b/firmware/drivers/lcd-h100-remote.c
@@ -1167,14 +1167,11 @@ void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int st
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_SOLID|DRMODE_INVERSEVID);
+ drawmode ^= DRMODE_INVERSEVID;
lcd_remote_fillrect(xpos + w, ypos, LCD_REMOTE_WIDTH - (xpos + w), h);
- if (style & STYLE_INVERT)
- {
- drawmode = DRMODE_COMPLEMENT;
- lcd_remote_fillrect(xpos, ypos, LCD_REMOTE_WIDTH - xpos, h);
- }
drawmode = lastmode;
}
@@ -1354,15 +1351,9 @@ static void scroll_thread(void)
}
lastmode = drawmode;
- drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID);
- lcd_remote_fillrect(xpos, ypos, LCD_REMOTE_WIDTH - xpos, pf->height);
- drawmode = DRMODE_SOLID;
- lcd_remote_putsxyofs(xpos, ypos, s->offset, (unsigned char *)s->line);
- if (s->invert)
- {
- drawmode = DRMODE_COMPLEMENT;
- lcd_remote_fillrect(xpos, ypos, LCD_REMOTE_WIDTH - xpos, pf->height);
- }
+ drawmode = s->invert ?
+ (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
+ lcd_remote_putsxyofs(xpos, ypos, s->offset, s->line);
drawmode = lastmode;
lcd_remote_update_rect(xpos, ypos, LCD_REMOTE_WIDTH - xpos, pf->height);
}
diff --git a/firmware/drivers/lcd-h100.c b/firmware/drivers/lcd-h100.c
index 6859845..ef32078 100644
--- a/firmware/drivers/lcd-h100.c
+++ b/firmware/drivers/lcd-h100.c
@@ -845,7 +845,7 @@ void lcd_mono_bitmap_part(const unsigned char *src, int src_x, int src_y,
unsigned mask_col = mask;
unsigned data = 0;
- for (y = ny; y >= 8; y -= 8)
+ for (y = ny; y >= 8; y -= 8)
{
data |= *src_col << shift;
@@ -1090,14 +1090,11 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str,
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_SOLID|DRMODE_INVERSEVID);
+ drawmode ^= DRMODE_INVERSEVID;
lcd_fillrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h);
- if (style & STYLE_INVERT)
- {
- drawmode = DRMODE_COMPLEMENT;
- lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, h);
- }
drawmode = lastmode;
}
@@ -1266,15 +1263,9 @@ static void scroll_thread(void)
}
lastmode = drawmode;
- drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID);
- lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
- drawmode = DRMODE_SOLID;
- lcd_putsxyofs(xpos, ypos, s->offset, (unsigned char *)s->line);
- if (s->invert)
- {
- drawmode = DRMODE_COMPLEMENT;
- lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
- }
+ drawmode = s->invert ?
+ (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
+ lcd_putsxyofs(xpos, ypos, s->offset, s->line);
drawmode = lastmode;
lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
}
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c
index b7bcd02..f69bf21 100644
--- a/firmware/drivers/lcd-recorder.c
+++ b/firmware/drivers/lcd-recorder.c
@@ -950,14 +950,11 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str,
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_SOLID|DRMODE_INVERSEVID);
+ drawmode ^= DRMODE_INVERSEVID;
lcd_fillrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h);
- if (style & STYLE_INVERT)
- {
- drawmode = DRMODE_COMPLEMENT;
- lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, h);
- }
drawmode = lastmode;
}
@@ -1127,15 +1124,9 @@ static void scroll_thread(void)
}
lastmode = drawmode;
- drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID);
- lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
- drawmode = DRMODE_SOLID;
+ drawmode = s->invert ?
+ (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
lcd_putsxyofs(xpos, ypos, s->offset, s->line);
- if (s->invert)
- {
- drawmode = DRMODE_COMPLEMENT;
- lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
- }
drawmode = lastmode;
lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
}