summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-08-09 12:20:54 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-08-09 12:20:54 +0000
commit6985f34bebc38585a1c57c6be29d27957655a09b (patch)
treea375cf4df9b5bc437676e15c7590b2267b1e79bc /firmware/drivers/lcd.c
parent9bf86f75fac571e79e9fd85632704e43fb026ae1 (diff)
downloadrockbox-6985f34bebc38585a1c57c6be29d27957655a09b.tar.gz
rockbox-6985f34bebc38585a1c57c6be29d27957655a09b.zip
Added lcd_update_rect(), for updating only a part of the LCD. This was
written "blindly". I've not tested this on hardware (yet). The simulators will need to get this funtion added as well. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1643 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd.c')
-rw-r--r--firmware/drivers/lcd.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/firmware/drivers/lcd.c b/firmware/drivers/lcd.c
index fe1e13a522..056aca0769 100644
--- a/firmware/drivers/lcd.c
+++ b/firmware/drivers/lcd.c
@@ -594,6 +594,40 @@ void lcd_update (void)
594 } 594 }
595} 595}
596 596
597/*
598 * Update a fraction of the display.
599 */
600void lcd_update_rect (int, int, int, int) __attribute__ ((section (".icode")));
601void lcd_update_rect (int x_start, int y,
602 int width, int height)
603{
604 int ymax;
605 int xmax;
606 int x;
607
608 /* The Y coordinates have to work on even 8 pixel rows */
609 ymax = (y + height)/8;
610 y /= 8;
611
612 xmax = x_start + width;
613
614 if(xmax > LCD_WIDTH)
615 xmax = LCD_WIDTH;
616 if(ymax >= LCD_HEIGHT/8)
617 ymax = LCD_HEIGHT/8-1;
618
619 /* Copy specified rectange bitmap to hardware */
620 for (; y <= ymax; y++)
621 {
622 lcd_write (true, LCD_CNTL_PAGE | (y & 0xf));
623 lcd_write (true, LCD_CNTL_HIGHCOL | ((x_start>>4) & 0xf));
624 lcd_write (true, LCD_CNTL_LOWCOL | (x_start & 0xf));
625
626 for (x = x_start; x < xmax; x++)
627 lcd_write (false, lcd_framebuffer[x][y]);
628 }
629}
630
597#endif /* SIMULATOR */ 631#endif /* SIMULATOR */
598 632
599/* 633/*