patch-2.1.130 linux/drivers/video/fbcon-iplan2p4.c
Next file: linux/drivers/video/fbcon-iplan2p8.c
Previous file: linux/drivers/video/fbcon-iplan2p2.c
Back to the patch index
Back to the overall index
- Lines: 123
- Date:
Wed Nov 25 14:53:50 1998
- Orig file:
v2.1.129/linux/drivers/video/fbcon-iplan2p4.c
- Orig date:
Thu Nov 19 09:56:28 1998
diff -u --recursive --new-file v2.1.129/linux/drivers/video/fbcon-iplan2p4.c linux/drivers/video/fbcon-iplan2p4.c
@@ -177,18 +177,25 @@
/* Special (but often used) case: Moving whole lines can be
*done with memmove()
*/
- mymemmove(p->screen_base + ((dy * p->next_line) << fontheightlog(p)),
- p->screen_base + ((sy * p->next_line) << fontheightlog(p)),
- (p->next_line * height) << fontheightlog(p));
+ mymemmove(p->screen_base + dy * p->next_line * fontheight(p),
+ p->screen_base + sy * p->next_line * fontheight(p),
+ p->next_line * height * fontheight(p));
} else {
int rows, cols;
u8 *src;
u8 *dst;
int bytes = p->next_line;
- int linesize = bytes << fontheightlog(p);
- u_int colsize = height << fontheightlog(p);
+ int linesize;
+ u_int colsize;
u_int upwards = (dy < sy) || (dy == sy && dx < sx);
+ if (fontheightlog(p)) {
+ linesize = bytes << fontheightlog(p);
+ colsize = height << fontheightlog(p);
+ } else {
+ linesize = bytes * fontheight(p);
+ colsize = height * fontheight(p);
+ }
if ((sx & 1) == (dx & 1)) {
/* odd->odd or even->even */
@@ -269,18 +276,29 @@
u8 *start;
int rows;
int bytes = p->next_line;
- int lines = height << fontheightlog(p);
+ int lines;
u32 size;
u32 cval1, cval2, pcval;
expand4dl(attr_bgcol_ec(p,conp), &cval1, &cval2);
+ if (fontheightlog(p))
+ lines = height << fontheightlog(p);
+ else
+ lines = height * fontheight(p);
+
if (sx == 0 && width * 4 == bytes) {
- offset = (sy * bytes) << fontheightlog(p);
+ if (fontheightlog(p))
+ offset = (sy * bytes) << fontheightlog(p);
+ else
+ offset = sy * bytes * fontheight(p);
size = lines * bytes;
memset_even_4p(p->screen_base+offset, size, cval1, cval2);
} else {
- offset = ((sy * bytes) << fontheightlog(p)) + (sx>>1)*8 + (sx & 1);
+ if (fontheightlog(p))
+ offset = ((sy * bytes) << fontheightlog(p)) + (sx>>1)*8 + (sx & 1);
+ else
+ offset = sy * bytes * fontheight(p) + (sx>>1)*8 + (sx & 1);
start = p->screen_base + offset;
pcval = expand4l(attr_bgcol_ec(p,conp));
@@ -316,8 +334,15 @@
int bytes = p->next_line;
u32 eorx, fgx, bgx, fdx;
- dest = p->screen_base + ((yy * bytes) << fontheightlog(p)) + (xx>>1)*8 + (xx & 1);
- cdat = p->fontdata + ((c & p->charmask) << fontheightlog(p));
+ if (fontheightlog(p)) {
+ dest = (p->screen_base + ((yy * bytes) << fontheightlog(p)) +
+ (xx>>1)*8 + (xx & 1));
+ cdat = p->fontdata + ((c & p->charmask) << fontheightlog(p));
+ } else {
+ dest = (p->screen_base + yy * bytes * fontheight(p) +
+ (xx>>1)*8 + (xx & 1));
+ cdat = p->fontdata + (c & p->charmask) * fontheight(p);
+ }
fgx = expand4l(attr_fgcol(p,c));
bgx = expand4l(attr_bgcol(p,c));
@@ -340,7 +365,12 @@
u32 eorx, fgx, bgx, fdx;
bytes = p->next_line;
- dest0 = p->screen_base + ((yy * bytes) << fontheightlog(p)) + (xx>>1)*8 + (xx & 1);
+ if (fontheightlog(p))
+ dest0 = (p->screen_base + ((yy * bytes) << fontheightlog(p)) +
+ (xx>>1)*8 + (xx & 1));
+ else
+ dest0 = (p->screen_base + yy * bytes * fontheight(p) +
+ (xx>>1)*8 + (xx & 1));
fgx = expand4l(attr_fgcol(p,*s));
bgx = expand4l(attr_bgcol(p,*s));
eorx = fgx ^ bgx;
@@ -354,7 +384,10 @@
*/
c = *s++ & p->charmask;
- cdat = p->fontdata + (c << fontheightlog(p));
+ if (fontheightlog(p))
+ cdat = p->fontdata + (c << fontheightlog(p));
+ else
+ cdat = p->fontdata + c * fontheight(p);
for(rows = fontheight(p), dest = dest0; rows-- ; dest += bytes) {
fdx = dup4l(*cdat++);
@@ -370,8 +403,12 @@
int j;
int bytes;
- dest = (p->screen_base + ((yy * p->next_line) << fontheightlog(p)) +
- (xx>>1)*8 + (xx & 1));
+ if (fontheightlog(p))
+ dest = (p->screen_base + ((yy * p->next_line) << fontheightlog(p)) +
+ (xx>>1)*8 + (xx & 1));
+ else
+ dest = (p->screen_base + yy * p->next_line * fontheight(p) +
+ (xx>>1)*8 + (xx & 1));
j = fontheight(p);
bytes = p->next_line;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov