summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-16bit.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2008-06-23 13:20:35 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2008-06-23 13:20:35 +0000
commitbdbdb97f19655a635a2d37f81f9fe1e31f9162b2 (patch)
treeea5672478b70e550910bc179a7644afa70c0d057 /firmware/drivers/lcd-16bit.c
parentc1b8df05e1def3096ff6d2ea55f23b2e72936fce (diff)
downloadrockbox-bdbdb97f19655a635a2d37f81f9fe1e31f9162b2.tar.gz
rockbox-bdbdb97f19655a635a2d37f81f9fe1e31f9162b2.zip
FS#9051 - remove LCD margins... use viewports if you need them...
NOTE to WPS people.... %m has been removed, but (i think) because of the other %m tags it wont fail if you try loading a wps with %m|..|, it will just be ignored. Also note that if the statusbar is enabled the default viewport is 8 pixels shorter than when its not, i.e (0,0) is really (0,8) if the statusbar is shown... I dont think this will be a major issue because almost no WPS show the bar and use bitmaps... text only WPS shouldnt be affected. Please report problem screens in http://forums.rockbox.org/index.php?topic=17358.0 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17763 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd-16bit.c')
-rw-r--r--firmware/drivers/lcd-16bit.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c
index 020d6bf63a..a5b7533cc1 100644
--- a/firmware/drivers/lcd-16bit.c
+++ b/firmware/drivers/lcd-16bit.c
@@ -61,8 +61,6 @@ static struct viewport default_vp =
61 .height = LCD_HEIGHT, 61 .height = LCD_HEIGHT,
62 .font = FONT_SYSFIXED, 62 .font = FONT_SYSFIXED,
63 .drawmode = DRMODE_SOLID, 63 .drawmode = DRMODE_SOLID,
64 .xmargin = 0,
65 .ymargin = 0,
66 .fg_pattern = LCD_DEFAULT_FG, 64 .fg_pattern = LCD_DEFAULT_FG,
67 .bg_pattern = LCD_DEFAULT_BG, 65 .bg_pattern = LCD_DEFAULT_BG,
68 .lss_pattern = LCD_DEFAULT_BG, 66 .lss_pattern = LCD_DEFAULT_BG,
@@ -180,12 +178,6 @@ void lcd_set_drawinfo(int mode, unsigned fg_color, unsigned bg_color)
180 current_vp->bg_pattern = bg_color; 178 current_vp->bg_pattern = bg_color;
181} 179}
182 180
183void lcd_setmargins(int x, int y)
184{
185 current_vp->xmargin = x;
186 current_vp->ymargin = y;
187}
188
189int lcd_getwidth(void) 181int lcd_getwidth(void)
190{ 182{
191 return current_vp->width; 183 return current_vp->width;
@@ -196,16 +188,6 @@ int lcd_getheight(void)
196 return current_vp->height; 188 return current_vp->height;
197} 189}
198 190
199int lcd_getxmargin(void)
200{
201 return current_vp->xmargin;
202}
203
204int lcd_getymargin(void)
205{
206 return current_vp->ymargin;
207}
208
209void lcd_setfont(int newfont) 191void lcd_setfont(int newfont)
210{ 192{
211 current_vp->font = newfont; 193 current_vp->font = newfont;
@@ -1005,8 +987,8 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style,
1005 return; 987 return;
1006 988
1007 lcd_getstringsize(str, &w, &h); 989 lcd_getstringsize(str, &w, &h);
1008 xpos = current_vp->xmargin + x*w / utf8length(str); 990 xpos = x*w / utf8length(str);
1009 ypos = current_vp->ymargin + y*h; 991 ypos = y*h;
1010 current_vp->drawmode = (style & STYLE_INVERT) ? 992 current_vp->drawmode = (style & STYLE_INVERT) ?
1011 (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; 993 (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
1012 if (style & STYLE_COLORED) { 994 if (style & STYLE_COLORED) {
@@ -1081,7 +1063,7 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
1081 1063
1082 lcd_getstringsize(string, &w, &h); 1064 lcd_getstringsize(string, &w, &h);
1083 1065
1084 if (current_vp->width - x * 8 - current_vp->xmargin < w) { 1066 if (current_vp->width - x * 8 < w) {
1085 /* prepare scroll line */ 1067 /* prepare scroll line */
1086 char *end; 1068 char *end;
1087 1069
@@ -1094,7 +1076,7 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
1094 /* scroll bidirectional or forward only depending on the string 1076 /* scroll bidirectional or forward only depending on the string
1095 width */ 1077 width */
1096 if ( lcd_scroll_info.bidir_limit ) { 1078 if ( lcd_scroll_info.bidir_limit ) {
1097 s->bidir = s->width < (current_vp->width - current_vp->xmargin) * 1079 s->bidir = s->width < (current_vp->width) *
1098 (100 + lcd_scroll_info.bidir_limit) / 100; 1080 (100 + lcd_scroll_info.bidir_limit) / 100;
1099 } 1081 }
1100 else 1082 else
@@ -1113,7 +1095,7 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
1113 s->y = y; 1095 s->y = y;
1114 s->len = utf8length(string); 1096 s->len = utf8length(string);
1115 s->offset = offset; 1097 s->offset = offset;
1116 s->startx = current_vp->xmargin + x * s->width / s->len; 1098 s->startx = x * s->width / s->len;
1117 s->backward = false; 1099 s->backward = false;
1118 lcd_scroll_info.lines++; 1100 lcd_scroll_info.lines++;
1119 } 1101 }
@@ -1159,7 +1141,7 @@ void lcd_scroll_fn(void)
1159 1141
1160 pf = font_get(current_vp->font); 1142 pf = font_get(current_vp->font);
1161 xpos = s->startx; 1143 xpos = s->startx;
1162 ypos = current_vp->ymargin + s->y * pf->height; 1144 ypos = s->y * pf->height;
1163 1145
1164 if (s->bidir) { /* scroll bidirectional */ 1146 if (s->bidir) { /* scroll bidirectional */
1165 if (s->offset <= 0) { 1147 if (s->offset <= 0) {