summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-2bit-vi.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-2bit-vi.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-2bit-vi.c')
-rw-r--r--firmware/drivers/lcd-2bit-vi.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/firmware/drivers/lcd-2bit-vi.c b/firmware/drivers/lcd-2bit-vi.c
index 7d97f19174..9decc0cbab 100644
--- a/firmware/drivers/lcd-2bit-vi.c
+++ b/firmware/drivers/lcd-2bit-vi.c
@@ -60,8 +60,6 @@ static struct viewport default_vp =
60 .height = LCDM(HEIGHT), 60 .height = LCDM(HEIGHT),
61 .font = FONT_SYSFIXED, 61 .font = FONT_SYSFIXED,
62 .drawmode = DRMODE_SOLID, 62 .drawmode = DRMODE_SOLID,
63 .xmargin = 0,
64 .ymargin = 0,
65 .fg_pattern = LCDM(DEFAULT_FG), 63 .fg_pattern = LCDM(DEFAULT_FG),
66 .bg_pattern = LCDM(DEFAULT_BG) 64 .bg_pattern = LCDM(DEFAULT_BG)
67}; 65};
@@ -175,23 +173,6 @@ int LCDFN(getheight)(void)
175{ 173{
176 return current_vp->height; 174 return current_vp->height;
177} 175}
178
179void LCDFN(setmargins)(int x, int y)
180{
181 current_vp->xmargin = x;
182 current_vp->ymargin = y;
183}
184
185int LCDFN(getxmargin)(void)
186{
187 return current_vp->xmargin;
188}
189
190int LCDFN(getymargin)(void)
191{
192 return current_vp->ymargin;
193}
194
195void LCDFN(setfont)(int newfont) 176void LCDFN(setfont)(int newfont)
196{ 177{
197 current_vp->font = newfont; 178 current_vp->font = newfont;
@@ -1105,8 +1086,8 @@ void LCDFN(puts_style_offset)(int x, int y, const unsigned char *str,
1105 return; 1086 return;
1106 1087
1107 LCDFN(getstringsize)(str, &w, &h); 1088 LCDFN(getstringsize)(str, &w, &h);
1108 xpos = current_vp->xmargin + x*w / utf8length((char *)str); 1089 xpos = x*w / utf8length((char *)str);
1109 ypos = current_vp->ymargin + y*h; 1090 ypos = y*h;
1110 current_vp->drawmode = (style & STYLE_INVERT) ? 1091 current_vp->drawmode = (style & STYLE_INVERT) ?
1111 (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; 1092 (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
1112 LCDFN(putsxyofs)(xpos, ypos, offset, str); 1093 LCDFN(putsxyofs)(xpos, ypos, offset, str);
@@ -1158,7 +1139,7 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
1158 1139
1159 LCDFN(getstringsize)(string, &w, &h); 1140 LCDFN(getstringsize)(string, &w, &h);
1160 1141
1161 if (current_vp->width - x * 8 - current_vp->xmargin < w) { 1142 if (current_vp->width - x * 8 < w) {
1162 /* prepare scroll line */ 1143 /* prepare scroll line */
1163 char *end; 1144 char *end;
1164 1145
@@ -1171,7 +1152,7 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
1171 /* scroll bidirectional or forward only depending on the string 1152 /* scroll bidirectional or forward only depending on the string
1172 width */ 1153 width */
1173 if ( LCDFN(scroll_info).bidir_limit ) { 1154 if ( LCDFN(scroll_info).bidir_limit ) {
1174 s->bidir = s->width < (current_vp->width - current_vp->xmargin) * 1155 s->bidir = s->width < (current_vp->width) *
1175 (100 + LCDFN(scroll_info).bidir_limit) / 100; 1156 (100 + LCDFN(scroll_info).bidir_limit) / 100;
1176 } 1157 }
1177 else 1158 else
@@ -1190,7 +1171,7 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
1190 s->y = y; 1171 s->y = y;
1191 s->len = utf8length((char *)string); 1172 s->len = utf8length((char *)string);
1192 s->offset = offset; 1173 s->offset = offset;
1193 s->startx = current_vp->xmargin + x * s->width / s->len; 1174 s->startx = x * s->width / s->len;
1194 s->backward = false; 1175 s->backward = false;
1195 1176
1196 LCDFN(scroll_info).lines++; 1177 LCDFN(scroll_info).lines++;
@@ -1222,7 +1203,7 @@ void LCDFN(scroll_fn)(void)
1222 1203
1223 pf = font_get(current_vp->font); 1204 pf = font_get(current_vp->font);
1224 xpos = s->startx; 1205 xpos = s->startx;
1225 ypos = current_vp->ymargin + s->y * pf->height; 1206 ypos = s->y * pf->height;
1226 1207
1227 if (s->bidir) { /* scroll bidirectional */ 1208 if (s->bidir) { /* scroll bidirectional */
1228 if (s->offset <= 0) { 1209 if (s->offset <= 0) {