summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/hosted/agptek/lcd-agptek.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/firmware/target/hosted/agptek/lcd-agptek.c b/firmware/target/hosted/agptek/lcd-agptek.c
index 4b3148da03..9cd4daea5d 100644
--- a/firmware/target/hosted/agptek/lcd-agptek.c
+++ b/firmware/target/hosted/agptek/lcd-agptek.c
@@ -114,27 +114,33 @@ extern void lcd_copy_buffer_rect(fb_data *dst, const fb_data *src,
114 114
115void lcd_update(void) 115void lcd_update(void)
116{ 116{
117 /* Copy the Rockbox framebuffer to the second framebuffer */ 117 if (lcd_active())
118 lcd_copy_buffer_rect(LCD_FRAMEBUF_ADDR(0, 0), FBADDR(0,0), 118 {
119 LCD_WIDTH*LCD_HEIGHT, 1); 119 /* Copy the Rockbox framebuffer to the second framebuffer */
120 redraw(); 120 lcd_copy_buffer_rect(LCD_FRAMEBUF_ADDR(0, 0), FBADDR(0,0),
121 LCD_WIDTH*LCD_HEIGHT, 1);
122 redraw();
123 }
121} 124}
122 125
123void lcd_update_rect(int x, int y, int width, int height) 126void lcd_update_rect(int x, int y, int width, int height)
124{ 127{
125 fb_data *dst = LCD_FRAMEBUF_ADDR(x, y); 128 if (lcd_active())
126 fb_data * src = FBADDR(x,y);
127
128 /* Copy part of the Rockbox framebuffer to the second framebuffer */
129 if (width < LCD_WIDTH)
130 {
131 /* Not full width - do line-by-line */
132 lcd_copy_buffer_rect(dst, src, width, height);
133 }
134 else
135 { 129 {
136 /* Full width - copy as one line */ 130 fb_data *dst = LCD_FRAMEBUF_ADDR(x, y);
137 lcd_copy_buffer_rect(dst, src, LCD_WIDTH*height, 1); 131 fb_data * src = FBADDR(x,y);
132
133 /* Copy part of the Rockbox framebuffer to the second framebuffer */
134 if (width < LCD_WIDTH)
135 {
136 /* Not full width - do line-by-line */
137 lcd_copy_buffer_rect(dst, src, width, height);
138 }
139 else
140 {
141 /* Full width - copy as one line */
142 lcd_copy_buffer_rect(dst, src, LCD_WIDTH*height, 1);
143 }
144 redraw();
138 } 145 }
139 redraw();
140} 146}