summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-player.c
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/drivers/lcd-player.c
parentfd07b6932fc2ff908fc291df026f6359d87aa086 (diff)
Bidirectional scroll ala recorder.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3080 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd-player.c')
-rw-r--r--firmware/drivers/lcd-player.c8
1 files changed, 7 insertions, 1 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++) {