summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/drivers/lcd-h100-remote.c23
-rw-r--r--firmware/drivers/lcd-h100.c24
-rw-r--r--firmware/drivers/lcd-recorder.c25
3 files changed, 53 insertions, 19 deletions
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c
index 6bbe01a..df735ca 100644
--- a/firmware/drivers/lcd-h100-remote.c
+++ b/firmware/drivers/lcd-h100-remote.c
@@ -916,9 +916,9 @@ void lcd_remote_fillrect(int x, int y, int width, int height)
int ny;
unsigned char *dst, *dst_end;
unsigned mask, mask_bottom;
- unsigned bits = 0xFFu;
+ unsigned bits = 0;
lcd_blockfunc_type *bfunc;
- bool fillopt;
+ bool fillopt = false;
/* nothing to draw? */
if ((width <= 0) || (height <= 0) || (x >= LCD_REMOTE_WIDTH)
@@ -941,10 +941,21 @@ void lcd_remote_fillrect(int x, int y, int width, int height)
if (y + height > LCD_REMOTE_HEIGHT)
height = LCD_REMOTE_HEIGHT - y;
- fillopt = (drawmode & DRMODE_INVERSEVID) ?
- (drawmode & DRMODE_BG) : (drawmode & DRMODE_FG);
- if (fillopt &&(drawmode & DRMODE_INVERSEVID))
- bits = 0;
+ if (drawmode & DRMODE_INVERSEVID)
+ {
+ if (drawmode & DRMODE_BG)
+ {
+ fillopt = true;
+ }
+ }
+ else
+ {
+ if (drawmode & DRMODE_FG)
+ {
+ fillopt = true;
+ bits = 0xFFu;
+ }
+ }
bfunc = lcd_remote_blockfuncs[drawmode];
dst = &lcd_remote_framebuffer[y>>3][x];
ny = height - 1 + (y & 7);
diff --git a/firmware/drivers/lcd-h100.c b/firmware/drivers/lcd-h100.c
index 3af6ffe..78b1e33 100644
--- a/firmware/drivers/lcd-h100.c
+++ b/firmware/drivers/lcd-h100.c
@@ -658,9 +658,9 @@ void lcd_fillrect(int x, int y, int width, int height)
int ny;
unsigned char *dst, *dst_end;
unsigned mask, mask_bottom;
- unsigned bits = fg_pattern;
+ unsigned bits = 0;
lcd_blockfunc_type *bfunc;
- bool fillopt;
+ bool fillopt = false;
/* nothing to draw? */
if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
@@ -683,10 +683,22 @@ void lcd_fillrect(int x, int y, int width, int height)
if (y + height > LCD_HEIGHT)
height = LCD_HEIGHT - y;
- fillopt = (drawmode & DRMODE_INVERSEVID) ?
- (drawmode & DRMODE_BG) : (drawmode & DRMODE_FG);
- if (fillopt &&(drawmode & DRMODE_INVERSEVID))
- bits = bg_pattern;
+ if (drawmode & DRMODE_INVERSEVID)
+ {
+ if (drawmode & DRMODE_BG)
+ {
+ fillopt = true;
+ bits = bg_pattern;
+ }
+ }
+ else
+ {
+ if (drawmode & DRMODE_FG)
+ {
+ fillopt = true;
+ bits = fg_pattern;
+ }
+ }
bfunc = lcd_blockfuncs[drawmode];
dst = &lcd_framebuffer[y>>2][x];
ny = height - 1 + (y & 3);
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c
index f69bf21..2238881 100644
--- a/firmware/drivers/lcd-recorder.c
+++ b/firmware/drivers/lcd-recorder.c
@@ -677,9 +677,9 @@ void lcd_fillrect(int x, int y, int width, int height)
int ny;
unsigned char *dst, *dst_end;
unsigned mask, mask_bottom;
- unsigned bits = 0xFFu;
+ unsigned bits = 0;
lcd_blockfunc_type *bfunc;
- bool fillopt;
+ bool fillopt = false;
/* nothing to draw? */
if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
@@ -701,11 +701,22 @@ void lcd_fillrect(int x, int y, int width, int height)
width = LCD_WIDTH - x;
if (y + height > LCD_HEIGHT)
height = LCD_HEIGHT - y;
-
- fillopt = (drawmode & DRMODE_INVERSEVID) ?
- (drawmode & DRMODE_BG) : (drawmode & DRMODE_FG);
- if (fillopt &&(drawmode & DRMODE_INVERSEVID))
- bits = 0;
+
+ if (drawmode & DRMODE_INVERSEVID)
+ {
+ if (drawmode & DRMODE_BG)
+ {
+ fillopt = true;
+ }
+ }
+ else
+ {
+ if (drawmode & DRMODE_FG)
+ {
+ fillopt = true;
+ bits = 0xFFu;
+ }
+ }
bfunc = lcd_blockfuncs[drawmode];
dst = &lcd_framebuffer[y>>3][x];
ny = height - 1 + (y & 7);