diff options
Diffstat (limited to 'firmware/drivers/lcd-2bit-vi.c')
-rw-r--r-- | firmware/drivers/lcd-2bit-vi.c | 31 |
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 | |||
179 | void LCDFN(setmargins)(int x, int y) | ||
180 | { | ||
181 | current_vp->xmargin = x; | ||
182 | current_vp->ymargin = y; | ||
183 | } | ||
184 | |||
185 | int LCDFN(getxmargin)(void) | ||
186 | { | ||
187 | return current_vp->xmargin; | ||
188 | } | ||
189 | |||
190 | int LCDFN(getymargin)(void) | ||
191 | { | ||
192 | return current_vp->ymargin; | ||
193 | } | ||
194 | |||
195 | void LCDFN(setfont)(int newfont) | 176 | void 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) { |