diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-09-30 20:10:27 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-09-30 20:10:27 +0000 |
commit | 1a40e109333b8206140594fce746f7972a4d0d86 (patch) | |
tree | a4f0589682ae4f8c894222b7691efebd989d763f /firmware | |
parent | 8b9c64f19db3abf8872b8dd85ea8ee1343f322e3 (diff) |
H1x0: Changed lcd_blit() and the grayscale library to use the same internal format as on archos (1bpp). While the slowdown of the ISR is minimal (the intermediate buffers are in IRAM), the planar grayscale buffer takes only half the space for a given depth, and gray_update[_rect]() and unbuffered drawing/scrolling are faster because less data needs to be moved. It should also make porting of video.rock somewhat easier. * Archos recorders, Ondios: Some slight optimisations of the grayscale library.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7571 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/lcd-h100.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/firmware/drivers/lcd-h100.c b/firmware/drivers/lcd-h100.c index bfdceedc35..df08dde6fb 100644 --- a/firmware/drivers/lcd-h100.c +++ b/firmware/drivers/lcd-h100.c @@ -211,16 +211,41 @@ void lcd_init(void) void lcd_blit(const unsigned char* data, int x, int by, int width, int bheight, int stride) { - /* Copy display bitmap to hardware */ + const unsigned char *src, *src_end; + unsigned char *dst_u, *dst_l; + unsigned char upper[LCD_WIDTH]; + unsigned char lower[LCD_WIDTH]; + unsigned int byte; + + by *= 2; + while (bheight--) { + src = data; + src_end = data + width; + dst_u = upper; + dst_l = lower; + do + { + byte = *src++; + *dst_u++ = dibits[byte & 0x0F]; + byte >>= 4; + *dst_l++ = dibits[byte & 0x0F]; + } + while (src < src_end); + lcd_write_command_ex(LCD_CNTL_PAGE, by++, -1); lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1); + lcd_write_command(LCD_CNTL_DATA_WRITE); + lcd_write_data(upper, width); + lcd_write_command_ex(LCD_CNTL_PAGE, by++, -1); + lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1); lcd_write_command(LCD_CNTL_DATA_WRITE); - lcd_write_data(data, width); + lcd_write_data(lower, width); + data += stride; - } + } } |