Index: drivers/lcd.c
===================================================================
RCS file: /cvsroot/rockbox/firmware/drivers/lcd.c,v
retrieving revision 1.92
diff -u -b -r1.92 lcd.c
--- drivers/lcd.c	28 Aug 2002 14:21:25 -0000	1.92
+++ drivers/lcd.c	1 Sep 2002 22:24:33 -0000
@@ -127,9 +127,10 @@
 static char scroll_speed = 8; /* updates per second */
 static char scroll_spacing = 3; /* spaces between end and start of text */
 
+#define MAX_SCROLL_LINES 10
 
-static struct scrollinfo scroll; /* only one scroll line at the moment */
-static int scroll_count = 0;
+static struct scrollinfo scroll_lines[MAX_SCROLL_LINES]; /* only one scroll line at the moment */
+static bool scroll = true;
 
 #ifndef SIMULATOR
 /*
@@ -1273,7 +1274,7 @@
 
 void lcd_puts_scroll(int x, int y, unsigned char* string )
 {
-    struct scrollinfo* s = &scroll;
+    struct scrollinfo* s = &scroll_lines[y];
 #ifdef HAVE_LCD_CHARCELLS
     s->space = 11 - x;
 #else
@@ -1331,15 +1332,15 @@
                 s->space > (int)sizeof s->line ?
                 (int)sizeof s->line : s->space );
         s->line[sizeof s->line - 1] = 0;
-        scroll_count = 1;
+        scroll = true;
     }
 }
 
 void lcd_stop_scroll(void)
 {
-    if ( scroll_count ) {
-        struct scrollinfo* s = &scroll;
-        scroll_count = 0;
+    int k;
+    for (k=0; k < MAX_SCROLL_LINES; k++ ) {
+        struct scrollinfo* s = &scroll_lines[k];
         
 #ifdef LCD_PROPFONTS
 
@@ -1363,18 +1364,20 @@
 
         /* restore scrolled row */
         lcd_puts(s->startx,s->starty,s->text);
+        s->text[0] = 0;
         lcd_update();
     }
+    scroll = false;
 }
 
 void lcd_scroll_pause(void)
 {
-    scroll_count = 0;
+    scroll = false;
 }
 
 void lcd_scroll_resume(void)
 {
-    scroll_count = 1;
+    scroll = true;
 }
 
 void lcd_scroll_speed(int speed)
@@ -1384,17 +1387,21 @@
 
 static void scroll_thread(void)
 {
-    struct scrollinfo* s = &scroll;
 
     while ( 1 ) {
-        if ( !scroll_count ) {
+        if ( !scroll ) {
             yield();
             continue;
         }
-        /* wait 0.5s before starting scroll */
-        if ( scroll_count < scroll_speed/2 )
-            scroll_count++;
-        else {
+
+        int k;
+        for (k=0; k<MAX_SCROLL_LINES; k++) {
+            struct scrollinfo* s = &scroll_lines[k];
+
+            if (!s->text[0]) {
+                continue;
+            }
+
             int i;
             for ( i=0; i<s->space-1; i++ )
                 s->line[i] = s->line[i+1];
@@ -1427,8 +1434,8 @@
             }
 #endif
             lcd_puts(s->startx,s->starty,s->line);
-            lcd_update();
         }
+        lcd_update();
         sleep(HZ/scroll_speed);
     }
 }

