* Copyright (c) 1990 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* %sccs.include.redist.c%
* @(#)cga.c 7.3 (Berkeley) %G%
static u_char att
= 0x7 ;
u_char
*Crtat
= (u_char
*)CGA_BUF
;
static unsigned int addr_6845
= CGA_BASE
;
outb(addr_6845
+1,pos
>> 8);
outb(addr_6845
+1,pos
&0xff);
static u_char
*crtat
= 0;
unsigned cursorat
; u_short was
;
/* XXX probe to find if a color or monochrome display */
*(u_short
*)Crtat
= 0xA55A;
if (*(u_short
*)Crtat
!= 0xA55A) {
Crtat
= (u_char
*) MONO_BUF
;
/* Extract cursor location */
cursorat
= inb(addr_6845
+1)<<8 ;
cursorat
|= inb(addr_6845
+1);
if(cursorat
<= COL
*ROW
) {
crtat
= Crtat
+ cursorat
*CHR
;
att
= crtat
[1]; /* use current attribute present */
for (cp
= crtat
; cp
< Crtat
+ROW
*COL
*CHR
; cp
+= 2) {
while ((int)crtat
% (8*CHR
));
crtat
-= (crtat
- Crtat
) % (COL
*CHR
);
if (crtat
>= Crtat
+COL
*ROW
*CHR
) {
bcopy(Crtat
+COL
*CHR
, Crtat
, COL
*(ROW
-1)*CHR
);
for (cp
= Crtat
+ COL
*(ROW
-1)*CHR
;
cp
< Crtat
+ COL
*ROW
*CHR
; cp
+= 2)
cursor((crtat
-Crtat
)/CHR
);