summaryrefslogtreecommitdiff
path: root/sys/arch/i386/isa/pcvt/pcvt_sup.c
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1996-04-18 17:48:38 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1996-04-18 17:48:38 +0000
commit2486fc6168bd5163df06fb048ad4fd9e70f751dc (patch)
tree003d169a0c6a209f0ecba8937cad1e6dadde1145 /sys/arch/i386/isa/pcvt/pcvt_sup.c
parentb05028a7911f058859342ea6515510c74d6c1d90 (diff)
Merge of NetBSD 960317
Diffstat (limited to 'sys/arch/i386/isa/pcvt/pcvt_sup.c')
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_sup.c69
1 files changed, 27 insertions, 42 deletions
diff --git a/sys/arch/i386/isa/pcvt/pcvt_sup.c b/sys/arch/i386/isa/pcvt/pcvt_sup.c
index af96e7b3cc1..97c6583a1ac 100644
--- a/sys/arch/i386/isa/pcvt/pcvt_sup.c
+++ b/sys/arch/i386/isa/pcvt/pcvt_sup.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: pcvt_sup.c,v 1.2 1996/04/18 17:48:36 niklas Exp $ */
+
/*
* Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
*
@@ -265,8 +267,6 @@ vgapcvtinfo(struct pcvtinfo *data)
data->nscreens = PCVT_NSCREENS;
data->scanset = PCVT_SCANSET;
- data->updatefast= PCVT_UPDATEFAST;
- data->updateslow= PCVT_UPDATESLOW;
data->sysbeepf = PCVT_SYSBEEPF;
#if PCVT_NETBSD || PCVT_FREEBSD >= 200
@@ -865,42 +865,30 @@ vgapaletteio(unsigned idx, struct rgb *val, int writeit)
*
* update asynchronous: cursor, cursor pos displ, sys load, keyb scan
*
- * arg is:
- * UPDATE_START = 0 = do update; requeue
- * UPDATE_STOP = 1 = suspend updates
- * UPDATE_KERN = 2 = do update for kernel printfs
- *
*---------------------------------------------------------------------------*/
void
-async_update(int arg)
+async_update()
{
+ static int lastadr = 0;
static int lastpos = 0;
- static int counter = PCVT_UPDATESLOW;
-#ifdef XSERVER
- /* need a method to suspend the updates */
+ /* first check if update is possible */
- if(arg == UPDATE_STOP)
- {
- untimeout((TIMEOUT_FUNC_T)async_update, UPDATE_START);
+ if(vsp->vt_status & VT_GRAFX)
return;
- }
-#endif /* XSERVER */
-
- /* first check if update is possible */
if(chargen_access) /* does someone load characters? */
- goto async_update_exit; /* yes, do not update anything */
+ return; /* yes, do not update anything */
#if PCVT_SCREENSAVER
- if(reset_screen_saver && (counter == PCVT_UPDATESLOW))
+ if(reset_screen_saver)
{
pcvt_scrnsv_reset(); /* yes, do it */
reset_screen_saver = 0; /* re-init */
}
else if(scrnsv_active) /* is the screen not blanked? */
{
- goto async_update_exit; /* do not update anything */
+ return; /* do not update anything */
}
#endif /* PCVT_SCREENSAVER */
@@ -908,22 +896,26 @@ async_update(int arg)
/* this takes place on EVERY virtual screen (if not in X mode etc...)*/
/*-------------------------------------------------------------------*/
- if ( cursor_pos_valid &&
- (lastpos != (vsp->Crtat + vsp->cur_offset - Crtat)))
+ if (cursor_pos_valid)
{
- lastpos = vsp->Crtat + vsp->cur_offset - Crtat;
- outb(addr_6845, CRTC_CURSORH); /* high register */
- outb(addr_6845+1, ((lastpos) >> 8));
- outb(addr_6845, CRTC_CURSORL); /* low register */
- outb(addr_6845+1, (lastpos));
- }
-
- if (arg == UPDATE_KERN) /* Magic arg: for kernel printfs */
- return;
+ if (lastadr != (vsp->Crtat - Crtat))
+ {
+ lastadr = vsp->Crtat - Crtat;
+ outb(addr_6845, CRTC_STARTADRH); /* high register */
+ outb(addr_6845+1, ((lastadr) >> 8));
+ outb(addr_6845, CRTC_STARTADRL); /* low register */
+ outb(addr_6845+1, (lastadr));
+ }
- if(--counter) /* below is possible update */
- goto async_update_exit; /* just now and then ..... */
- counter = PCVT_UPDATESLOW; /* caution, see screensaver above !! */
+ if (lastpos != (lastadr + vsp->cur_offset))
+ {
+ lastpos = lastadr + vsp->cur_offset;
+ outb(addr_6845, CRTC_CURSORH); /* high register */
+ outb(addr_6845+1, ((lastpos) >> 8));
+ outb(addr_6845, CRTC_CURSORL); /* low register */
+ outb(addr_6845+1, (lastpos));
+ }
+ }
/*-------------------------------------------------------------------*/
/* this takes place ONLY on screen 0 if in HP mode, labels on, !X */
@@ -1054,13 +1046,6 @@ async_update(int arg)
*(p + LABEL_ROWH) = (user_attr | (((vsp->row+1)/10) + '0'));
*(p + LABEL_ROWL) = (user_attr | (((vsp->row+1)%10) + '0'));
}
-
-async_update_exit:
-
- if(arg == UPDATE_START)
- {
- timeout((TIMEOUT_FUNC_T)async_update, UPDATE_START, PCVT_UPDATEFAST);
- }
}
/*---------------------------------------------------------------------------*