From owner-p4-projects@FreeBSD.ORG Sun Jun 12 23:47:14 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3C51416A420; Sun, 12 Jun 2005 23:47:14 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1180F16A41C for ; Sun, 12 Jun 2005 23:47:14 +0000 (GMT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C821243D1D for ; Sun, 12 Jun 2005 23:47:13 +0000 (GMT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5CNlDWI022684 for ; Sun, 12 Jun 2005 23:47:13 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5CNlDib022681 for perforce@freebsd.org; Sun, 12 Jun 2005 23:47:13 GMT (envelope-from marcel@freebsd.org) Date: Sun, 12 Jun 2005 23:47:13 GMT Message-Id: <200506122347.j5CNlDib022681@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Cc: Subject: PERFORCE change 78473 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2005 23:47:15 -0000 http://perforce.freebsd.org/chv.cgi?CH=78473 Change 78473 by marcel@marcel_nfs on 2005/06/12 23:47:02 Fix the tests that deal with scrolling. Improve the handling of wrap-around, although it's not completely fixed. This will be finished when vttest can be run, which requires input. Affected files ... .. //depot/projects/tty/sys/dev/vtc/vtc_te_vt102.c#4 edit Differences ... ==== //depot/projects/tty/sys/dev/vtc/vtc_te_vt102.c#4 (text+ko) ==== @@ -83,17 +83,20 @@ static __inline int vt102_repos(struct vt102_softc *vt102) { + int col; - vt102->wrap = 0; + col = vt102->col; + if (col == vt102->maxcol) + col--; return (vtc_te_repos(&vt102->base, vt102->row << vt102->dh, - vt102->col << vt102->dw)); + col << vt102->dw)); } static __inline int vt102_newline(struct vt102_softc *vt102) { - if (vt102->row == vt102->maxrow) + if (vt102->row == vt102->maxrow - 1) return (vtc_te_scroll(&vt102->base, 0, 0, vt102->maxrow << vt102->dh, vt102->maxcol << vt102->dw, 1 << vt102->dh)); @@ -113,16 +116,17 @@ if (vt102->autowrap && vt102->wrap) { vt102->col = 0; + vt102->wrap = 0; vt102_newline(vt102); } - vt102_putc(vt102, wc); - vt102->col++; - if (vt102->col > vt102->maxcol) { - vt102->col = vt102->maxcol; - if (vt102->autowrap) + if (vt102->col < vt102->maxcol) { + vt102_putc(vt102, wc); + vt102->col++; + if (vt102->col == vt102->maxcol && vt102->autowrap) vt102->wrap = 1; - } else - vt102_repos(vt102); + else + vt102_repos(vt102); + } return (0); } @@ -141,15 +145,23 @@ case 0x08: /* BS */ if (vt102->col > 0) { vt102->col--; + vt102->wrap = 0; vt102_putc(vt102, ' '); vt102_repos(vt102); } break; case 0x09: /* HT */ + if (vt102->autowrap && vt102->wrap) { + vt102->col = 0; + vt102->wrap = 0; + vt102_newline(vt102); + } if (vt102->col < vt102->maxcol) { vt102->col = (vt102->col + 8) & ~7; if (vt102->col > vt102->maxcol) vt102->col = vt102->maxcol; + if (vt102->col == vt102->maxcol && vt102->autowrap) + vt102->wrap = 1; vt102_repos(vt102); } break; @@ -161,6 +173,7 @@ case 0x0D: /* CR */ if (vt102->col > 0) { vt102->col = 0; + vt102->wrap = 0; vt102_repos(vt102); } break;