summaryrefslogtreecommitdiffstats
path: root/usr.bin/doscmd
diff options
context:
space:
mode:
authortg <tg@FreeBSD.org>2001-08-14 11:57:14 +0000
committertg <tg@FreeBSD.org>2001-08-14 11:57:14 +0000
commitb9cb79318cc062ba88c347408a23858f2356edce (patch)
tree99611d2723eda3d7cd15ba4ecfad219c2aedfb99 /usr.bin/doscmd
parent24059a36ee40d77d39e304cbb2c70e33d68c6c5f (diff)
downloadFreeBSD-src-b9cb79318cc062ba88c347408a23858f2356edce.zip
FreeBSD-src-b9cb79318cc062ba88c347408a23858f2356edce.tar.gz
Fix INT 10:09 (write char) and INT 10:0a (write char and attribute)
when cursor is at the lower right corner. PR: 29574 29601 Submitted by: Nils M Holm <nmh@t3x.org>
Diffstat (limited to 'usr.bin/doscmd')
-rw-r--r--usr.bin/doscmd/tty.c20
-rw-r--r--usr.bin/doscmd/tty.h2
2 files changed, 12 insertions, 10 deletions
diff --git a/usr.bin/doscmd/tty.c b/usr.bin/doscmd/tty.c
index 356fef7..e7a9dd5 100644
--- a/usr.bin/doscmd/tty.c
+++ b/usr.bin/doscmd/tty.c
@@ -1427,7 +1427,7 @@ tty_flush()
}
void
-tty_index()
+tty_index(int scroll)
{
int i;
@@ -1435,9 +1435,11 @@ tty_index()
row = 0;
else if (++row >= height) {
row = height - 1;
- memcpy(vmem, &vmem[width], 2 * width * (height - 1));
- for (i = 0; i < width; ++i)
- vmem[(height - 1) * width + i] = vattr | ' ';
+ if (scroll) {
+ memcpy(vmem, &vmem[width], 2 * width * (height - 1));
+ for (i = 0; i < width; ++i)
+ vmem[(height - 1) * width + i] = vattr | ' ';
+ }
}
SetVREGCur();
}
@@ -1479,19 +1481,19 @@ tty_write(int c, int attr)
col = (col + 8) & ~0x07;
if (col > width) {
col = 0;
- tty_index();
+ tty_index(1);
}
break;
case '\r':
col = 0;
break;
case '\n':
- tty_index();
+ tty_index(1);
break;
default:
if (col >= width) {
col = 0;
- tty_index();
+ tty_index(1);
}
if (row > (height - 1))
row = 0;
@@ -1523,7 +1525,7 @@ tty_rwrite(int n, int c, int attr)
while (n--) {
if (col >= width) {
col = 0;
- tty_index();
+ tty_index(0);
}
if (row > (height - 1))
row = 0;
@@ -1554,7 +1556,7 @@ tty_rwrite_graphics(int n, int c, int attr)
while (n--) {
if (col >= wd) {
col = 0;
- /* tty_index(); *//* scroll up if last line is filled */
+ /* tty_index(0); *//* scroll up if last line is filled */
}
if (row > (ht - 1))
row = 0;
diff --git a/usr.bin/doscmd/tty.h b/usr.bin/doscmd/tty.h
index 16ec477..0581dd1 100644
--- a/usr.bin/doscmd/tty.h
+++ b/usr.bin/doscmd/tty.h
@@ -52,7 +52,7 @@ int tty_char(int, int);
int tty_eread(REGISTERS, int, int);
int tty_estate(void);
void tty_flush(void);
-void tty_index(void);
+void tty_index(int);
void tty_move(int, int);
int tty_read(regcontext_t *, int);
void tty_report(int *, int *);
OpenPOWER on IntegriCloud