summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorMats Lidell <matsl@rockbox.org>2003-01-14 10:45:57 +0000
committerMats Lidell <matsl@rockbox.org>2003-01-14 10:45:57 +0000
commit4c7f70fe9ae4a516a1e3794f60abd95c603ddbba (patch)
tree6c52d15be8c8a32cb21db4b6f37fb4bc04ffb7be /firmware
parentfd07b6932fc2ff908fc291df026f6359d87aa086 (diff)
downloadrockbox-4c7f70fe9ae4a516a1e3794f60abd95c603ddbba.tar.gz
rockbox-4c7f70fe9ae4a516a1e3794f60abd95c603ddbba.zip
Bidirectional scroll ala recorder.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3080 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/lcd-player.c8
-rw-r--r--firmware/drivers/lcd.h2
2 files changed, 8 insertions, 2 deletions
diff --git a/firmware/drivers/lcd-player.c b/firmware/drivers/lcd-player.c
index 23dc774e83..ea759544eb 100644
--- a/firmware/drivers/lcd-player.c
+++ b/firmware/drivers/lcd-player.c
@@ -79,6 +79,7 @@ static char scroll_speed = 8; /* updates per second */
static int scroll_delay = HZ/2; /* delay before starting scroll */
static char scroll_spacing = 3; /* spaces between end and start of text */
static bool allow_bidirectional_scrolling = true;
+static int bidir_limit = 50; /* percent */
static struct scrollinfo scroll[SCROLLABLE_LINES];
@@ -442,6 +443,11 @@ void lcd_init (void)
sizeof(scroll_stack), scroll_name);
}
+void lcd_bidir_scroll(int percent)
+{
+ bidir_limit = percent;
+}
+
void lcd_puts_scroll(int x, int y, unsigned char* string )
{
struct scrollinfo* s;
@@ -463,7 +469,7 @@ void lcd_puts_scroll(int x, int y, unsigned char* string )
s->direction=+1;
strncpy(s->text,string,sizeof s->text);
s->turn_offset=-1;
- if (allow_bidirectional_scrolling && s->textlen + x > 11+4) {
+ if (bidir_limit && (s->textlen < ((11-x)*(100+bidir_limit))/100)) {
s->turn_offset=s->textlen+x-11;
} else {
for (i=0; i<scroll_spacing && s->textlen<(int)sizeof(s->text); i++) {
diff --git a/firmware/drivers/lcd.h b/firmware/drivers/lcd.h
index 8c57aa9f05..a4d8178b87 100644
--- a/firmware/drivers/lcd.h
+++ b/firmware/drivers/lcd.h
@@ -88,7 +88,7 @@ extern void lcd_double_height (bool on);
unsigned char lcd_get_locked_pattern(void);
void lcd_unlock_pattern(unsigned char pat);
void lcd_allow_bidirectional_scrolling(bool on);
-
+extern void lcd_bidir_scroll(int threshold);
#endif
#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)