diff options
author | Torne Wuff <torne@wolfpuppy.org.uk> | 2009-10-16 20:15:12 +0000 |
---|---|---|
committer | Torne Wuff <torne@wolfpuppy.org.uk> | 2009-10-16 20:15:12 +0000 |
commit | 27ece8c366b89fab05a47c342edc3edc18a6c5e3 (patch) | |
tree | 6731c6beeb67dfb6d10cb35322c41e859c48b6ea /apps/plugins/lib/xlcd_scroll.c | |
parent | a3f0a45c0f80b34310fffcce339d151365845c61 (diff) | |
download | rockbox-27ece8c366b89fab05a47c342edc3edc18a6c5e3.tar.gz rockbox-27ece8c366b89fab05a47c342edc3edc18a6c5e3.zip |
Pluginlib: make scroll functions clear screen if scrolled by >= screen size (from FS#10330)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23211 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lib/xlcd_scroll.c')
-rw-r--r-- | apps/plugins/lib/xlcd_scroll.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/apps/plugins/lib/xlcd_scroll.c b/apps/plugins/lib/xlcd_scroll.c index 96e0715894..f8eac1d4b9 100644 --- a/apps/plugins/lib/xlcd_scroll.c +++ b/apps/plugins/lib/xlcd_scroll.c | |||
@@ -37,7 +37,10 @@ void xlcd_scroll_left(int count) | |||
37 | int length, oldmode; | 37 | int length, oldmode; |
38 | 38 | ||
39 | if ((unsigned)count >= LCD_WIDTH) | 39 | if ((unsigned)count >= LCD_WIDTH) |
40 | { | ||
41 | rb->lcd_clear_display(); | ||
40 | return; | 42 | return; |
43 | } | ||
41 | 44 | ||
42 | length = (LCD_WIDTH-count)*LCD_FBHEIGHT; | 45 | length = (LCD_WIDTH-count)*LCD_FBHEIGHT; |
43 | 46 | ||
@@ -56,7 +59,10 @@ void xlcd_scroll_right(int count) | |||
56 | int length, oldmode; | 59 | int length, oldmode; |
57 | 60 | ||
58 | if ((unsigned)count >= LCD_WIDTH) | 61 | if ((unsigned)count >= LCD_WIDTH) |
62 | { | ||
63 | rb->lcd_clear_display(); | ||
59 | return; | 64 | return; |
65 | } | ||
60 | 66 | ||
61 | length = (LCD_WIDTH-count)*LCD_FBHEIGHT; | 67 | length = (LCD_WIDTH-count)*LCD_FBHEIGHT; |
62 | 68 | ||
@@ -77,7 +83,10 @@ void xlcd_scroll_up(int count) | |||
77 | fb_data *data; | 83 | fb_data *data; |
78 | 84 | ||
79 | if ((unsigned)count >= LCD_HEIGHT) | 85 | if ((unsigned)count >= LCD_HEIGHT) |
86 | { | ||
87 | rb->lcd_clear_display(); | ||
80 | return; | 88 | return; |
89 | } | ||
81 | 90 | ||
82 | length = LCD_HEIGHT - count; | 91 | length = LCD_HEIGHT - count; |
83 | 92 | ||
@@ -103,7 +112,10 @@ void xlcd_scroll_down(int count) | |||
103 | fb_data *data; | 112 | fb_data *data; |
104 | 113 | ||
105 | if ((unsigned)count >= LCD_HEIGHT) | 114 | if ((unsigned)count >= LCD_HEIGHT) |
115 | { | ||
116 | rb->lcd_clear_display(); | ||
106 | return; | 117 | return; |
118 | } | ||
107 | 119 | ||
108 | length = LCD_HEIGHT - count; | 120 | length = LCD_HEIGHT - count; |
109 | 121 | ||
@@ -131,7 +143,10 @@ void xlcd_scroll_left(int count) | |||
131 | int blockcount, blocklen; | 143 | int blockcount, blocklen; |
132 | 144 | ||
133 | if ((unsigned) count >= LCD_WIDTH) | 145 | if ((unsigned) count >= LCD_WIDTH) |
146 | { | ||
147 | rb->lcd_clear_display(); | ||
134 | return; | 148 | return; |
149 | } | ||
135 | 150 | ||
136 | #if LCD_DEPTH == 2 | 151 | #if LCD_DEPTH == 2 |
137 | blockcount = count >> 2; | 152 | blockcount = count >> 2; |
@@ -186,7 +201,10 @@ void xlcd_scroll_right(int count) | |||
186 | int blockcount, blocklen; | 201 | int blockcount, blocklen; |
187 | 202 | ||
188 | if ((unsigned) count >= LCD_WIDTH) | 203 | if ((unsigned) count >= LCD_WIDTH) |
204 | { | ||
205 | rb->lcd_clear_display(); | ||
189 | return; | 206 | return; |
207 | } | ||
190 | 208 | ||
191 | #if LCD_DEPTH == 2 | 209 | #if LCD_DEPTH == 2 |
192 | blockcount = count >> 2; | 210 | blockcount = count >> 2; |
@@ -243,7 +261,10 @@ void xlcd_scroll_left(int count) | |||
243 | int length, oldmode; | 261 | int length, oldmode; |
244 | 262 | ||
245 | if ((unsigned)count >= LCD_WIDTH) | 263 | if ((unsigned)count >= LCD_WIDTH) |
264 | { | ||
265 | rb->lcd_clear_display(); | ||
246 | return; | 266 | return; |
267 | } | ||
247 | 268 | ||
248 | data = rb->lcd_framebuffer; | 269 | data = rb->lcd_framebuffer; |
249 | data_end = data + LCD_WIDTH*LCD_FBHEIGHT; | 270 | data_end = data + LCD_WIDTH*LCD_FBHEIGHT; |
@@ -269,7 +290,10 @@ void xlcd_scroll_right(int count) | |||
269 | int length, oldmode; | 290 | int length, oldmode; |
270 | 291 | ||
271 | if ((unsigned)count >= LCD_WIDTH) | 292 | if ((unsigned)count >= LCD_WIDTH) |
293 | { | ||
294 | rb->lcd_clear_display(); | ||
272 | return; | 295 | return; |
296 | } | ||
273 | 297 | ||
274 | data = rb->lcd_framebuffer; | 298 | data = rb->lcd_framebuffer; |
275 | data_end = data + LCD_WIDTH*LCD_FBHEIGHT; | 299 | data_end = data + LCD_WIDTH*LCD_FBHEIGHT; |
@@ -298,7 +322,10 @@ void xlcd_scroll_up(int count) | |||
298 | int length, oldmode; | 322 | int length, oldmode; |
299 | 323 | ||
300 | if ((unsigned)count >= LCD_HEIGHT) | 324 | if ((unsigned)count >= LCD_HEIGHT) |
325 | { | ||
326 | rb->lcd_clear_display(); | ||
301 | return; | 327 | return; |
328 | } | ||
302 | 329 | ||
303 | length = LCD_HEIGHT - count; | 330 | length = LCD_HEIGHT - count; |
304 | 331 | ||
@@ -318,7 +345,10 @@ void xlcd_scroll_down(int count) | |||
318 | int length, oldmode; | 345 | int length, oldmode; |
319 | 346 | ||
320 | if ((unsigned)count >= LCD_HEIGHT) | 347 | if ((unsigned)count >= LCD_HEIGHT) |
348 | { | ||
349 | rb->lcd_clear_display(); | ||
321 | return; | 350 | return; |
351 | } | ||
322 | 352 | ||
323 | length = LCD_HEIGHT - count; | 353 | length = LCD_HEIGHT - count; |
324 | 354 | ||
@@ -342,7 +372,10 @@ void xlcd_scroll_up(int count) | |||
342 | int blockcount, blocklen; | 372 | int blockcount, blocklen; |
343 | 373 | ||
344 | if ((unsigned) count >= LCD_HEIGHT) | 374 | if ((unsigned) count >= LCD_HEIGHT) |
375 | { | ||
376 | rb->lcd_clear_display(); | ||
345 | return; | 377 | return; |
378 | } | ||
346 | 379 | ||
347 | #if (LCD_DEPTH == 1) \ | 380 | #if (LCD_DEPTH == 1) \ |
348 | || (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) | 381 | || (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) |
@@ -536,7 +569,10 @@ void xlcd_scroll_down(int count) | |||
536 | int blockcount, blocklen; | 569 | int blockcount, blocklen; |
537 | 570 | ||
538 | if ((unsigned) count >= LCD_HEIGHT) | 571 | if ((unsigned) count >= LCD_HEIGHT) |
572 | { | ||
573 | rb->lcd_clear_display(); | ||
539 | return; | 574 | return; |
575 | } | ||
540 | 576 | ||
541 | #if (LCD_DEPTH == 1) \ | 577 | #if (LCD_DEPTH == 1) \ |
542 | || (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) | 578 | || (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) |