summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/lcd.c34
-rw-r--r--firmware/drivers/lcd.h5
2 files changed, 38 insertions, 1 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/*
diff --git a/firmware/drivers/lcd.h b/firmware/drivers/lcd.h
index 23e333287b..a2d392cbd5 100644
--- a/firmware/drivers/lcd.h
+++ b/firmware/drivers/lcd.h
@@ -35,7 +35,10 @@ extern void lcd_stop_scroll(void);
35extern void lcd_scroll_speed( int speed ); 35extern void lcd_scroll_speed( int speed );
36 36
37#if defined(SIMULATOR) || defined(HAVE_LCD_BITMAP) 37#if defined(SIMULATOR) || defined(HAVE_LCD_BITMAP)
38 extern void lcd_update(void); 38extern void lcd_update(void);
39
40/* update a fraction of the screen */
41extern void lcd_update_rect(int x, int y, int width, int height);
39#else 42#else
40 #define lcd_update() 43 #define lcd_update()
41#endif 44#endif