summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2013-04-03 16:33:23 +0200
committerThomas Martitz <kugel@rockbox.org>2013-12-14 23:11:30 +0100
commit1c5d0b41eebdb4f8c627b1a0e5f7b699f0b08fb8 (patch)
tree3ec44a4e6cfe4bfaab689e765ef3546d8dac730d
parent47c8d3c14d8fdaf4749ef5e0380fb0c52140b5fb (diff)
downloadrockbox-1c5d0b41eebdb4f8c627b1a0e5f7b699f0b08fb8.tar.gz
rockbox-1c5d0b41eebdb4f8c627b1a0e5f7b699f0b08fb8.zip
scroll_engine: Rename scroll_stop* functions to be more consistent with the lcd api.
Change-Id: I8ada10b96bfb628cca0331689e8b936ae47c7e1c
-rw-r--r--apps/debug_menu.c2
-rw-r--r--apps/gui/bitmap/list-skinned.c4
-rw-r--r--apps/gui/bitmap/list.c10
-rw-r--r--apps/gui/charcell/list.c2
-rw-r--r--apps/gui/quickscreen.c4
-rw-r--r--apps/gui/skin_engine/skin_render.c5
-rw-r--r--apps/gui/splash.c2
-rw-r--r--apps/gui/usb_screen.c4
-rw-r--r--apps/gui/viewport.c2
-rw-r--r--apps/gui/wps.c6
-rw-r--r--apps/gui/yesno.c4
-rw-r--r--apps/plugin.c4
-rw-r--r--apps/plugin.h5
-rw-r--r--apps/plugins/boomshine.lua2
-rw-r--r--apps/plugins/chessclock.c2
-rw-r--r--apps/plugins/lrcplayer.c2
-rw-r--r--apps/plugins/resistor.c6
-rw-r--r--apps/plugins/splitedit.c2
-rw-r--r--apps/plugins/superdom.c2
-rw-r--r--apps/radio/radio_skin.c2
-rw-r--r--apps/screen_access.c8
-rw-r--r--apps/screen_access.h6
-rw-r--r--apps/screens.c4
-rw-r--r--apps/settings.c1
-rw-r--r--apps/settings_list.c1
-rw-r--r--firmware/drivers/lcd-16bit-common.c8
-rw-r--r--firmware/drivers/lcd-1bit-vert.c2
-rw-r--r--firmware/drivers/lcd-bitmap-common.c10
-rw-r--r--firmware/drivers/lcd-charcell.c6
-rw-r--r--firmware/export/lcd-remote.h3
-rw-r--r--firmware/export/lcd.h4
-rw-r--r--firmware/export/scroll_engine.h24
-rw-r--r--firmware/rolo.c2
-rw-r--r--firmware/scroll_engine.c36
34 files changed, 100 insertions, 87 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 2f50a43825..6f7de6d54e 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -2084,7 +2084,7 @@ static bool cpu_boost_log(void)
2084 } 2084 }
2085 } 2085 }
2086 } 2086 }
2087 lcd_stop_scroll(); 2087 lcd_scroll_stop();
2088 get_action(CONTEXT_STD,TIMEOUT_BLOCK); 2088 get_action(CONTEXT_STD,TIMEOUT_BLOCK);
2089 lcd_setfont(FONT_UI); 2089 lcd_setfont(FONT_UI);
2090 return false; 2090 return false;
diff --git a/apps/gui/bitmap/list-skinned.c b/apps/gui/bitmap/list-skinned.c
index d0803b5dc8..d6b868ae26 100644
--- a/apps/gui/bitmap/list-skinned.c
+++ b/apps/gui/bitmap/list-skinned.c
@@ -54,7 +54,7 @@ void skinlist_set_cfg(enum screen_type screen,
54 if (listcfg[screen] != cfg) 54 if (listcfg[screen] != cfg)
55 { 55 {
56 if (listcfg[screen]) 56 if (listcfg[screen])
57 screens[screen].scroll_stop(&listcfg[screen]->selected_item_vp.vp); 57 screens[screen].scroll_stop_viewport(&listcfg[screen]->selected_item_vp.vp);
58 listcfg[screen] = cfg; 58 listcfg[screen] = cfg;
59 current_list = NULL; 59 current_list = NULL;
60 current_column = -1; 60 current_column = -1;
@@ -269,7 +269,7 @@ bool skinlist_draw(struct screen *display, struct gui_synclist *list)
269 /* force disableing scroll because it breaks later */ 269 /* force disableing scroll because it breaks later */
270 if (!is_selected) 270 if (!is_selected)
271 { 271 {
272 display->scroll_stop(&skin_viewport->vp); 272 display->scroll_stop_viewport(&skin_viewport->vp);
273 skin_viewport->vp.x = original_x; 273 skin_viewport->vp.x = original_x;
274 skin_viewport->vp.y = original_y; 274 skin_viewport->vp.y = original_y;
275 } 275 }
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
index 191446e186..79eec60b26 100644
--- a/apps/gui/bitmap/list.c
+++ b/apps/gui/bitmap/list.c
@@ -61,9 +61,9 @@ void gui_synclist_scroll_stop(struct gui_synclist *lists)
61{ 61{
62 FOR_NB_SCREENS(i) 62 FOR_NB_SCREENS(i)
63 { 63 {
64 screens[i].scroll_stop(&list_text[i]); 64 screens[i].scroll_stop_viewport(&list_text[i]);
65 screens[i].scroll_stop(&title_text[i]); 65 screens[i].scroll_stop_viewport(&title_text[i]);
66 screens[i].scroll_stop(lists->parent[i]); 66 screens[i].scroll_stop_viewport(lists->parent[i]);
67 } 67 }
68} 68}
69 69
@@ -100,7 +100,7 @@ static bool draw_title(struct screen *display, struct gui_synclist *list)
100 100
101 if (sb_set_title_text(list->title, list->title_icon, screen)) 101 if (sb_set_title_text(list->title, list->title_icon, screen))
102 return false; /* the sbs is handling the title */ 102 return false; /* the sbs is handling the title */
103 display->scroll_stop(title_text_vp); 103 display->scroll_stop_viewport(title_text_vp);
104 if (!list_display_title(list, screen)) 104 if (!list_display_title(list, screen))
105 return false; 105 return false;
106 *title_text_vp = *(list->parent[screen]); 106 *title_text_vp = *(list->parent[screen]);
@@ -160,7 +160,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
160 line_height = parent->line_height; 160 line_height = parent->line_height;
161 display->set_viewport(parent); 161 display->set_viewport(parent);
162 display->clear_viewport(); 162 display->clear_viewport();
163 display->scroll_stop(list_text_vp); 163 display->scroll_stop_viewport(list_text_vp);
164 *list_text_vp = *parent; 164 *list_text_vp = *parent;
165 list_text_vp->line_height = line_height; 165 list_text_vp->line_height = line_height;
166 if ((show_title = draw_title(display, list))) 166 if ((show_title = draw_title(display, list)))
diff --git a/apps/gui/charcell/list.c b/apps/gui/charcell/list.c
index 3d7f876adc..753b8ff853 100644
--- a/apps/gui/charcell/list.c
+++ b/apps/gui/charcell/list.c
@@ -43,7 +43,7 @@ void gui_synclist_scroll_stop(struct gui_synclist *lists)
43 (void)lists; 43 (void)lists;
44 FOR_NB_SCREENS(i) 44 FOR_NB_SCREENS(i)
45 { 45 {
46 screens[i].stop_scroll(); 46 screens[i].scroll_stop();
47 } 47 }
48} 48}
49 49
diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c
index 5c8a7705ae..64d938d8aa 100644
--- a/apps/gui/quickscreen.c
+++ b/apps/gui/quickscreen.c
@@ -323,7 +323,7 @@ static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_ente
323 FOR_NB_SCREENS(i) 323 FOR_NB_SCREENS(i)
324 { 324 {
325 screens[i].set_viewport(NULL); 325 screens[i].set_viewport(NULL);
326 screens[i].stop_scroll(); 326 screens[i].scroll_stop();
327 viewportmanager_theme_enable(i, true, &parent[i]); 327 viewportmanager_theme_enable(i, true, &parent[i]);
328 quickscreen_fix_viewports(qs, &screens[i], &parent[i], vps[i], &vp_icons[i]); 328 quickscreen_fix_viewports(qs, &screens[i], &parent[i], vps[i], &vp_icons[i]);
329 gui_quickscreen_draw(qs, &screens[i], &parent[i], vps[i], &vp_icons[i]); 329 gui_quickscreen_draw(qs, &screens[i], &parent[i], vps[i], &vp_icons[i]);
@@ -368,7 +368,7 @@ static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_ente
368 FOR_NB_SCREENS(i) 368 FOR_NB_SCREENS(i)
369 { /* stop scrolling before exiting */ 369 { /* stop scrolling before exiting */
370 for (int j = 0; j < QUICKSCREEN_ITEM_COUNT; j++) 370 for (int j = 0; j < QUICKSCREEN_ITEM_COUNT; j++)
371 screens[i].scroll_stop(&vps[i][j]); 371 screens[i].scroll_stop_viewport(&vps[i][j]);
372 viewportmanager_theme_undo(i, true); 372 viewportmanager_theme_undo(i, true);
373 } 373 }
374 374
diff --git a/apps/gui/skin_engine/skin_render.c b/apps/gui/skin_engine/skin_render.c
index d9424b993d..67f1f0f448 100644
--- a/apps/gui/skin_engine/skin_render.c
+++ b/apps/gui/skin_engine/skin_render.c
@@ -427,7 +427,6 @@ static void do_tags_in_hidden_conditional(struct skin_element* branch,
427#endif 427#endif
428 gwps->display->set_viewport(&skin_viewport->vp); 428 gwps->display->set_viewport(&skin_viewport->vp);
429 gwps->display->clear_viewport(); 429 gwps->display->clear_viewport();
430 gwps->display->scroll_stop(&skin_viewport->vp);
431 gwps->display->set_viewport(&info->skin_vp->vp); 430 gwps->display->set_viewport(&info->skin_vp->vp);
432 skin_viewport->hidden_flags |= VP_DRAW_HIDDEN; 431 skin_viewport->hidden_flags |= VP_DRAW_HIDDEN;
433 432
@@ -780,7 +779,7 @@ void skin_render_viewport(struct skin_element* viewport, struct gui_wps *gwps,
780 if (refresh_type && needs_update) 779 if (refresh_type && needs_update)
781 { 780 {
782 if (info.force_redraw) 781 if (info.force_redraw)
783 display->scroll_stop_line(&skin_viewport->vp, info.line_number); 782 display->scroll_stop_viewport_line(&skin_viewport->vp, info.line_number);
784 write_line(display, align, info.line_number, 783 write_line(display, align, info.line_number,
785 info.line_scrolls, info.text_style); 784 info.line_scrolls, info.text_style);
786 } 785 }
@@ -969,7 +968,7 @@ void skin_render_playlistviewer(struct playlistviewer* viewer,
969 if (refresh_type && needs_update) 968 if (refresh_type && needs_update)
970 { 969 {
971 if (!info.force_redraw) 970 if (!info.force_redraw)
972 display->scroll_stop_line(&skin_viewport->vp, info.line_number); 971 display->scroll_stop_viewport_line(&skin_viewport->vp, info.line_number);
973 write_line(display, align, info.line_number, 972 write_line(display, align, info.line_number,
974 info.line_scrolls, info.text_style); 973 info.line_scrolls, info.text_style);
975 } 974 }
diff --git a/apps/gui/splash.c b/apps/gui/splash.c
index ad6625fec6..2608a2e02e 100644
--- a/apps/gui/splash.c
+++ b/apps/gui/splash.c
@@ -133,7 +133,7 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap)
133 * First boundaries, then the grey filling, then the black border and finally 133 * First boundaries, then the grey filling, then the black border and finally
134 * the text*/ 134 * the text*/
135 135
136 screen->stop_scroll(); 136 screen->scroll_stop();
137 137
138#ifdef HAVE_LCD_BITMAP 138#ifdef HAVE_LCD_BITMAP
139 139
diff --git a/apps/gui/usb_screen.c b/apps/gui/usb_screen.c
index a02516fefb..e5bc12960e 100644
--- a/apps/gui/usb_screen.c
+++ b/apps/gui/usb_screen.c
@@ -156,7 +156,7 @@ static void usb_screen_fix_viewports(struct screen *screen,
156 disable = (parent->width < logo_width || parent->height < logo_height); 156 disable = (parent->width < logo_width || parent->height < logo_height);
157 viewportmanager_theme_enable(screen->screen_type, !disable, parent); 157 viewportmanager_theme_enable(screen->screen_type, !disable, parent);
158 screen->clear_display(); 158 screen->clear_display();
159 screen->stop_scroll(); 159 screen->scroll_stop();
160 160
161 *logo = *parent; 161 *logo = *parent;
162 logo->x = parent->x + parent->width - logo_width; 162 logo->x = parent->x + parent->width - logo_width;
@@ -308,7 +308,7 @@ void gui_usb_screen_run(bool early_usb)
308 vp = &usb_screen_vps_ar[i].parent; 308 vp = &usb_screen_vps_ar[i].parent;
309#endif 309#endif
310 if (vp) 310 if (vp)
311 screens[i].scroll_stop(vp); 311 screens[i].scroll_stop_viewport(vp);
312 } 312 }
313#ifdef USB_ENABLE_HID 313#ifdef USB_ENABLE_HID
314 if (global_settings.usb_keypad_mode != usb_keypad_mode) 314 if (global_settings.usb_keypad_mode != usb_keypad_mode)
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index 760e13cff7..0b5441e02b 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -178,7 +178,7 @@ static void toggle_theme(enum screen_type screen, bool force)
178#if LCD_DEPTH > 1 || (defined(LCD_REMOTE_DEPTH) && LCD_REMOTE_DEPTH > 1) 178#if LCD_DEPTH > 1 || (defined(LCD_REMOTE_DEPTH) && LCD_REMOTE_DEPTH > 1)
179 screens[screen].backdrop_show(NULL); 179 screens[screen].backdrop_show(NULL);
180#endif 180#endif
181 screens[screen].stop_scroll(); 181 screens[screen].scroll_stop();
182 skinlist_set_cfg(screen, NULL); 182 skinlist_set_cfg(screen, NULL);
183 } 183 }
184 /* let list initialize viewport in case viewport dimensions is changed. */ 184 /* let list initialize viewport in case viewport dimensions is changed. */
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 726df6add4..b4c3f40e9f 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -358,7 +358,7 @@ bool ffwd_rew(int button)
358#endif 358#endif
359#if CONFIG_KEYPAD == PLAYER_PAD 359#if CONFIG_KEYPAD == PLAYER_PAD
360 FOR_NB_SCREENS(i) 360 FOR_NB_SCREENS(i)
361 skin_get_gwps(WPS, i)->display->stop_scroll(); 361 skin_get_gwps(WPS, i)->display->scroll_stop();
362#endif 362#endif
363 if (direction > 0) 363 if (direction > 0)
364 status_set_ffmode(STATUS_FASTFORWARD); 364 status_set_ffmode(STATUS_FASTFORWARD);
@@ -639,7 +639,7 @@ static void gwps_leave_wps(void)
639{ 639{
640 FOR_NB_SCREENS(i) 640 FOR_NB_SCREENS(i)
641 { 641 {
642 skin_get_gwps(WPS, i)->display->stop_scroll(); 642 skin_get_gwps(WPS, i)->display->scroll_stop();
643#ifdef HAVE_BACKDROP_IMAGE 643#ifdef HAVE_BACKDROP_IMAGE
644 skin_backdrop_show(sb_get_backdrop(i)); 644 skin_backdrop_show(sb_get_backdrop(i));
645#endif 645#endif
@@ -668,7 +668,7 @@ static void gwps_enter_wps(void)
668 { 668 {
669 gwps = skin_get_gwps(WPS, i); 669 gwps = skin_get_gwps(WPS, i);
670 display = gwps->display; 670 display = gwps->display;
671 display->stop_scroll(); 671 display->scroll_stop();
672 viewportmanager_theme_enable(i, skin_has_sbs(i, skin_get_gwps(WPS, i)->data), NULL); 672 viewportmanager_theme_enable(i, skin_has_sbs(i, skin_get_gwps(WPS, i)->data), NULL);
673 673
674 /* Update the values in the first (default) viewport - in case the user 674 /* Update the values in the first (default) viewport - in case the user
diff --git a/apps/gui/yesno.c b/apps/gui/yesno.c
index 74e3ad05a7..b754d5e477 100644
--- a/apps/gui/yesno.c
+++ b/apps/gui/yesno.c
@@ -166,7 +166,7 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message,
166#else 166#else
167 viewportmanager_theme_enable(i, true, yn[i].vp); 167 viewportmanager_theme_enable(i, true, yn[i].vp);
168#endif 168#endif
169 screens[i].stop_scroll(); 169 screens[i].scroll_stop();
170 gui_yesno_draw(&(yn[i])); 170 gui_yesno_draw(&(yn[i]));
171 } 171 }
172 172
@@ -231,7 +231,7 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message,
231 231
232 FOR_NB_SCREENS(i) 232 FOR_NB_SCREENS(i)
233 { 233 {
234 screens[i].scroll_stop(yn[i].vp); 234 screens[i].scroll_stop_viewport(yn[i].vp);
235 viewportmanager_theme_undo(i, true); 235 viewportmanager_theme_undo(i, true);
236 } 236 }
237 237
diff --git a/apps/plugin.c b/apps/plugin.c
index 658064c53e..62f9dd7558 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -143,7 +143,7 @@ static const struct plugin_api rockbox_api = {
143 lcd_puts, 143 lcd_puts,
144 lcd_putsf, 144 lcd_putsf,
145 lcd_puts_scroll, 145 lcd_puts_scroll,
146 lcd_stop_scroll, 146 lcd_scroll_stop,
147#ifdef HAVE_LCD_CHARCELLS 147#ifdef HAVE_LCD_CHARCELLS
148 lcd_define_pattern, 148 lcd_define_pattern,
149 lcd_get_locked_pattern, 149 lcd_get_locked_pattern,
@@ -246,7 +246,7 @@ static const struct plugin_api rockbox_api = {
246 lcd_remote_clear_display, 246 lcd_remote_clear_display,
247 lcd_remote_puts, 247 lcd_remote_puts,
248 lcd_remote_puts_scroll, 248 lcd_remote_puts_scroll,
249 lcd_remote_stop_scroll, 249 lcd_remote_scroll_stop,
250 lcd_remote_set_drawmode, 250 lcd_remote_set_drawmode,
251 lcd_remote_get_drawmode, 251 lcd_remote_get_drawmode,
252 lcd_remote_setfont, 252 lcd_remote_setfont,
diff --git a/apps/plugin.h b/apps/plugin.h
index 874b9b4a56..15f7e96946 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -62,6 +62,7 @@ void* plugin_get_buffer(size_t *buffer_size);
62#include "usb.h" 62#include "usb.h"
63#include "font.h" 63#include "font.h"
64#include "lcd.h" 64#include "lcd.h"
65#include "scroll_engine.h"
65#include "metadata.h" 66#include "metadata.h"
66#include "sound.h" 67#include "sound.h"
67#include "mpeg.h" 68#include "mpeg.h"
@@ -195,7 +196,7 @@ struct plugin_api {
195 void (*lcd_puts)(int x, int y, const unsigned char *string); 196 void (*lcd_puts)(int x, int y, const unsigned char *string);
196 void (*lcd_putsf)(int x, int y, const unsigned char *fmt, ...); 197 void (*lcd_putsf)(int x, int y, const unsigned char *fmt, ...);
197 void (*lcd_puts_scroll)(int x, int y, const unsigned char* string); 198 void (*lcd_puts_scroll)(int x, int y, const unsigned char* string);
198 void (*lcd_stop_scroll)(void); 199 void (*lcd_scroll_stop)(void);
199#ifdef HAVE_LCD_CHARCELLS 200#ifdef HAVE_LCD_CHARCELLS
200 void (*lcd_define_pattern)(unsigned long ucs, const char *pattern); 201 void (*lcd_define_pattern)(unsigned long ucs, const char *pattern);
201 unsigned long (*lcd_get_locked_pattern)(void); 202 unsigned long (*lcd_get_locked_pattern)(void);
@@ -327,7 +328,7 @@ struct plugin_api {
327 void (*lcd_remote_clear_display)(void); 328 void (*lcd_remote_clear_display)(void);
328 void (*lcd_remote_puts)(int x, int y, const unsigned char *string); 329 void (*lcd_remote_puts)(int x, int y, const unsigned char *string);
329 void (*lcd_remote_puts_scroll)(int x, int y, const unsigned char* string); 330 void (*lcd_remote_puts_scroll)(int x, int y, const unsigned char* string);
330 void (*lcd_remote_stop_scroll)(void); 331 void (*lcd_remote_scroll_stop)(void);
331 void (*lcd_remote_set_drawmode)(int mode); 332 void (*lcd_remote_set_drawmode)(int mode);
332 int (*lcd_remote_get_drawmode)(void); 333 int (*lcd_remote_get_drawmode)(void);
333 void (*lcd_remote_setfont)(int font); 334 void (*lcd_remote_setfont)(int font);
diff --git a/apps/plugins/boomshine.lua b/apps/plugins/boomshine.lua
index fe73e8cb66..2eb43dedbd 100644
--- a/apps/plugins/boomshine.lua
+++ b/apps/plugins/boomshine.lua
@@ -345,7 +345,7 @@ function display_message(to, ...)
345 rb.sleep(to) 345 rb.sleep(to)
346 end 346 end
347 347
348 rb.lcd_stop_scroll() -- Stop our scrolling message 348 rb.lcd_scroll_stop() -- Stop our scrolling message
349end 349end
350 350
351if HAS_TOUCHSCREEN then 351if HAS_TOUCHSCREEN then
diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c
index be4d90e81a..3a454b7714 100644
--- a/apps/plugins/chessclock.c
+++ b/apps/plugins/chessclock.c
@@ -776,7 +776,7 @@ static int chessclock_set_int(char* string,
776 *variable = min; 776 *variable = min;
777 777
778 } 778 }
779 rb->lcd_stop_scroll(); 779 rb->lcd_scroll_stop();
780 780
781 return CHCL_OK; 781 return CHCL_OK;
782} 782}
diff --git a/apps/plugins/lrcplayer.c b/apps/plugins/lrcplayer.c
index 051d7adbb2..6e0394fa51 100644
--- a/apps/plugins/lrcplayer.c
+++ b/apps/plugins/lrcplayer.c
@@ -2200,7 +2200,7 @@ static int timetag_editor(void)
2200 } 2200 }
2201 2201
2202 FOR_NB_SCREENS(idx) 2202 FOR_NB_SCREENS(idx)
2203 rb->screens[idx]->stop_scroll(); 2203 rb->screens[idx]->scroll_stop();
2204 2204
2205 if (current.changed_lrc) 2205 if (current.changed_lrc)
2206 { 2206 {
diff --git a/apps/plugins/resistor.c b/apps/plugins/resistor.c
index 8dea817898..16374b3d18 100644
--- a/apps/plugins/resistor.c
+++ b/apps/plugins/resistor.c
@@ -771,7 +771,7 @@ static void led_resistance_calc(void)
771 } 771 }
772 } 772 }
773 display->set_viewport(&text_vp); 773 display->set_viewport(&text_vp);
774 rb->lcd_stop_scroll(); 774 rb->lcd_scroll_stop();
775 display->set_viewport(&screen_vp); 775 display->set_viewport(&screen_vp);
776 rb->lcd_clear_display(); 776 rb->lcd_clear_display();
777} 777}
@@ -908,7 +908,7 @@ static void resistance_to_color(void)
908 } 908 }
909 } 909 }
910 display->set_viewport(&text_vp); 910 display->set_viewport(&text_vp);
911 rb->lcd_stop_scroll(); 911 rb->lcd_scroll_stop();
912 display->set_viewport(&screen_vp); 912 display->set_viewport(&screen_vp);
913 rb->lcd_clear_display(); 913 rb->lcd_clear_display();
914} 914}
@@ -989,7 +989,7 @@ static void color_to_resistance(void)
989 } 989 }
990 } 990 }
991 display->set_viewport(&text_vp); 991 display->set_viewport(&text_vp);
992 rb->lcd_stop_scroll(); 992 rb->lcd_scroll_stop();
993 display->set_viewport(&screen_vp); 993 display->set_viewport(&screen_vp);
994 rb->lcd_clear_display(); 994 rb->lcd_clear_display();
995 return; 995 return;
diff --git a/apps/plugins/splitedit.c b/apps/plugins/splitedit.c
index d44e2d1f51..1e117b153b 100644
--- a/apps/plugins/splitedit.c
+++ b/apps/plugins/splitedit.c
@@ -874,7 +874,7 @@ static void save_editor(struct mp3entry *mp3, int splittime)
874 break; 874 break;
875 875
876 case SE_SAVE: 876 case SE_SAVE:
877 rb->lcd_stop_scroll(); 877 rb->lcd_scroll_stop();
878 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); 878 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
879 rb->lcd_fillrect(0, 6*8, LCD_WIDTH, LCD_HEIGHT); 879 rb->lcd_fillrect(0, 6*8, LCD_WIDTH, LCD_HEIGHT);
880 rb->lcd_set_drawmode(DRMODE_SOLID); 880 rb->lcd_set_drawmode(DRMODE_SOLID);
diff --git a/apps/plugins/superdom.c b/apps/plugins/superdom.c
index 1ef99dee30..9d06d9a4e3 100644
--- a/apps/plugins/superdom.c
+++ b/apps/plugins/superdom.c
@@ -889,7 +889,7 @@ static int get_number(char* param, int* value, int max) {
889 rb->lcd_update(); 889 rb->lcd_update();
890 } 890 }
891 rb->lcd_setfont(FONT_UI); 891 rb->lcd_setfont(FONT_UI);
892 rb->lcd_stop_scroll(); 892 rb->lcd_scroll_stop();
893 if (ret == RET_VAL_QUIT_ERR) 893 if (ret == RET_VAL_QUIT_ERR)
894 rb->splash(HZ, "Cancelled"); 894 rb->splash(HZ, "Cancelled");
895 return ret; 895 return ret;
diff --git a/apps/radio/radio_skin.c b/apps/radio/radio_skin.c
index 87bef25d3a..90aa977e56 100644
--- a/apps/radio/radio_skin.c
+++ b/apps/radio/radio_skin.c
@@ -78,7 +78,7 @@ void fms_fix_displays(enum fms_exiting toggle_state)
78 } 78 }
79 else 79 else
80 { 80 {
81 screens[i].stop_scroll(); 81 screens[i].scroll_stop();
82#ifdef HAVE_BACKDROP_IMAGE 82#ifdef HAVE_BACKDROP_IMAGE
83 skin_backdrop_show(sb_get_backdrop(i)); 83 skin_backdrop_show(sb_get_backdrop(i));
84#endif 84#endif
diff --git a/apps/screen_access.c b/apps/screen_access.c
index 152f96f7fa..161e596aa2 100644
--- a/apps/screen_access.c
+++ b/apps/screen_access.c
@@ -245,11 +245,11 @@ struct screen screens[NB_SCREENS] =
245 .puts_scroll_offset=&lcd_puts_scroll_offset, 245 .puts_scroll_offset=&lcd_puts_scroll_offset,
246 .scroll_speed=&lcd_scroll_speed, 246 .scroll_speed=&lcd_scroll_speed,
247 .scroll_delay=&lcd_scroll_delay, 247 .scroll_delay=&lcd_scroll_delay,
248 .stop_scroll=&lcd_stop_scroll,
249 .clear_display=&lcd_clear_display, 248 .clear_display=&lcd_clear_display,
250 .clear_viewport=&lcd_clear_viewport, 249 .clear_viewport=&lcd_clear_viewport,
251 .scroll_stop=&lcd_scroll_stop, 250 .scroll_stop=&lcd_scroll_stop,
252 .scroll_stop_line=&lcd_scroll_stop_line, 251 .scroll_stop_viewport=&lcd_scroll_stop_viewport,
252 .scroll_stop_viewport_line=&lcd_scroll_stop_viewport_line,
253 .update=&lcd_update, 253 .update=&lcd_update,
254 .update_viewport=&lcd_update_viewport, 254 .update_viewport=&lcd_update_viewport,
255 .backlight_on=&backlight_on, 255 .backlight_on=&backlight_on,
@@ -346,11 +346,11 @@ struct screen screens[NB_SCREENS] =
346 .puts_scroll_offset=&lcd_remote_puts_scroll_offset, 346 .puts_scroll_offset=&lcd_remote_puts_scroll_offset,
347 .scroll_speed=&lcd_remote_scroll_speed, 347 .scroll_speed=&lcd_remote_scroll_speed,
348 .scroll_delay=&lcd_remote_scroll_delay, 348 .scroll_delay=&lcd_remote_scroll_delay,
349 .stop_scroll=&lcd_remote_stop_scroll,
350 .clear_display=&lcd_remote_clear_display, 349 .clear_display=&lcd_remote_clear_display,
351 .clear_viewport=&lcd_remote_clear_viewport, 350 .clear_viewport=&lcd_remote_clear_viewport,
352 .scroll_stop=&lcd_remote_scroll_stop, 351 .scroll_stop=&lcd_remote_scroll_stop,
353 .scroll_stop_line=&lcd_remote_scroll_stop_line, 352 .scroll_stop_viewport=&lcd_remote_scroll_stop_viewport,
353 .scroll_stop_viewport_line=&lcd_remote_scroll_stop_viewport_line,
354 .update=&lcd_remote_update, 354 .update=&lcd_remote_update,
355 .update_viewport=&lcd_remote_update_viewport, 355 .update_viewport=&lcd_remote_update_viewport,
356 .backlight_on=&remote_backlight_on, 356 .backlight_on=&remote_backlight_on,
diff --git a/apps/screen_access.h b/apps/screen_access.h
index ea05a2294d..448437c637 100644
--- a/apps/screen_access.h
+++ b/apps/screen_access.h
@@ -145,11 +145,11 @@ struct screen
145 int x_offset); 145 int x_offset);
146 void (*scroll_speed)(int speed); 146 void (*scroll_speed)(int speed);
147 void (*scroll_delay)(int ms); 147 void (*scroll_delay)(int ms);
148 void (*stop_scroll)(void);
149 void (*clear_display)(void); 148 void (*clear_display)(void);
150 void (*clear_viewport)(void); 149 void (*clear_viewport)(void);
151 void (*scroll_stop)(const struct viewport* vp); 150 void (*scroll_stop)(void);
152 void (*scroll_stop_line)(const struct viewport* vp, int y); 151 void (*scroll_stop_viewport)(const struct viewport *vp);
152 void (*scroll_stop_viewport_line)(const struct viewport *vp, int line);
153 void (*update)(void); 153 void (*update)(void);
154 void (*update_viewport)(void); 154 void (*update_viewport)(void);
155 void (*backlight_on)(void); 155 void (*backlight_on)(void);
diff --git a/apps/screens.c b/apps/screens.c
index d02f29b4fe..a069bf19d9 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -566,7 +566,7 @@ bool set_time_screen(const char* title, struct tm *tm)
566 } 566 }
567 } 567 }
568 FOR_NB_SCREENS(s) 568 FOR_NB_SCREENS(s)
569 screens[s].scroll_stop(&viewports[s]); 569 screens[s].scroll_stop_viewport(&viewports[s]);
570#ifdef HAVE_TOUCHSCREEN 570#ifdef HAVE_TOUCHSCREEN
571 touchscreen_set_mode(old_mode); 571 touchscreen_set_mode(old_mode);
572#endif 572#endif
@@ -581,7 +581,7 @@ bool shutdown_screen(void)
581 bool done = false; 581 bool done = false;
582 long time_entered = current_tick; 582 long time_entered = current_tick;
583 583
584 lcd_stop_scroll(); 584 lcd_scroll_stop();
585 585
586 splash(0, str(LANG_CONFIRM_SHUTDOWN)); 586 splash(0, str(LANG_CONFIRM_SHUTDOWN));
587 587
diff --git a/apps/settings.c b/apps/settings.c
index cf51b0793c..1d92df270b 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -72,6 +72,7 @@
72#include "viewport.h" 72#include "viewport.h"
73#include "statusbar-skinned.h" 73#include "statusbar-skinned.h"
74#include "bootchart.h" 74#include "bootchart.h"
75#include "scroll_engine.h"
75 76
76#if CONFIG_CODEC == MAS3507D 77#if CONFIG_CODEC == MAS3507D
77void dac_line_in(bool enable); 78void dac_line_in(bool enable);
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 53e79fae04..6ffb2b551b 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -27,6 +27,7 @@
27#include "lang.h" 27#include "lang.h"
28#include "talk.h" 28#include "talk.h"
29#include "lcd.h" 29#include "lcd.h"
30#include "scroll_engine.h"
30#include "button.h" 31#include "button.h"
31#include "backlight.h" 32#include "backlight.h"
32#include "sound.h" 33#include "sound.h"
diff --git a/firmware/drivers/lcd-16bit-common.c b/firmware/drivers/lcd-16bit-common.c
index f8673ec6db..dffc1cf075 100644
--- a/firmware/drivers/lcd-16bit-common.c
+++ b/firmware/drivers/lcd-16bit-common.c
@@ -144,13 +144,9 @@ void lcd_clear_viewport(void)
144 } 144 }
145 145
146 if (current_vp == &default_vp) 146 if (current_vp == &default_vp)
147 { 147 lcd_scroll_stop();
148 lcd_scroll_info.lines = 0;
149 }
150 else 148 else
151 { 149 lcd_scroll_stop_viewport(current_vp);
152 lcd_scroll_stop(current_vp);
153 }
154} 150}
155 151
156/*** parameter handling ***/ 152/*** parameter handling ***/
diff --git a/firmware/drivers/lcd-1bit-vert.c b/firmware/drivers/lcd-1bit-vert.c
index 5cacf0a740..668c685187 100644
--- a/firmware/drivers/lcd-1bit-vert.c
+++ b/firmware/drivers/lcd-1bit-vert.c
@@ -226,7 +226,7 @@ void LCDFN(clear_viewport)(void)
226 226
227 current_vp->drawmode = oldmode; 227 current_vp->drawmode = oldmode;
228 228
229 LCDFN(scroll_stop)(current_vp); 229 LCDFN(scroll_stop_viewport)(current_vp);
230 } 230 }
231} 231}
232 232
diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c
index a17ac51006..10a567edf1 100644
--- a/firmware/drivers/lcd-bitmap-common.c
+++ b/firmware/drivers/lcd-bitmap-common.c
@@ -178,6 +178,12 @@ void LCDFN(set_viewport)(struct viewport* vp)
178#endif 178#endif
179} 179}
180 180
181struct viewport *LCDFN(get_viewport)(bool *is_default)
182{
183 *is_default = (current_vp == &default_vp);
184 return current_vp;
185}
186
181void LCDFN(update_viewport)(void) 187void LCDFN(update_viewport)(void)
182{ 188{
183 LCDFN(update_rect)(current_vp->x, current_vp->y, 189 LCDFN(update_rect)(current_vp->x, current_vp->y,
@@ -405,7 +411,7 @@ void LCDFN(puts_style_xyoffset)(int x, int y, const unsigned char *str,
405 int style, int x_offset, int y_offset) 411 int style, int x_offset, int y_offset)
406{ 412{
407 int xpos, ypos, h; 413 int xpos, ypos, h;
408 LCDFN(scroll_stop_line)(current_vp, y); 414 LCDFN(scroll_stop_viewport_line)(current_vp, y);
409 if(!str) 415 if(!str)
410 return; 416 return;
411 417
@@ -491,7 +497,7 @@ void LCDFN(puts_scroll_style_xyoffset)(int x, int y, const unsigned char *string
491 if (restart) 497 if (restart)
492 { 498 {
493 /* remove any previously scrolling line at the same location */ 499 /* remove any previously scrolling line at the same location */
494 LCDFN(scroll_stop_line)(current_vp, y); 500 LCDFN(scroll_stop_viewport_line)(current_vp, y);
495 501
496 if (LCDFN(scroll_info).lines >= LCDM(SCROLLABLE_LINES)) return; 502 if (LCDFN(scroll_info).lines >= LCDM(SCROLLABLE_LINES)) return;
497 LCDFN(puts_style_xyoffset)(x, y, string, style, x_offset, y_offset); 503 LCDFN(puts_style_xyoffset)(x, y, string, style, x_offset, y_offset);
diff --git a/firmware/drivers/lcd-charcell.c b/firmware/drivers/lcd-charcell.c
index b59b270f9b..bdd02de1b6 100644
--- a/firmware/drivers/lcd-charcell.c
+++ b/firmware/drivers/lcd-charcell.c
@@ -377,7 +377,7 @@ void lcd_clear_viewport(void)
377 for (y = 0; y < current_vp->height; y++) 377 for (y = 0; y < current_vp->height; y++)
378 lcd_putxchar(x, y, xspace); 378 lcd_putxchar(x, y, xspace);
379 379
380 lcd_scroll_stop(current_vp); 380 lcd_scroll_stop_viewport(current_vp);
381 } 381 }
382} 382}
383 383
@@ -486,7 +486,7 @@ void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
486 return; 486 return;
487 487
488 /* make sure scrolling is turned off on the line we are updating */ 488 /* make sure scrolling is turned off on the line we are updating */
489 lcd_scroll_stop_line(current_vp, y); 489 lcd_scroll_stop_viewport_line(current_vp, y);
490 490
491 x = lcd_putsxyofs(x, y, offset, str); 491 x = lcd_putsxyofs(x, y, offset, str);
492 while (x < current_vp->width) 492 while (x < current_vp->width)
@@ -509,7 +509,7 @@ void lcd_puts_scroll_offset(int x, int y, const unsigned char *string,
509 return; 509 return;
510 510
511 /* remove any previously scrolling line at the same location */ 511 /* remove any previously scrolling line at the same location */
512 lcd_scroll_stop_line(current_vp, y); 512 lcd_scroll_stop_viewport_line(current_vp, y);
513 513
514 if (lcd_scroll_info.lines >= LCD_SCROLLABLE_LINES) return; 514 if (lcd_scroll_info.lines >= LCD_SCROLLABLE_LINES) return;
515 515
diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h
index 6a3371fef2..74b668db3d 100644
--- a/firmware/export/lcd-remote.h
+++ b/firmware/export/lcd-remote.h
@@ -187,9 +187,6 @@ extern void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str,
187extern void lcd_remote_puts_style_xyoffset(int x, int y, const unsigned char *str, 187extern void lcd_remote_puts_style_xyoffset(int x, int y, const unsigned char *str,
188 int style, int x_offset, int y_offset); 188 int style, int x_offset, int y_offset);
189extern void lcd_remote_putc(int x, int y, unsigned short ch); 189extern void lcd_remote_putc(int x, int y, unsigned short ch);
190extern void lcd_remote_stop_scroll(void);
191extern void lcd_remote_scroll_speed(int speed);
192extern void lcd_remote_scroll_delay(int ms);
193extern void lcd_remote_puts_scroll(int x, int y, const unsigned char *str); 190extern void lcd_remote_puts_scroll(int x, int y, const unsigned char *str);
194extern void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *str, 191extern void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *str,
195 int style); 192 int style);
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index 5ad2d83513..7ea053f241 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -207,10 +207,6 @@ extern void lcd_puts_offset(int x, int y, const unsigned char *str, int offset);
207extern void lcd_puts_scroll_offset(int x, int y, const unsigned char *string, 207extern void lcd_puts_scroll_offset(int x, int y, const unsigned char *string,
208 int offset); 208 int offset);
209extern void lcd_putc(int x, int y, unsigned long ucs); 209extern void lcd_putc(int x, int y, unsigned long ucs);
210extern void lcd_stop_scroll(void);
211extern void lcd_bidir_scroll(int threshold);
212extern void lcd_scroll_speed(int speed);
213extern void lcd_scroll_delay(int ms);
214extern void lcd_puts_scroll(int x, int y, const unsigned char* string); 210extern void lcd_puts_scroll(int x, int y, const unsigned char* string);
215extern void lcd_puts_scroll_style(int x, int y, const unsigned char* string, 211extern void lcd_puts_scroll_style(int x, int y, const unsigned char* string,
216 int style); 212 int style);
diff --git a/firmware/export/scroll_engine.h b/firmware/export/scroll_engine.h
index 55f4120893..01a9a5e33d 100644
--- a/firmware/export/scroll_engine.h
+++ b/firmware/export/scroll_engine.h
@@ -29,14 +29,24 @@
29#include <lcd.h> 29#include <lcd.h>
30#include "file.h" 30#include "file.h"
31 31
32void scroll_init(void) INIT_ATTR; 32extern void scroll_init(void) INIT_ATTR;
33void lcd_scroll_stop(const struct viewport* vp); 33
34void lcd_scroll_stop_line(const struct viewport* vp, int y); 34extern void lcd_bidir_scroll(int threshold);
35void lcd_scroll_fn(void); 35extern void lcd_scroll_speed(int speed);
36extern void lcd_scroll_delay(int ms);
37
38extern void lcd_scroll_stop(void);
39extern void lcd_scroll_stop_viewport(const struct viewport *vp);
40extern void lcd_scroll_stop_viewport_line(const struct viewport *vp, int line);
41extern void lcd_scroll_fn(void);
36#ifdef HAVE_REMOTE_LCD 42#ifdef HAVE_REMOTE_LCD
37void lcd_remote_scroll_fn(void); 43extern void lcd_remote_scroll_speed(int speed);
38void lcd_remote_scroll_stop(const struct viewport* vp); 44extern void lcd_remote_scroll_delay(int ms);
39void lcd_remote_scroll_stop_line(const struct viewport* vp, int y); 45
46extern void lcd_remote_scroll_stop(void);
47extern void lcd_remote_scroll_stop_viewport(const struct viewport *vp);
48extern void lcd_remote_scroll_stop_viewport_line(const struct viewport *vp, int line);
49extern void lcd_remote_scroll_fn(void);
40#endif 50#endif
41 51
42/* internal usage, but in multiple drivers */ 52/* internal usage, but in multiple drivers */
diff --git a/firmware/rolo.c b/firmware/rolo.c
index 325e17e97f..79969bbbcf 100644
--- a/firmware/rolo.c
+++ b/firmware/rolo.c
@@ -115,7 +115,7 @@ static void rolo_error(const char *text)
115 button_get(true); 115 button_get(true);
116 button_get(true); 116 button_get(true);
117 button_get(true); 117 button_get(true);
118 lcd_stop_scroll(); 118 lcd_scroll_stop();
119} 119}
120 120
121#if CONFIG_CPU == SH7034 || CONFIG_CPU == IMX31L || CONFIG_CPU == RK27XX 121#if CONFIG_CPU == SH7034 || CONFIG_CPU == IMX31L || CONFIG_CPU == RK27XX
diff --git a/firmware/scroll_engine.c b/firmware/scroll_engine.c
index bc356a8281..82af26afa8 100644
--- a/firmware/scroll_engine.c
+++ b/firmware/scroll_engine.c
@@ -41,6 +41,10 @@ static const char scroll_tick_table[18] = {
41 100, 80, 64, 50, 40, 32, 25, 20, 16, 12, 10, 8, 6, 5, 4, 3, 2, 1 41 100, 80, 64, 50, 40, 32, 25, 20, 16, 12, 10, 8, 6, 5, 4, 3, 2, 1
42}; 42};
43 43
44/* imported private functions from lcd-bitmap-common.c */
45extern struct viewport *lcd_get_viewport(void);
46extern struct viewport *lcd_remote_get_viewport(void);
47
44static void scroll_thread(void); 48static void scroll_thread(void);
45static char scroll_stack[DEFAULT_STACK_SIZE*3]; 49static char scroll_stack[DEFAULT_STACK_SIZE*3];
46static const char scroll_name[] = "scroll"; 50static const char scroll_name[] = "scroll";
@@ -80,20 +84,21 @@ struct scroll_screen_info lcd_remote_scroll_info =
80}; 84};
81#endif /* HAVE_REMOTE_LCD */ 85#endif /* HAVE_REMOTE_LCD */
82 86
83void lcd_stop_scroll(void) 87void lcd_scroll_stop(void)
84{ 88{
85 lcd_scroll_info.lines = 0; 89 lcd_scroll_info.lines = 0;
86} 90}
87 91
88/* Stop scrolling line y in the specified viewport, or all lines if y < 0 */ 92/* Stop scrolling line y in the specified viewport, or all lines if y < 0 */
89void lcd_scroll_stop_line(const struct viewport* current_vp, int y) 93void lcd_scroll_stop_viewport_line(const struct viewport *current_vp, int line)
90{ 94{
91 int i = 0; 95 int i = 0;
92 96
93 while (i < lcd_scroll_info.lines) 97 while (i < lcd_scroll_info.lines)
94 { 98 {
95 if ((lcd_scroll_info.scroll[i].vp == current_vp) && 99 struct viewport *vp = lcd_scroll_info.scroll[i].vp;
96 ((y < 0) || (lcd_scroll_info.scroll[i].y == y))) 100 if (((vp == current_vp)) &&
101 ((line < 0) || (lcd_scroll_info.scroll[i].y == line)))
97 { 102 {
98 /* If i is not the last active line in the array, then move 103 /* If i is not the last active line in the array, then move
99 the last item to position i */ 104 the last item to position i */
@@ -106,7 +111,7 @@ void lcd_scroll_stop_line(const struct viewport* current_vp, int y)
106 111
107 /* A line can only appear once, so we're done, 112 /* A line can only appear once, so we're done,
108 * unless we are clearing the whole viewport */ 113 * unless we are clearing the whole viewport */
109 if (y >= 0) 114 if (line >= 0)
110 return ; 115 return ;
111 } 116 }
112 else 117 else
@@ -117,9 +122,9 @@ void lcd_scroll_stop_line(const struct viewport* current_vp, int y)
117} 122}
118 123
119/* Stop all scrolling lines in the specified viewport */ 124/* Stop all scrolling lines in the specified viewport */
120void lcd_scroll_stop(const struct viewport* vp) 125void lcd_scroll_stop_viewport(const struct viewport *current_vp)
121{ 126{
122 lcd_scroll_stop_line(vp, -1); 127 lcd_scroll_stop_viewport_line(current_vp, -1);
123} 128}
124 129
125void lcd_scroll_speed(int speed) 130void lcd_scroll_speed(int speed)
@@ -157,20 +162,21 @@ void lcd_jump_scroll_delay(int ms)
157#endif 162#endif
158 163
159#ifdef HAVE_REMOTE_LCD 164#ifdef HAVE_REMOTE_LCD
160void lcd_remote_stop_scroll(void) 165void lcd_remote_scroll_stop(void)
161{ 166{
162 lcd_remote_scroll_info.lines = 0; 167 lcd_remote_scroll_info.lines = 0;
163} 168}
164 169
165/* Stop scrolling line y in the specified viewport, or all lines if y < 0 */ 170/* Stop scrolling line y in the specified viewport, or all lines if y < 0 */
166void lcd_remote_scroll_stop_line(const struct viewport* current_vp, int y) 171void lcd_remote_scroll_stop_viewport_line(const struct viewport *current_vp, int line)
167{ 172{
168 int i = 0; 173 int i = 0;
169 174
170 while (i < lcd_remote_scroll_info.lines) 175 while (i < lcd_scroll_info.lines)
171 { 176 {
172 if ((lcd_remote_scroll_info.scroll[i].vp == current_vp) && 177 struct viewport *vp = lcd_remote_scroll_info.scroll[i].vp;
173 ((y < 0) || (lcd_remote_scroll_info.scroll[i].y == y))) 178 if (((vp == current_vp)) &&
179 ((line < 0) || (lcd_remote_scroll_info.scroll[i].y == line)))
174 { 180 {
175 /* If i is not the last active line in the array, then move 181 /* If i is not the last active line in the array, then move
176 the last item to position i */ 182 the last item to position i */
@@ -183,7 +189,7 @@ void lcd_remote_scroll_stop_line(const struct viewport* current_vp, int y)
183 189
184 /* A line can only appear once, so we're done, 190 /* A line can only appear once, so we're done,
185 * unless we are clearing the whole viewport */ 191 * unless we are clearing the whole viewport */
186 if (y >= 0) 192 if (line >= 0)
187 return ; 193 return ;
188 } 194 }
189 else 195 else
@@ -194,9 +200,9 @@ void lcd_remote_scroll_stop_line(const struct viewport* current_vp, int y)
194} 200}
195 201
196/* Stop all scrolling lines in the specified viewport */ 202/* Stop all scrolling lines in the specified viewport */
197void lcd_remote_scroll_stop(const struct viewport* vp) 203void lcd_remote_scroll_stop_viewport(const struct viewport *current_vp)
198{ 204{
199 lcd_remote_scroll_stop_line(vp, -1); 205 lcd_remote_scroll_stop_viewport_line(current_vp, -1);
200} 206}
201 207
202void lcd_remote_scroll_speed(int speed) 208void lcd_remote_scroll_speed(int speed)