diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-06-30 15:27:26 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-06-30 15:27:26 +0000 |
commit | 46239127052c30fac93140fbe021cdd151fdac8a (patch) | |
tree | c8c97eaf41c960655be9226d7d7e9df28db7d6db /sys/arch/i386 | |
parent | cc0cdf0c1cdbb40090dc40b4e113f7ba313d5ef8 (diff) |
My previous two attempts at fixing the "scrolling region" problem were wrong.
Instead of using cur_offset to determine if we should scroll, calculate based
on the current row. This is how Linux does it, and it seems to work.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_out.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/sys/arch/i386/isa/pcvt/pcvt_out.c b/sys/arch/i386/isa/pcvt/pcvt_out.c index 5d54bc5cd1d..e491dffe2ca 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_out.c +++ b/sys/arch/i386/isa/pcvt/pcvt_out.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcvt_out.c,v 1.23 2000/06/11 18:57:35 aaron Exp $ */ +/* $OpenBSD: pcvt_out.c,v 1.24 2000/06/30 15:27:25 aaron Exp $ */ /* * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch. @@ -216,12 +216,10 @@ sput (u_char *s, U_char kernel, int len, int page) } if(svsp->lnm) { svsp->cur_offset -= svsp->col; - svsp->cur_offset += svsp->maxcol; svsp->col = 0; } - else { - svsp->cur_offset += svsp->maxcol; - } + svsp->row = svsp->cur_offset / svsp->maxcol; + svsp->cur_offset += svsp->maxcol; check_scroll(svsp); break; @@ -358,6 +356,7 @@ sput (u_char *s, U_char kernel, int len, int page) if (svsp->lastchar && svsp->m_awm && (svsp->lastrow == svsp->row)) { + svsp->row = svsp->cur_offset / svsp->maxcol; svsp->cur_offset++; svsp->col = 0; svsp->lastchar = 0; @@ -1300,17 +1299,11 @@ vt_coldmalloc(void) static void check_scroll(struct video_state *svsp) { - int region_size; - - region_size = (svsp->scrr_end + 1) * svsp->maxcol; - if(!svsp->abs_write) { /* we write within scroll region */ - if((svsp->cur_offset == region_size) || - (svsp->cur_offset > region_size && (svsp->scrr_end == - svsp->screen_rows - 1))) + if(svsp->row + 1 == svsp->scrr_len) { /* the following piece of code has to be protected */ /* from trying to switch to another virtual screen */ |