summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorFelix Arends <edx@rockbox.org>2002-05-01 16:08:21 +0000
committerFelix Arends <edx@rockbox.org>2002-05-01 16:08:21 +0000
commitfa16227b254f9b7595825bf61d90abea13b1dcae (patch)
tree7cba3c57ba940e54d89d8cce08c1511a7993046c /firmware/drivers
parentf707565e558f3d810b795300740d45a0408ed31c (diff)
fixed lcd_bitmap code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@373 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/lcd.c73
1 files changed, 32 insertions, 41 deletions
diff --git a/firmware/drivers/lcd.c b/firmware/drivers/lcd.c
index 8a6207bc87..80e46adbdf 100644
--- a/firmware/drivers/lcd.c
+++ b/firmware/drivers/lcd.c
@@ -488,55 +488,46 @@ void lcd_bitmap (unsigned char *src, int x, int y, int nx, int ny,
bool clear)
{
unsigned char *dst;
- unsigned char *dst2 = &display[x][y/8];
+ unsigned char *dst2;
unsigned int data, mask, mask2, mask3, mask4;
- int shift = y & 7;
+ int shift;
+ int nny, _nnx = x, _nny = y;
- ny += shift;
-
- /* Calculate bit masks */
- mask4 = ~(0xfe << ((ny-1) & 7));
- if (clear)
+ for (nny = ny; nny > 0; nny -= 8, _nny += 8)
{
- mask = ~(0xff << shift);
- mask2 = 0;
- mask3 = ~mask4;
- if (ny <= 8)
- mask3 |= mask;
- }
- else
- mask = mask2 = mask3 = 0xff;
+ x = _nnx; y = _nny; ny = 8;
- /* Loop for each column */
- for (x = 0; x < nx; x++)
- {
- dst = dst2;
- dst2 += LCD_HEIGHT/8;
- data = 0;
- y = 0;
+ dst2 = &display[x][y/8];
+ shift = y & 7;
+
+ ny += shift;
- if (ny > 8)
+ /* Calculate bit masks */
+ mask4 = ~(0xfe << ((ny-1) & 7));
+ if (clear)
{
- /* First partial row */
- data = *src++ << shift;
- *dst = (*dst & mask) ^ data;
- data >>= 8;
- dst++;
-
- /* Intermediate rows */
- for (y = 8; y < ny-8; y += 8)
- {
- data |= *src++ << shift;
- *dst = (*dst & mask2) ^ data;
- data >>= 8;
- dst++;
- }
+ mask = ~(0xff << shift);
+ mask2 = 0;
+ mask3 = ~mask4;
+ if (ny <= 8)
+ mask3 |= mask;
}
+ else
+ mask = mask2 = mask3 = 0xff;
+
+ /* Loop for each column */
+ for (x = 0; x < nx; x++)
+ {
+ dst = dst2;
+ dst2 += LCD_HEIGHT/8;
+ data = 0;
+ y = 0;
- /* Last partial row */
- if (y + shift < ny)
- data |= *src++ << shift;
- *dst = (*dst & mask3) ^ (data & mask4);
+ /* Last partial row */
+ if (y + shift < ny)
+ data |= *src++ << shift;
+ *dst = (*dst & mask3) ^ (data & mask4);
+ }
}
}