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.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.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 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 */ |
1139 | void lcd_remote_puts(int x, int y, const unsigned char *str) | 1139 | void 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 | ||
1144 | void lcd_remote_puts_style(int x, int y, const unsigned char *str, int style) | 1144 | 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) | |||
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 */ | ||
1155 | void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset) | 1156 | void 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 | ||
1224 | void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *string, int style) | 1225 | void 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 | ||
1229 | void lcd_remote_puts_scroll_offset(int x, int y, const unsigned char *string, int offset) | 1230 | void 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 | ||
1234 | void lcd_remote_puts_scroll_style_offset(int x, int y, const unsigned char *string, | 1235 | void 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 | |||
1293 | static void scroll_thread(void) | 1293 | static 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 */ |
1061 | void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, | 1061 | void 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 | |||
1066 | void 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 | |||
1071 | void 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 */ | ||
1078 | void 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 | } |
1086 | void 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 */ | ||
1092 | void 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 */ | ||
1098 | void 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 */ |
921 | void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, | 921 | void 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 | |||
926 | void 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 | |||
931 | void 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 */ | ||
938 | void 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 | ||
947 | void 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 */ | ||
953 | void 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 */ | ||
959 | void 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 | ||
1003 | void lcd_puts_scroll(int x, int y, const unsigned char *string) | 1003 | void 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 | ||
1008 | void 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 | |||
1013 | void lcd_puts_scroll_style(int x, int y, const unsigned char *string, int style) | 1008 | void 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 | ||
1018 | void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string, | 1013 | void 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 | |||
1019 | void 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); | |||
37 | extern void lcd_remote_clear_display(void); | 37 | extern void lcd_remote_clear_display(void); |
38 | extern void lcd_remote_puts(int x, int y, const unsigned char *string); | 38 | extern void lcd_remote_puts(int x, int y, const unsigned char *string); |
39 | extern void lcd_remote_puts_style(int x, int y, const unsigned char *string, | 39 | extern void lcd_remote_puts_style(int x, int y, const unsigned char *string, |
40 | int style); | 40 | int style); |
41 | extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset); | 41 | extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset); |
42 | extern void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset); | 42 | extern void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset); |
43 | |||
44 | extern void lcd_remote_putc(int x, int y, unsigned short ch); | 43 | extern void lcd_remote_putc(int x, int y, unsigned short ch); |
45 | extern void lcd_remote_stop_scroll(void); | 44 | extern void lcd_remote_stop_scroll(void); |
46 | |||
47 | extern void lcd_remote_scroll_speed(int speed); | 45 | extern void lcd_remote_scroll_speed(int speed); |
48 | extern void lcd_remote_scroll_delay(int ms); | 46 | extern void lcd_remote_scroll_delay(int ms); |
49 | extern void lcd_remote_puts_scroll(int x, int y, const unsigned char* string); | 47 | extern void lcd_remote_puts_scroll(int x, int y, const unsigned char* string); |