summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-2bit-horz.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2009-05-30 23:35:44 +0000
committerJens Arnold <amiconn@rockbox.org>2009-05-30 23:35:44 +0000
commit72061047d1cbe2f9c8728d1cde302343bb8dd784 (patch)
tree548cd4fa407553680023940b59ef883377e5eac3 /firmware/drivers/lcd-2bit-horz.c
parent294ece8bd6189555b1a3164d216196d992982eab (diff)
downloadrockbox-72061047d1cbe2f9c8728d1cde302343bb8dd784.tar.gz
rockbox-72061047d1cbe2f9c8728d1cde302343bb8dd784.zip
Two tiny optimisations for mono bitmap drawing on greyscale displays: (1) H1x0, M5: Manipulate destination masks directly for the aligned case - ~0.7% speedup. (2) Greyscale ipods: Use sentinel method for reloading data like the 16 bit driver does - ~1.5% speedup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21139 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd-2bit-horz.c')
-rw-r--r--firmware/drivers/lcd-2bit-horz.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/firmware/drivers/lcd-2bit-horz.c b/firmware/drivers/lcd-2bit-horz.c
index a9a691cabd..4dc82deae0 100644
--- a/firmware/drivers/lcd-2bit-horz.c
+++ b/firmware/drivers/lcd-2bit-horz.c
@@ -732,9 +732,8 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
732 do 732 do
733 { 733 {
734 const unsigned char *src_col = src++; 734 const unsigned char *src_col = src++;
735 unsigned data = *src_col >> src_y; 735 unsigned data = (*src_col | 0x100) >> src_y; /* bit 8 == sentinel */
736 int numbits = 8 - ((int)src_y); 736
737
738 ymax = y + height; 737 ymax = y + height;
739 ny = y; 738 ny = y;
740 do 739 do
@@ -747,11 +746,10 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
747 ny++; 746 ny++;
748 747
749 data >>= 1; 748 data >>= 1;
750 if (--numbits == 0) 749 if (data == 0x001)
751 { 750 {
752 src_col += stride; 751 src_col += stride;
753 data = *src_col; 752 data = *src_col | 0x100;
754 numbits = 8;
755 } 753 }
756 } 754 }
757 while (ny < ymax); 755 while (ny < ymax);