summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <me.theuser@yahoo.com>2021-08-25 13:04:22 +0000
committerWilliam Wilgus <me.theuser@yahoo.com>2021-08-25 13:05:02 +0000
commitdbd051394e530d403573d5a34c737371039c81f3 (patch)
tree90cb5f55163f3b5b9faf801568ad9e0c747a6825
parent97b0e5b5a167caa0eedd01c2acbed0916ee696ba (diff)
downloadrockbox-dbd051394e.tar.gz
rockbox-dbd051394e.zip
Revert "lcd_putsxyofs 16 bit lcd_mono_bitmap_part [AS]"
This reverts commit 49edfc237ba9ae27eee5e915e86989d9ee01b1da. Reason for revert: font rendering bug, https://gist.github.com/amachronic/5fa75da280432127de4b44ee2d760281 Change-Id: I13b5f0eedb2926bce67051c8f0bb2ae5dea9f299
-rw-r--r--firmware/drivers/lcd-16bit-common.c17
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,
if (y + height > LCD_HEIGHT)
height = LCD_HEIGHT - y;
#endif
+
src += stride * (src_y >> 3) + src_x; /* move starting point */
src_y &= 7;
src_end = src + width;
dst_col = FBADDR(x, y);
- /* 'Bugfix' mono_bitmap_part reads ahead in the buffer,
- * if the height is <= char bit pixels other memory gets read
- * the other option is to check in the hot code path but this appears
- * sufficient
- */
- if (height <= CHAR_BIT)
- stride = 0;
if (drmode & DRMODE_INVERSEVID)
{
@@ -468,7 +462,14 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
/* Draw a full monochrome bitmap */
void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width, int height)
{
- lcd_mono_bitmap_part(src, 0, 0, width, x, y, width, height);
+ int stride = width;
+
+ /* 'Bugfix' mono_bitmap_part reads ahead in the buffer,
+ * if the height is <= char bit pixels other memory gets read
+ */
+ if (height <= CHAR_BIT)
+ stride = 0;
+ lcd_mono_bitmap_part(src, 0, 0, stride, x, y, width, height);
}