diff -Nau ref-20050710/firmware/export/lcd.h jumpback-20050710-2/firmware/export/lcd.h --- ref-20050710/firmware/export/lcd.h 2005-07-09 04:00:11.000000000 +0000 +++ jumpback-20050710-2/firmware/export/lcd.h 2005-07-22 11:48:51.000000000 +0000 @@ -195,6 +195,7 @@ bool backward; /* scroll presently forward or backward? */ bool bidir; bool invert; /* invert the scrolled text */ + bool jump_back; long start_tick; }; #else /* !HAVE_LCD_BITMAP */ diff -Nau ref-20050710/firmware/drivers/lcd-recorder.c jumpback-20050710-2/firmware/drivers/lcd-recorder.c --- ref-20050710/firmware/drivers/lcd-recorder.c 2005-07-09 04:00:11.000000000 +0000 +++ jumpback-20050710-2/firmware/drivers/lcd-recorder.c 2005-07-30 01:30:04.294756624 +0000 @@ -17,6 +17,7 @@ * ****************************************************************************/ #include "config.h" +#define JUMPBACK #include "lcd.h" #include "kernel.h" @@ -985,6 +986,10 @@ /* get width */ s->width = lcd_getstringsize(s->line, &w, &h); +#ifdef JUMPBACK + s->bidir = true; + s->jump_back = false; +#else /* scroll bidirectional or forward only depending on the string width */ if ( bidir_limit ) { @@ -999,6 +1004,7 @@ /* get new width incl. spaces */ s->width = lcd_getstringsize(s->line, &w, &h); } +#endif end = strchr(s->line, '\0'); strncpy(end, string, LCD_WIDTH/2); @@ -1037,15 +1043,35 @@ if (TIME_BEFORE(current_tick, s->start_tick)) continue; + pf = font_get(curfont); + xpos = xmargin + s->startx * s->width / s->len; + ypos = ymargin + index * pf->height; + +#ifdef JUMPBACK + if (s->jump_back) + { + /* jump back to beginning of line and delay again */ + s->jump_back = false; + s->offset = 0; + s->start_tick = current_tick + scroll_delay; + } + else + { + s->offset += scroll_step; + if (s->offset >= s->width - (LCD_WIDTH - xpos)) + { + /* at end of line */ + s->offset = s->width - (LCD_WIDTH - xpos); + s->start_tick = current_tick + scroll_delay * 2; + s->jump_back = true; + } + } +#else if (s->backward) s->offset -= scroll_step; else s->offset += scroll_step; - pf = font_get(curfont); - xpos = xmargin + s->startx * s->width / s->len; - ypos = ymargin + index * pf->height; - if (s->bidir) { /* scroll bidirectional */ if (s->offset <= 0) { /* at beginning of line */ @@ -1065,6 +1091,7 @@ if (s->offset >= s->width) s->offset %= s->width; } +#endif lastmode = drawmode; drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); diff -Nau ref-20050710/firmware/drivers/lcd-h100.c jumpback-20050710-2/firmware/drivers/lcd-h100.c --- ref-20050710/firmware/drivers/lcd-h100.c 2005-07-07 04:00:09.000000000 +0000 +++ jumpback-20050710-2/firmware/drivers/lcd-h100.c 2005-07-30 01:31:41.181027672 +0000 @@ -17,6 +17,7 @@ * ****************************************************************************/ #include "config.h" +#define JUMPBACK #include "cpu.h" #include "lcd.h" @@ -1125,6 +1126,10 @@ /* get width */ s->width = lcd_getstringsize(s->line, &w, &h); +#ifdef JUMPBACK + s->bidir = true; + s->jump_back = false; +#else /* scroll bidirectional or forward only depending on the string width */ if ( bidir_limit ) { @@ -1139,6 +1144,7 @@ /* get new width incl. spaces */ s->width = lcd_getstringsize(s->line, &w, &h); } +#endif end = strchr(s->line, '\0'); strncpy(end, string, LCD_WIDTH/2); @@ -1177,15 +1183,35 @@ if (TIME_BEFORE(current_tick, s->start_tick)) continue; + pf = font_get(curfont); + xpos = xmargin + s->startx * s->width / s->len; + ypos = ymargin + index * pf->height; + +#ifdef JUMPBACK + if (s->jump_back) + { + /* jump back to beginning of line and delay again */ + s->jump_back = false; + s->offset = 0; + s->start_tick = current_tick + scroll_delay * 2; + } + else + { + s->offset += scroll_step; + if (s->offset >= s->width - (LCD_WIDTH - xpos)) + { + /* at end of line */ + s->offset = s->width - (LCD_WIDTH - xpos); + s->start_tick = current_tick + scroll_delay * 2; + s->jump_back = true; + } + } +#else if (s->backward) s->offset -= scroll_step; else s->offset += scroll_step; - pf = font_get(curfont); - xpos = xmargin + s->startx * s->width / s->len; - ypos = ymargin + index * pf->height; - if (s->bidir) { /* scroll bidirectional */ if (s->offset <= 0) { /* at beginning of line */ @@ -1205,6 +1231,7 @@ if (s->offset >= s->width) s->offset %= s->width; } +#endif lastmode = drawmode; drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); diff -Nau ref-20050710/firmware/drivers/lcd-h100-remote.c jumpback-20050710-2/firmware/drivers/lcd-h100-remote.c --- ref-20050710/firmware/drivers/lcd-h100-remote.c 2005-07-09 04:00:11.000000000 +0000 +++ jumpback-20050710-2/firmware/drivers/lcd-h100-remote.c 2005-07-30 01:31:19.134379272 +0000 @@ -7,7 +7,7 @@ * \/ \/ \/ \/ \/ * $Id: lcd-h100-remote.c,v 1.24 2005/07/08 19:09:16 amiconn Exp $ * - * Copyright (C) 2005 by Richard S. La Charité III + * Copyright (C) 2005 by Richard S. La Charit�III * * All files in this archive are subject to the GNU General Public License. * See the file COPYING in the source tree root for full license agreement. @@ -18,6 +18,7 @@ ****************************************************************************/ #include "config.h" +#define JUMPBACK #include "cpu.h" #include "lcd.h" #include "lcd-remote.h" @@ -1100,6 +1101,10 @@ /* get width */ s->width = lcd_remote_getstringsize(s->line, &w, &h); +#ifdef JUMPBACK + s->bidir = true; + s->jump_back = false; +#else /* scroll bidirectional or forward only depending on the string width */ if ( bidir_limit ) { @@ -1114,6 +1119,7 @@ /* get new width incl. spaces */ s->width = lcd_remote_getstringsize(s->line, &w, &h); } +#endif end = strchr(s->line, '\0'); strncpy(end, string, LCD_REMOTE_WIDTH/2); @@ -1161,15 +1167,35 @@ if (TIME_BEFORE(current_tick, s->start_tick)) continue; + pf = font_get(curfont); + xpos = xmargin + s->startx * s->width / s->len; + ypos = ymargin + index * pf->height; + +#ifdef JUMPBACK + if (s->jump_back) + { + /* jump back to beginning of line and delay again */ + s->jump_back = false; + s->offset = 0; + s->start_tick = current_tick + scroll_delay * 2; + } + else + { + s->offset += scroll_step; + if (s->offset >= s->width - (LCD_REMOTE_WIDTH - xpos)) + { + /* at end of line */ + s->offset = s->width - (LCD_REMOTE_WIDTH - xpos); + s->start_tick = current_tick + scroll_delay * 2; + s->jump_back = true; + } + } +#else if (s->backward) s->offset -= scroll_step; else s->offset += scroll_step; - pf = font_get(curfont); - xpos = xmargin + s->startx * s->width / s->len; - ypos = ymargin + index * pf->height; - if (s->bidir) { /* scroll bidirectional */ if (s->offset <= 0) { /* at beginning of line */ @@ -1189,6 +1215,7 @@ if (s->offset >= s->width) s->offset %= s->width; } +#endif lastmode = drawmode; drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID);