diff options
Diffstat (limited to 'firmware/drivers/lcd-16bit-common.c')
-rw-r--r-- | firmware/drivers/lcd-16bit-common.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/firmware/drivers/lcd-16bit-common.c b/firmware/drivers/lcd-16bit-common.c index dbfea50dd7..5ec142c855 100644 --- a/firmware/drivers/lcd-16bit-common.c +++ b/firmware/drivers/lcd-16bit-common.c | |||
@@ -341,18 +341,12 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x, | |||
341 | if (y + height > LCD_HEIGHT) | 341 | if (y + height > LCD_HEIGHT) |
342 | height = LCD_HEIGHT - y; | 342 | height = LCD_HEIGHT - y; |
343 | #endif | 343 | #endif |
344 | |||
344 | src += stride * (src_y >> 3) + src_x; /* move starting point */ | 345 | src += stride * (src_y >> 3) + src_x; /* move starting point */ |
345 | src_y &= 7; | 346 | src_y &= 7; |
346 | src_end = src + width; | 347 | src_end = src + width; |
347 | dst_col = FBADDR(x, y); | 348 | dst_col = FBADDR(x, y); |
348 | 349 | ||
349 | /* 'Bugfix' mono_bitmap_part reads ahead in the buffer, | ||
350 | * if the height is <= char bit pixels other memory gets read | ||
351 | * the other option is to check in the hot code path but this appears | ||
352 | * sufficient | ||
353 | */ | ||
354 | if (height <= CHAR_BIT) | ||
355 | stride = 0; | ||
356 | 350 | ||
357 | if (drmode & DRMODE_INVERSEVID) | 351 | if (drmode & DRMODE_INVERSEVID) |
358 | { | 352 | { |
@@ -468,7 +462,14 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x, | |||
468 | /* Draw a full monochrome bitmap */ | 462 | /* Draw a full monochrome bitmap */ |
469 | void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width, int height) | 463 | void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width, int height) |
470 | { | 464 | { |
471 | lcd_mono_bitmap_part(src, 0, 0, width, x, y, width, height); | 465 | int stride = width; |
466 | |||
467 | /* 'Bugfix' mono_bitmap_part reads ahead in the buffer, | ||
468 | * if the height is <= char bit pixels other memory gets read | ||
469 | */ | ||
470 | if (height <= CHAR_BIT) | ||
471 | stride = 0; | ||
472 | lcd_mono_bitmap_part(src, 0, 0, stride, x, y, width, height); | ||
472 | } | 473 | } |
473 | 474 | ||
474 | 475 | ||