summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-09-30 20:10:27 +0000
committerJens Arnold <amiconn@rockbox.org>2005-09-30 20:10:27 +0000
commit1a40e109333b8206140594fce746f7972a4d0d86 (patch)
treea4f0589682ae4f8c894222b7691efebd989d763f /firmware/drivers
parent8b9c64f19db3abf8872b8dd85ea8ee1343f322e3 (diff)
downloadrockbox-1a40e109333b8206140594fce746f7972a4d0d86.tar.gz
rockbox-1a40e109333b8206140594fce746f7972a4d0d86.zip
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/drivers')
-rw-r--r--firmware/drivers/lcd-h100.c31
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)
211void lcd_blit(const unsigned char* data, int x, int by, int width, 211void lcd_blit(const unsigned char* data, int x, int by, int width,
212 int bheight, int stride) 212 int bheight, int stride)
213{ 213{
214 /* Copy display bitmap to hardware */ 214 const unsigned char *src, *src_end;
215 unsigned char *dst_u, *dst_l;
216 unsigned char upper[LCD_WIDTH];
217 unsigned char lower[LCD_WIDTH];
218 unsigned int byte;
219
220 by *= 2;
221
215 while (bheight--) 222 while (bheight--)
216 { 223 {
224 src = data;
225 src_end = data + width;
226 dst_u = upper;
227 dst_l = lower;
228 do
229 {
230 byte = *src++;
231 *dst_u++ = dibits[byte & 0x0F];
232 byte >>= 4;
233 *dst_l++ = dibits[byte & 0x0F];
234 }
235 while (src < src_end);
236
217 lcd_write_command_ex(LCD_CNTL_PAGE, by++, -1); 237 lcd_write_command_ex(LCD_CNTL_PAGE, by++, -1);
218 lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1); 238 lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1);
239 lcd_write_command(LCD_CNTL_DATA_WRITE);
240 lcd_write_data(upper, width);
219 241
242 lcd_write_command_ex(LCD_CNTL_PAGE, by++, -1);
243 lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1);
220 lcd_write_command(LCD_CNTL_DATA_WRITE); 244 lcd_write_command(LCD_CNTL_DATA_WRITE);
221 lcd_write_data(data, width); 245 lcd_write_data(lower, width);
246
222 data += stride; 247 data += stride;
223 } 248 }
224} 249}
225 250
226 251