fix filled block and handling of the lastline parameter

This commit is contained in:
marschap
2005-02-26 10:02:29 +00:00
parent a0e8aaf7f0
commit e55b1aa204
2 changed files with 15 additions and 17 deletions
+8 -9
View File
@@ -920,7 +920,7 @@ IOWarrior_num(Driver *drvthis, int x, int num)
PrivateData *p =(PrivateData *) drvthis->private_data;
/* each bignum is constructed in a 3 x 4 matrix and consists
* of only the 8 characters defiend above as well as ' '
* of only the 8 characters defined above as well as ' '
*
* The following table defines the 11 big numbers '0'-'9', ':'
* and the custom base characters they consist of
@@ -1025,17 +1025,16 @@ int row;
if (dat == NULL)
return;
if (!p->lastline)
dat[(p->cellheight - 1) * p->cellwidth] = 0;
for (row = 0; row < p->cellheight; row++) {
int letter = 0;
int col;
for (col = 0; col < p->cellwidth; col++) {
letter <<= 1;
letter |=(dat[(row * p->cellwidth) + col] > 0);
}
if (p->lastline || (row < p->cellheight - 1)) {
for (col = 0; col < p->cellwidth; col++) {
letter <<= 1;
letter |= (dat[(row * p->cellwidth) + col] > 0) ? 1 : 0;
}
}
if (p->cc[n].cache[row] != letter)
p->cc[n].clean = 0; /* only mark dirty if really different */
p->cc[n].cache[row] = letter;
@@ -1120,7 +1119,7 @@ char block_filled[CELLWIDTH*CELLHEIGHT] = {
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
0, 0, 0, 0, 0 };
1, 1, 1, 1, 1 };
/* Yes we know, this is a VERY BAD implementation */
switch(icon) {
+7 -8
View File
@@ -975,15 +975,14 @@ HD44780_set_char (Driver *drvthis, int n, char *dat)
if (!dat)
return;
if (!p->lastline)
dat[(p->cellheight - 1) * p->cellwidth]=0;
for (row = 0; row < p->cellheight; row++) {
letter = 0;
for (col = 0; col < p->cellwidth; col++) {
letter <<= 1;
letter |= (dat[(row * p->cellwidth) + col] > 0);
}
if (p->lastline || (row < p->cellheight - 1)) {
for (col = 0; col < p->cellwidth; col++) {
letter <<= 1;
letter |= (dat[(row * p->cellwidth) + col] > 0) ? 1 : 0;
}
}
if( p->cc_buf[n*p->cellheight+row] != letter ) {
p->cc_dirty[n] = 1; /* only mark as dirty if really different */
}
@@ -1068,7 +1067,7 @@ HD44780_icon (Driver *drvthis, int x, int y, int icon)
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
1, 1, 1, 1, 1,
0, 0, 0, 0, 0 };
1, 1, 1, 1, 1 };
/* Yes I know, this is a VERY BAD implementation */
switch( icon ) {