summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@rockbox.org>2006-01-22 04:24:26 +0000
committerBrandon Low <lostlogic@rockbox.org>2006-01-22 04:24:26 +0000
commitd3a03b679f196be076043d475b9512338fd6c8bb (patch)
treec4c57a157a46d09a7037c39e290182a8c43deb71 /firmware
parentbfe740712a3513dbb4143336cbc5e9aaab09d732 (diff)
downloadrockbox-d3a03b679f196be076043d475b9512338fd6c8bb.tar.gz
rockbox-d3a03b679f196be076043d475b9512338fd6c8bb.zip
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.c16
-rw-r--r--firmware/drivers/lcd-h100.c44
-rw-r--r--firmware/drivers/lcd-recorder.c58
-rw-r--r--firmware/export/lcd-remote.h4
4 files changed, 62 insertions, 60 deletions
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c
index a28cd2f4e5..3be907a574 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)
1138/* put a string at a given char position */ 1138/* put a string at a given char position */
1139void lcd_remote_puts(int x, int y, const unsigned char *str) 1139void lcd_remote_puts(int x, int y, const unsigned char *str)
1140{ 1140{
1141 lcd_remote_puts_style(x, y, str, STYLE_DEFAULT); 1141 lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, 0);
1142} 1142}
1143 1143
1144void lcd_remote_puts_style(int x, int y, const unsigned char *str, int style) 1144void 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)
1151 lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, offset); 1151 lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, offset);
1152} 1152}
1153 1153
1154/* put a string at a given char position at a given style and with a given offset */ 1154/* put a string at a given char position, style, and pixel position,
1155 * skipping first offset pixel columns */
1155void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset) 1156void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset)
1156{ 1157{
1157 int xpos,ypos,w,h; 1158 int xpos,ypos,w,h;
@@ -1223,16 +1224,16 @@ void lcd_remote_puts_scroll(int x, int y, const unsigned char *string)
1223 1224
1224void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *string, int style) 1225void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *string, int style)
1225{ 1226{
1226 lcd_remote_puts_scroll_style_offset(x, y, string, style, 0); 1227 lcd_remote_puts_scroll_style_offset(x, y, string, style, 0);
1227} 1228}
1228 1229
1229void lcd_remote_puts_scroll_offset(int x, int y, const unsigned char *string, int offset) 1230void lcd_remote_puts_scroll_offset(int x, int y, const unsigned char *string, int offset)
1230{ 1231{
1231 lcd_remote_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset); 1232 lcd_remote_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset);
1232} 1233}
1233 1234
1234void lcd_remote_puts_scroll_style_offset(int x, int y, const unsigned char *string, 1235void lcd_remote_puts_scroll_style_offset(int x, int y, const unsigned char *string,
1235 int style, int offset) 1236 int style, int offset)
1236{ 1237{
1237 struct scrollinfo* s; 1238 struct scrollinfo* s;
1238 int w, h; 1239 int w, h;
@@ -1289,7 +1290,6 @@ void lcd_remote_puts_scroll_style_offset(int x, int y, const unsigned char *stri
1289 scrolling_lines &= ~(1<<y); 1290 scrolling_lines &= ~(1<<y);
1290} 1291}
1291 1292
1292
1293static void scroll_thread(void) 1293static void scroll_thread(void)
1294{ 1294{
1295 struct font* pf; 1295 struct font* pf;
diff --git a/firmware/drivers/lcd-h100.c b/firmware/drivers/lcd-h100.c
index 0df1a3c71a..685984522d 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)
1057 1057
1058/*** line oriented text output ***/ 1058/*** line oriented text output ***/
1059 1059
1060/* put a string at a given char position at a given style and with a given pixel position */ 1060/* put a string at a given char position */
1061void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, 1061void lcd_puts(int x, int y, const unsigned char *str)
1062 int offset) 1062{
1063 lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0);
1064}
1065
1066void lcd_puts_style(int x, int y, const unsigned char *str, int style)
1067{
1068 lcd_puts_style_offset(x, y, str, style, 0);
1069}
1070
1071void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
1072{
1073 lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset);
1074}
1075
1076/* put a string at a given char position, style, and pixel position,
1077 * skipping first offset pixel columns */
1078void lcd_puts_style_offset(int x, int y, const unsigned char *str,
1079 int style, int offset)
1063{ 1080{
1064 int xpos,ypos,w,h; 1081 int xpos,ypos,w,h;
1065 int lastmode = drawmode; 1082 int lastmode = drawmode;
@@ -1083,22 +1100,6 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style,
1083 } 1100 }
1084 drawmode = lastmode; 1101 drawmode = lastmode;
1085} 1102}
1086void lcd_puts_style(int x, int y, const unsigned char *str, int style)
1087{
1088 lcd_puts_style_offset(x, y, str, style, 0);
1089}
1090
1091/* put a string at a given char position at a given offset mark */
1092void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
1093{
1094 lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset);
1095}
1096
1097/* put a string at a given char position */
1098void lcd_puts(int x, int y, const unsigned char *str)
1099{
1100 lcd_puts_style(x, y, str, STYLE_DEFAULT);
1101}
1102 1103
1103/*** scrolling ***/ 1104/*** scrolling ***/
1104 1105
@@ -1226,7 +1227,7 @@ static void scroll_thread(void)
1226 while ( 1 ) { 1227 while ( 1 ) {
1227 for ( index = 0; index < SCROLLABLE_LINES; index++ ) { 1228 for ( index = 0; index < SCROLLABLE_LINES; index++ ) {
1228 /* really scroll? */ 1229 /* really scroll? */
1229 if ( !(scrolling_lines&(1<<index))) 1230 if ( !(scrolling_lines&(1<<index)) )
1230 continue; 1231 continue;
1231 1232
1232 s = &scroll[index]; 1233 s = &scroll[index];
@@ -1269,7 +1270,8 @@ static void scroll_thread(void)
1269 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); 1270 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
1270 drawmode = DRMODE_SOLID; 1271 drawmode = DRMODE_SOLID;
1271 lcd_putsxyofs(xpos, ypos, s->offset, (unsigned char *)s->line); 1272 lcd_putsxyofs(xpos, ypos, s->offset, (unsigned char *)s->line);
1272 if (s->invert) { 1273 if (s->invert)
1274 {
1273 drawmode = DRMODE_COMPLEMENT; 1275 drawmode = DRMODE_COMPLEMENT;
1274 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); 1276 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
1275 } 1277 }
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c
index 9f8a2b6568..b7bcd02cec 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)
917 917
918/*** Line oriented text output ***/ 918/*** Line oriented text output ***/
919 919
920/* put a string at a given char position at a given style and with a given pixel position */ 920/* put a string at a given char position */
921void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, 921void lcd_puts(int x, int y, const unsigned char *str)
922 int offset) 922{
923 lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0);
924}
925
926void lcd_puts_style(int x, int y, const unsigned char *str, int style)
927{
928 lcd_puts_style_offset(x, y, str, style, 0);
929}
930
931void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
932{
933 lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset);
934}
935
936/* put a string at a given char position, style, and pixel position,
937 * skipping first offset pixel columns */
938void lcd_puts_style_offset(int x, int y, const unsigned char *str,
939 int style, int offset)
923{ 940{
924 int xpos,ypos,w,h; 941 int xpos,ypos,w,h;
925 int lastmode = drawmode; 942 int lastmode = drawmode;
@@ -944,23 +961,6 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style,
944 drawmode = lastmode; 961 drawmode = lastmode;
945} 962}
946 963
947void lcd_puts_style(int x, int y, const unsigned char *str, int style)
948{
949 lcd_puts_style_offset(x, y, str, style, 0);
950}
951
952/* put a string at a given char position at a given offset mark */
953void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
954{
955 lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset);
956}
957
958/* put a string at a given char position */
959void lcd_puts(int x, int y, const unsigned char *str)
960{
961 lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0);
962}
963
964/*** scrolling ***/ 964/*** scrolling ***/
965 965
966/* Reverse the invert setting of the scrolling line (if any) at given char 966/* Reverse the invert setting of the scrolling line (if any) at given char
@@ -1002,20 +1002,21 @@ void lcd_bidir_scroll(int percent)
1002 1002
1003void lcd_puts_scroll(int x, int y, const unsigned char *string) 1003void lcd_puts_scroll(int x, int y, const unsigned char *string)
1004{ 1004{
1005 lcd_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, 0); 1005 lcd_puts_scroll_style(x, y, string, STYLE_DEFAULT);
1006} 1006}
1007 1007
1008void lcd_puts_scroll_offset(int x, int y, const unsigned char *string, int offset)
1009{
1010 lcd_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset);
1011}
1012
1013void lcd_puts_scroll_style(int x, int y, const unsigned char *string, int style) 1008void lcd_puts_scroll_style(int x, int y, const unsigned char *string, int style)
1014{ 1009{
1015 lcd_puts_scroll_style_offset(x, y, string, style, 0); 1010 lcd_puts_scroll_style_offset(x, y, string, style, 0);
1016} 1011}
1017 1012
1018void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string, 1013void lcd_puts_scroll_offset(int x, int y, const unsigned char *string,
1014 int offset)
1015{
1016 lcd_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset);
1017}
1018
1019void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
1019 int style, int offset) 1020 int style, int offset)
1020{ 1021{
1021 struct scrollinfo* s; 1022 struct scrollinfo* s;
@@ -1130,7 +1131,8 @@ static void scroll_thread(void)
1130 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); 1131 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
1131 drawmode = DRMODE_SOLID; 1132 drawmode = DRMODE_SOLID;
1132 lcd_putsxyofs(xpos, ypos, s->offset, s->line); 1133 lcd_putsxyofs(xpos, ypos, s->offset, s->line);
1133 if (s->invert) { 1134 if (s->invert)
1135 {
1134 drawmode = DRMODE_COMPLEMENT; 1136 drawmode = DRMODE_COMPLEMENT;
1135 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); 1137 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
1136 } 1138 }
diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h
index 2795c7b90d..8e5fa950b1 100644
--- a/firmware/export/lcd-remote.h
+++ b/firmware/export/lcd-remote.h
@@ -37,13 +37,11 @@ extern void lcd_remote_emireduce(bool state);
37extern void lcd_remote_clear_display(void); 37extern void lcd_remote_clear_display(void);
38extern void lcd_remote_puts(int x, int y, const unsigned char *string); 38extern void lcd_remote_puts(int x, int y, const unsigned char *string);
39extern void lcd_remote_puts_style(int x, int y, const unsigned char *string, 39extern void lcd_remote_puts_style(int x, int y, const unsigned char *string,
40 int style); 40 int style);
41extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset); 41extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset);
42extern void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset); 42extern void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset);
43
44extern void lcd_remote_putc(int x, int y, unsigned short ch); 43extern void lcd_remote_putc(int x, int y, unsigned short ch);
45extern void lcd_remote_stop_scroll(void); 44extern void lcd_remote_stop_scroll(void);
46
47extern void lcd_remote_scroll_speed(int speed); 45extern void lcd_remote_scroll_speed(int speed);
48extern void lcd_remote_scroll_delay(int ms); 46extern void lcd_remote_scroll_delay(int ms);
49extern void lcd_remote_puts_scroll(int x, int y, const unsigned char* string); 47extern void lcd_remote_puts_scroll(int x, int y, const unsigned char* string);