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
+5 -6
View File
@@ -920,7 +920,7 @@ IOWarrior_num(Driver *drvthis, int x, int num)
PrivateData *p =(PrivateData *) drvthis->private_data; PrivateData *p =(PrivateData *) drvthis->private_data;
/* each bignum is constructed in a 3 x 4 matrix and consists /* 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', ':' * The following table defines the 11 big numbers '0'-'9', ':'
* and the custom base characters they consist of * and the custom base characters they consist of
@@ -1025,16 +1025,15 @@ int row;
if (dat == NULL) if (dat == NULL)
return; return;
if (!p->lastline)
dat[(p->cellheight - 1) * p->cellwidth] = 0;
for (row = 0; row < p->cellheight; row++) { for (row = 0; row < p->cellheight; row++) {
int letter = 0; int letter = 0;
int col; int col;
if (p->lastline || (row < p->cellheight - 1)) {
for (col = 0; col < p->cellwidth; col++) { for (col = 0; col < p->cellwidth; col++) {
letter <<= 1; letter <<= 1;
letter |=(dat[(row * p->cellwidth) + col] > 0); letter |= (dat[(row * p->cellwidth) + col] > 0) ? 1 : 0;
}
} }
if (p->cc[n].cache[row] != letter) if (p->cc[n].cache[row] != letter)
p->cc[n].clean = 0; /* only mark dirty if really different */ p->cc[n].clean = 0; /* only mark dirty if really different */
@@ -1120,7 +1119,7 @@ char block_filled[CELLWIDTH*CELLHEIGHT] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 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 */ /* Yes we know, this is a VERY BAD implementation */
switch(icon) { switch(icon) {
+4 -5
View File
@@ -975,14 +975,13 @@ HD44780_set_char (Driver *drvthis, int n, char *dat)
if (!dat) if (!dat)
return; return;
if (!p->lastline)
dat[(p->cellheight - 1) * p->cellwidth]=0;
for (row = 0; row < p->cellheight; row++) { for (row = 0; row < p->cellheight; row++) {
letter = 0; letter = 0;
if (p->lastline || (row < p->cellheight - 1)) {
for (col = 0; col < p->cellwidth; col++) { for (col = 0; col < p->cellwidth; col++) {
letter <<= 1; letter <<= 1;
letter |= (dat[(row * p->cellwidth) + col] > 0); letter |= (dat[(row * p->cellwidth) + col] > 0) ? 1 : 0;
}
} }
if( p->cc_buf[n*p->cellheight+row] != letter ) { if( p->cc_buf[n*p->cellheight+row] != letter ) {
p->cc_dirty[n] = 1; /* only mark as dirty if really different */ 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, 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 */ /* Yes I know, this is a VERY BAD implementation */
switch( icon ) { switch( icon ) {