diff options
| author | Brandon Low <lostlogic@rockbox.org> | 2006-01-22 04:24:26 +0000 |
|---|---|---|
| committer | Brandon Low <lostlogic@rockbox.org> | 2006-01-22 04:24:26 +0000 |
| commit | d3a03b679f196be076043d475b9512338fd6c8bb (patch) | |
| tree | c4c57a157a46d09a7037c39e290182a8c43deb71 /firmware | |
| parent | bfe740712a3513dbb4143336cbc5e9aaab09d732 (diff) | |
| download | rockbox-d3a03b679f196be076043d475b9512338fd6c8bb.zip rockbox-d3a03b679f196be076043d475b9512338fd6c8bb.tar.gz rockbox-d3a03b679f196be076043d475b9512338fd6c8bb.tar.bz2 rockbox-d3a03b679f196be076043d475b9512338fd6c8bb.tar.xz | |
Horizontal screen scrolling part 3 (by Shachar Liberman)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8414 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
| -rw-r--r-- | firmware/drivers/lcd-h100-remote.c | 16 | ||||
| -rw-r--r-- | firmware/drivers/lcd-h100.c | 44 | ||||
| -rw-r--r-- | firmware/drivers/lcd-recorder.c | 58 | ||||
| -rw-r--r-- | firmware/export/lcd-remote.h | 4 |
4 files changed, 62 insertions, 60 deletions
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c index a28cd2f..3be907a 100644 --- a/firmware/drivers/lcd-h100-remote.c +++ b/firmware/drivers/lcd-h100-remote.c @@ -1138,7 +1138,7 @@ void lcd_remote_putsxy(int x, int y, const unsigned char *str) /* put a string at a given char position */ void lcd_remote_puts(int x, int y, const unsigned char *str) { - lcd_remote_puts_style(x, y, str, STYLE_DEFAULT); + lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, 0); } void lcd_remote_puts_style(int x, int y, const unsigned char *str, int style) @@ -1151,7 +1151,8 @@ void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset) lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, offset); } -/* put a string at a given char position at a given style and with a given offset */ +/* put a string at a given char position, style, and pixel position, + * skipping first offset pixel columns */ void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset) { int xpos,ypos,w,h; @@ -1223,16 +1224,16 @@ void lcd_remote_puts_scroll(int x, int y, const unsigned char *string) void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *string, int style) { - lcd_remote_puts_scroll_style_offset(x, y, string, style, 0); + lcd_remote_puts_scroll_style_offset(x, y, string, style, 0); } - + void lcd_remote_puts_scroll_offset(int x, int y, const unsigned char *string, int offset) { lcd_remote_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset); -} - +} + void lcd_remote_puts_scroll_style_offset(int x, int y, const unsigned char *string, - int style, int offset) + int style, int offset) { struct scrollinfo* s; int w, h; @@ -1289,7 +1290,6 @@ void lcd_remote_puts_scroll_style_offset(int x, int y, const unsigned char *stri scrolling_lines &= ~(1<<y); } - static void scroll_thread(void) { struct font* pf; diff --git a/firmware/drivers/lcd-h100.c b/firmware/drivers/lcd-h100.c index 0df1a3c..6859845 100644 --- a/firmware/drivers/lcd-h100.c +++ b/firmware/drivers/lcd-h100.c @@ -1057,9 +1057,26 @@ void lcd_putsxy(int x, int y, const unsigned char *str) /*** line oriented text output ***/ -/* put a string at a given char position at a given style and with a given pixel position */ -void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, - int offset) +/* put a string at a given char position */ +void lcd_puts(int x, int y, const unsigned char *str) +{ + lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0); +} + +void lcd_puts_style(int x, int y, const unsigned char *str, int style) +{ + lcd_puts_style_offset(x, y, str, style, 0); +} + +void lcd_puts_offset(int x, int y, const unsigned char *str, int offset) +{ + lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset); +} + +/* put a string at a given char position, style, and pixel position, + * skipping first offset pixel columns */ +void lcd_puts_style_offset(int x, int y, const unsigned char *str, + int style, int offset) { int xpos,ypos,w,h; int lastmode = drawmode; @@ -1083,22 +1100,6 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, } drawmode = lastmode; } -void lcd_puts_style(int x, int y, const unsigned char *str, int style) -{ - lcd_puts_style_offset(x, y, str, style, 0); -} - -/* put a string at a given char position at a given offset mark */ -void lcd_puts_offset(int x, int y, const unsigned char *str, int offset) -{ - lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset); -} - -/* put a string at a given char position */ -void lcd_puts(int x, int y, const unsigned char *str) -{ - lcd_puts_style(x, y, str, STYLE_DEFAULT); -} /*** scrolling ***/ @@ -1226,7 +1227,7 @@ static void scroll_thread(void) while ( 1 ) { for ( index = 0; index < SCROLLABLE_LINES; index++ ) { /* really scroll? */ - if ( !(scrolling_lines&(1<<index))) + if ( !(scrolling_lines&(1<<index)) ) continue; s = &scroll[index]; @@ -1269,7 +1270,8 @@ static void scroll_thread(void) lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); drawmode = DRMODE_SOLID; lcd_putsxyofs(xpos, ypos, s->offset, (unsigned char *)s->line); - if (s->invert) { + if (s->invert) + { drawmode = DRMODE_COMPLEMENT; lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); } diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c index 9f8a2b6..b7bcd02 100644 --- a/firmware/drivers/lcd-recorder.c +++ b/firmware/drivers/lcd-recorder.c @@ -917,9 +917,26 @@ void lcd_putsxy(int x, int y, const unsigned char *str) /*** Line oriented text output ***/ -/* put a string at a given char position at a given style and with a given pixel position */ -void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, - int offset) +/* put a string at a given char position */ +void lcd_puts(int x, int y, const unsigned char *str) +{ + lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0); +} + +void lcd_puts_style(int x, int y, const unsigned char *str, int style) +{ + lcd_puts_style_offset(x, y, str, style, 0); +} + +void lcd_puts_offset(int x, int y, const unsigned char *str, int offset) +{ + lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset); +} + +/* put a string at a given char position, style, and pixel position, + * skipping first offset pixel columns */ +void lcd_puts_style_offset(int x, int y, const unsigned char *str, + int style, int offset) { int xpos,ypos,w,h; int lastmode = drawmode; @@ -944,23 +961,6 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, drawmode = lastmode; } -void lcd_puts_style(int x, int y, const unsigned char *str, int style) -{ - lcd_puts_style_offset(x, y, str, style, 0); -} - -/* put a string at a given char position at a given offset mark */ -void lcd_puts_offset(int x, int y, const unsigned char *str, int offset) -{ - lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset); -} - -/* put a string at a given char position */ -void lcd_puts(int x, int y, const unsigned char *str) -{ - lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0); -} - /*** scrolling ***/ /* Reverse the invert setting of the scrolling line (if any) at given char @@ -1002,20 +1002,21 @@ void lcd_bidir_scroll(int percent) void lcd_puts_scroll(int x, int y, const unsigned char *string) { - lcd_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, 0); + lcd_puts_scroll_style(x, y, string, STYLE_DEFAULT); } -void lcd_puts_scroll_offset(int x, int y, const unsigned char *string, int offset) -{ - lcd_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset); -} - void lcd_puts_scroll_style(int x, int y, const unsigned char *string, int style) { lcd_puts_scroll_style_offset(x, y, string, style, 0); } -void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string, +void lcd_puts_scroll_offset(int x, int y, const unsigned char *string, + int offset) +{ + lcd_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset); +} + +void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string, int style, int offset) { struct scrollinfo* s; @@ -1130,7 +1131,8 @@ static void scroll_thread(void) lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); drawmode = DRMODE_SOLID; lcd_putsxyofs(xpos, ypos, s->offset, s->line); - if (s->invert) { + if (s->invert) + { drawmode = DRMODE_COMPLEMENT; lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); } diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h index 2795c7b..8e5fa95 100644 --- a/firmware/export/lcd-remote.h +++ b/firmware/export/lcd-remote.h @@ -37,13 +37,11 @@ extern void lcd_remote_emireduce(bool state); extern void lcd_remote_clear_display(void); extern void lcd_remote_puts(int x, int y, const unsigned char *string); extern void lcd_remote_puts_style(int x, int y, const unsigned char *string, - int style); + int style); extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset); extern void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset); - extern void lcd_remote_putc(int x, int y, unsigned short ch); extern void lcd_remote_stop_scroll(void); - extern void lcd_remote_scroll_speed(int speed); extern void lcd_remote_scroll_delay(int ms); extern void lcd_remote_puts_scroll(int x, int y, const unsigned char* string); |