Integrate patch from Lon Willett that is part of release 3.20

This commit is contained in:
brezak 1995-06-02 02:48:41 +00:00
parent e729deedb2
commit cfe5401c83
4 changed files with 182 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcvt_drv.c,v 1.16 1995/04/21 07:56:40 mycroft Exp $ */
/* $NetBSD: pcvt_drv.c,v 1.17 1995/06/02 02:48:41 brezak Exp $ */
/*
* Copyright (c) 1992,1993,1994 Hellmuth Michaelis, Brian Dunford-Shore,
@ -783,6 +783,7 @@ pccnputc(Dev_t dev, U_char c)
if (c == '\n')
sput("\r", 1, 1, 0);
sput((char *) &c, 1, 1, 0);
async_update((void *)2);
}
@ -803,6 +804,7 @@ pccngetc(Dev_t dev)
#endif /* XSERVER */
cp = sgetc(0);
async_update((void *)2);
if (*cp == '\r')
return('\n');
@ -883,6 +885,7 @@ getchar(void)
x = splhigh();
sput(">", 1, 1, 0);
async_update((void *)2);
thechar = *(sgetc(0));
splx(x);
@ -1033,7 +1036,7 @@ pcvt_xmode_set(int on, struct proc *p)
pcvt_set_scrnsv_tmo(0); /* turn it off */
#endif /* PCVT_SCREENSAVER */
async_update(1); /* turn off */
async_update((void *)1); /* turn off */
/* disable text output and save screen contents */
/* video board memory -> kernel memory */

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcvt_kbd.c,v 1.6 1995/04/19 19:12:18 mycroft Exp $ */
/* $NetBSD: pcvt_kbd.c,v 1.7 1995/06/02 02:48:44 brezak Exp $ */
/*
* Copyright (c) 1992,1993,1994 Hellmuth Michaelis, Brian Dunford-Shore,
@ -865,7 +865,7 @@ xlatkey2ascii(U_short key)
if(altgr_down)
more_chars = (u_char *)thisdef.altgr;
else if(shift_down || vsp->shift_lock)
else if(!ctrl_down && (shift_down || vsp->shift_lock))
{
if(key2ascii[key].shift.subtype == STR)
more_chars = (u_char *)thisdef.shift;
@ -2107,6 +2107,8 @@ sfkey1(void)
else
more_chars = (u_char *)"\033[23~"; /* F11 */
}
else
do_vgapage(4);
}
/*---------------------------------------------------------------------------*
@ -2123,6 +2125,8 @@ sfkey2(void)
else
more_chars = (u_char *)"\033[24~"; /* F12 */
}
else
do_vgapage(5);
}
/*---------------------------------------------------------------------------*
@ -2139,6 +2143,8 @@ sfkey3(void)
else
more_chars = (u_char *)"\033[25~"; /* F13 */
}
else
do_vgapage(6);
}
/*---------------------------------------------------------------------------*
@ -2155,6 +2161,8 @@ sfkey4(void)
else
more_chars = (u_char *)"\033[26~"; /* F14 */
}
else
do_vgapage(7);
}
/*---------------------------------------------------------------------------*
@ -2171,6 +2179,13 @@ sfkey5(void)
else
more_chars = (u_char *)"\033[28~"; /* Help */
}
else
{
if(current_video_screen <= 0)
do_vgapage(totalscreens-1);
else
do_vgapage(current_video_screen - 1);
}
}
/*---------------------------------------------------------------------------*
@ -2316,6 +2331,8 @@ sfkey12(void)
static void
cfkey1(void)
{
if(vsp->which_fkl == SYS_FKL)
toggl_columns(vsp);
}
/*---------------------------------------------------------------------------*
@ -2324,6 +2341,8 @@ cfkey1(void)
static void
cfkey2(void)
{
if(vsp->which_fkl == SYS_FKL)
vt_ris(vsp);
}
/*---------------------------------------------------------------------------*
@ -2332,6 +2351,8 @@ cfkey2(void)
static void
cfkey3(void)
{
if(vsp->which_fkl == SYS_FKL)
toggl_24l(vsp);
}
/*---------------------------------------------------------------------------*
@ -2340,6 +2361,10 @@ cfkey3(void)
static void
cfkey4(void)
{
#if PCVT_SHOWKEYS
if(vsp->which_fkl == SYS_FKL)
toggl_kbddbg(vsp);
#endif /* PCVT_SHOWKEYS */
}
/*---------------------------------------------------------------------------*

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcvt_out.c,v 1.6 1995/05/05 22:28:24 mycroft Exp $ */
/* $NetBSD: pcvt_out.c,v 1.7 1995/06/02 02:48:46 brezak Exp $ */
/*
* Copyright (c) 1992,1993,1994 Hellmuth Michaelis, Brian Dunford-Shore
@ -1070,11 +1070,23 @@ vt_coldinit(void)
svsp->scrr_len = svsp->screen_rows; /* scrolling region
* end */
svsp->scrr_end = svsp->scrr_len - 1;
#ifdef PRESERVE_CURSOR
if (nscr == 0) {
outb(addr_6845,CRTC_CURSTART);
svsp->cursor_start = inb(addr_6845+1);
outb(addr_6845,CRTC_CUREND);
svsp->cursor_end = inb(addr_6845+1);
} else {
svsp->cursor_start = vs[0].cursor_start;
svsp->cursor_end = vs[0].cursor_end;
}
#else
if(vga_family == VGA_F_TRI)
svsp->cursor_start = 1; /* cursor upper scanline */
else
svsp->cursor_start = 0; /* cursor upper scanline */
svsp->cursor_end = 15; /* cursor lower scanline */
#endif
svsp->cursor_on = 1; /* cursor is on */
svsp->ckm = 1; /* normal cursor key mode */
svsp->irm = 0; /* replace mode */
@ -1118,9 +1130,41 @@ vt_coldinit(void)
if(nscr == 0)
{
#ifndef CLEAR_STARTUP
/* Preserve data on the startup screen that precedes
the cursor position. Leave the cursor where
it was found. */
unsigned cursorat;
int filllen;
outb(addr_6845, CRTC_CURSORH);
cursorat = inb(addr_6845+1) << 8;
outb(addr_6845, CRTC_CURSORL);
cursorat |= inb(addr_6845+1);
svsp->cur_offset = cursorat;
svsp->row = cursorat / svsp->maxcol;
svsp->col = cursorat % svsp->maxcol;
if (svsp->row >= svsp->screen_rows) {
/* Scroll up; this should only happen when
PCVT_24LINESDEF is set */
int nscroll =
svsp->row + 1 - svsp->screen_rows;
bcopy (svsp->Crtat + nscroll*svsp->maxcol,
svsp->Crtat,
svsp->screen_rows * svsp->maxcol * CHR);
svsp->row -= nscroll;
svsp->cur_offset -= nscroll * svsp->maxcol;
}
filllen = (svsp->maxcol * svsp->screen_rowsize)
- svsp->cur_offset;
if (filllen > 0)
fillw(user_attr | ' ',
svsp->Crtat+svsp->cur_offset, filllen);
#else
fillw(user_attr | ' ',
svsp->Crtat,
svsp->maxcol * svsp->screen_rowsize);
#endif
}
#if PCVT_USL_VT_COMPAT
@ -1409,26 +1453,45 @@ set_emulation_mode(struct video_state *svsp, int mode)
if(svsp->vt_pure_mode == mode)
return;
#ifdef CLEAR_STARTUP
fillw(user_attr | ' ',
svsp->Crtat,
svsp->maxcol * svsp->screen_rowsize);
#endif
clr_parms(svsp); /* escape parameter init */
svsp->state = STATE_INIT; /* initial state */
#ifdef CLEAR_STARTUP
svsp->col = 0; /* init row */
svsp->row = 0; /* init col */
svsp->cur_offset = 0; /* cursor offset init */
#endif
svsp->scrr_beg = 0; /* start of scrolling region */
svsp->sc_flag = 0; /* invalidate saved cursor position */
svsp->transparent = 0; /* disable control code processing */
if(mode == M_HPVT) /* vt-pure -> hp/vt-mode */
{
svsp->screen_rows = svsp->screen_rowsize - 3;
if (svsp->force24 && svsp->screen_rows == 25)
svsp->screen_rows = 24;
#ifndef CLEAR_STARTUP
if (svsp->row >= svsp->screen_rows) {
/* Scroll up */
int nscroll = svsp->row + 1 - svsp->screen_rows;
bcopy (svsp->Crtat + nscroll * svsp->maxcol,
svsp->Crtat,
svsp->screen_rows * svsp->maxcol * CHR);
svsp->row -= nscroll;
svsp->cur_offset -= nscroll * svsp->maxcol;
}
#endif
svsp->vt_pure_mode = M_HPVT;
svsp->vs_tty->t_winsize.ws_row
= svsp->screen_rows = svsp->screen_rowsize - 3;
svsp->vs_tty->t_winsize.ws_row = svsp->screen_rows;
svsp->scrr_len = svsp->screen_rows;
svsp->scrr_end = svsp->scrr_len - 1;
@ -1437,10 +1500,19 @@ set_emulation_mode(struct video_state *svsp, int mode)
}
else if(mode == M_PUREVT) /* hp/vt-mode -> vt-pure */
{
#ifndef CLEAR_STARTUP
fillw(user_attr | ' ',
svsp->Crtat + svsp->screen_rows * svsp->maxcol,
(svsp->screen_rowsize - svsp->screen_rows)
* svsp->maxcol);
#endif
svsp->vt_pure_mode = M_PUREVT;
svsp->vs_tty->t_winsize.ws_row
= svsp->screen_rows = svsp->screen_rowsize;
svsp->screen_rows = svsp->screen_rowsize;
if (svsp->force24 && svsp->screen_rows == 25)
svsp->screen_rows = 24;
svsp->vs_tty->t_winsize.ws_row = svsp->screen_rows;
svsp->scrr_len = svsp->screen_rows;
svsp->scrr_end = svsp->scrr_len - 1;
@ -1736,7 +1808,14 @@ vt_col(struct video_state *svsp, int cols)
void
update_hp(struct video_state *svsp)
{
if(svsp->vt_pure_mode != M_HPVT || (!svsp->labels_on))
if(svsp->vt_pure_mode != M_HPVT)
return;
fillw (user_attr | ' ',
svsp->Crtat + svsp->screen_rows * svsp->maxcol,
(svsp->screen_rowsize - svsp->screen_rows) * svsp->maxcol);
if (!svsp->labels_on)
return;
/* update fkey labels */

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcvt_sup.c,v 1.9 1995/04/19 19:12:24 mycroft Exp $ */
/* $NetBSD: pcvt_sup.c,v 1.10 1995/06/02 02:48:48 brezak Exp $ */
/*
* Copyright (c) 1992,1993,1994 Hellmuth Michaelis, Brian Dunford-Shore,
@ -734,14 +734,18 @@ set_screen_size(struct video_state *svsp, int size)
{
set_charset(svsp, i);
#ifdef CLEAR_STARTUP
fillw(user_attr | ' ',
svsp->Crtat,
svsp->maxcol * svsp->screen_rowsize);
#endif
clr_parms(svsp); /* escape parameter init */
svsp->state = STATE_INIT; /* initial state */
#ifdef CLEAR_STARTUP
svsp->col = 0; /* init row */
svsp->row = 0; /* init col */
svsp->cur_offset = 0; /* cursor address offset init*/
#endif
svsp->scrr_beg = 0; /* start of scrolling region */
svsp->sc_flag = 0; /* invalidate saved cursor
* position */
@ -755,6 +759,16 @@ set_screen_size(struct video_state *svsp, int size)
(svsp->maxcol == 80)? 720: 1056;
svsp->vs_tty->t_winsize.ws_ypixel = 400;
#ifndef OLD
/* screen_rows already calculated in set_charset() */
if(svsp->vt_pure_mode == M_HPVT && svsp->labels_on)
{
if(svsp->which_fkl == SYS_FKL)
sw_sfkl(svsp);
else if(svsp->which_fkl == USR_FKL)
sw_ufkl(svsp);
}
#else
if(svsp->vt_pure_mode == M_HPVT)
{
svsp->screen_rows = svsp->screen_rowsize - 3;
@ -777,6 +791,7 @@ set_screen_size(struct video_state *svsp, int size)
if((size == SIZ_25ROWS) && svsp->force24)
svsp->screen_rows--;
}
#endif
svsp->vs_tty->t_winsize.ws_row = svsp->screen_rows;
@ -896,17 +911,20 @@ vgapaletteio(unsigned idx, struct rgb *val, int writeit)
/*---------------------------------------------------------------------------*
* update asynchronous: cursor, cursor pos displ, sys load, keyb scan
* arg is:
* 0 -- do update; requeue
* (void *)1 -- suspend updates
* (void *)2 -- do update for kernel printfs
*---------------------------------------------------------------------------*/
void
async_update(void *arg)
{
int a = (int)arg;
static int lastpos = 0;
static int counter = PCVT_UPDATESLOW;
#ifdef XSERVER
/* need a method to suspend the updates */
if(a)
if (arg == (void *)1)
{
untimeout(async_update, (void *)0);
return;
@ -952,6 +970,10 @@ async_update(void *arg)
outb(addr_6845+1, (lastpos));
}
/* Magic arg: for kernel printfs */
if (arg == (void *)2)
return;
if(--counter) /* below is possible update */
goto async_update_exit; /* just now and then ..... */
counter = PCVT_UPDATESLOW; /* caution, see screensaver above !! */
@ -1088,7 +1110,7 @@ async_update(void *arg)
async_update_exit:
if(a == 0)
if(arg == (void *)0)
timeout(async_update, (void *)0, PCVT_UPDATEFAST);
}
@ -1099,6 +1121,10 @@ void
set_charset(struct video_state *svsp, int curvgacs)
{
static int sizetab[] = { 25, 28, 35, 40, 43, 50 };
#ifndef CLEAR_STARTUP
int oldsize, oldrows, newsize, newrows;
#endif
if((curvgacs < 0) || (curvgacs > (NVGAFONTS-1)))
return;
@ -1107,12 +1133,47 @@ set_charset(struct video_state *svsp, int curvgacs)
select_vga_charset(curvgacs);
#ifndef CLEAR_STARTUP
oldsize = svsp->screen_rowsize;
oldrows = svsp->screen_rows;
newsize = sizetab[(vgacs[curvgacs].screen_size)];
newrows = newsize;
if (svsp->vt_pure_mode == M_HPVT)
newrows -= 3;
if (newrows == 25 && svsp->force24)
newrows = 24;
if (newrows < oldrows) {
int nscroll = svsp->row + 1 - newrows;
if (svsp->row >= oldrows) /* Sanity check */
nscroll = oldrows - newrows;
if (nscroll > 0) {
/* Scroll up */
bcopy (svsp->Crtat + nscroll * svsp->maxcol,
svsp->Crtat,
newrows * svsp->maxcol * CHR);
svsp->row -= nscroll;
svsp->cur_offset -= nscroll * svsp->maxcol;
}
if (newrows < newsize)
fillw(user_attr | ' ',
svsp->Crtat + newrows * svsp->maxcol,
(newsize - newrows) * svsp->maxcol);
} else if (oldrows < newsize)
fillw(user_attr | ' ',
svsp->Crtat + oldrows * svsp->maxcol,
(newsize - oldrows) * svsp->maxcol);
svsp->screen_rowsize = newsize;
svsp->screen_rows = newrows;
#else
svsp->screen_rowsize = sizetab[(vgacs[curvgacs].screen_size)];
if( svsp->labels_on && svsp->vt_pure_mode != M_PUREVT)
svsp->screen_rows = svsp->screen_rowsize-3;
else
svsp->screen_rows = svsp->screen_rowsize;
#endif
/* Clip scrolling region */
if(svsp->scrr_end > svsp->screen_rows - 1)