summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/lcd-16bit-common.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/firmware/drivers/lcd-16bit-common.c b/firmware/drivers/lcd-16bit-common.c
index 5ec142c855..25e3b89dc3 100644
--- a/firmware/drivers/lcd-16bit-common.c
+++ b/firmware/drivers/lcd-16bit-common.c
@@ -330,6 +330,15 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
330 src_x -= x; 330 src_x -= x;
331 x = 0; 331 x = 0;
332 } 332 }
333
334 /* 'Bugfix' mono_bitmap_part reads ahead in the buffer,
335 * if the height is <= char bit pixels other memory gets read
336 * the other option is to check in the hot code path but this appears
337 * sufficient
338 */
339 if (height <= CHAR_BIT)
340 stride = 0;
341
333 if (y < 0) 342 if (y < 0)
334 { 343 {
335 height += y; 344 height += y;
@@ -341,13 +350,11 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
341 if (y + height > LCD_HEIGHT) 350 if (y + height > LCD_HEIGHT)
342 height = LCD_HEIGHT - y; 351 height = LCD_HEIGHT - y;
343#endif 352#endif
344
345 src += stride * (src_y >> 3) + src_x; /* move starting point */ 353 src += stride * (src_y >> 3) + src_x; /* move starting point */
346 src_y &= 7; 354 src_y &= 7;
347 src_end = src + width; 355 src_end = src + width;
348 dst_col = FBADDR(x, y); 356 dst_col = FBADDR(x, y);
349 357
350
351 if (drmode & DRMODE_INVERSEVID) 358 if (drmode & DRMODE_INVERSEVID)
352 { 359 {
353 dmask = 0x1ff; /* bit 8 == sentinel */ 360 dmask = 0x1ff; /* bit 8 == sentinel */
@@ -462,14 +469,7 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
462/* Draw a full monochrome bitmap */ 469/* Draw a full monochrome bitmap */
463void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width, int height) 470void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width, int height)
464{ 471{
465 int stride = width; 472 lcd_mono_bitmap_part(src, 0, 0, width, x, y, width, height);
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);
473} 473}
474 474
475 475