xref: /netbsd-src/sys/arch/hp300/stand/common/ite_hy.c (revision f6330dd725c1f2d119707be88b31baed489568a4)
1*f6330dd7Stsutsui /*	$NetBSD: ite_hy.c,v 1.12 2011/02/10 12:46:22 tsutsui Exp $	*/
2aad01611Sagc 
3aad01611Sagc /*
49b6bd2d9Srmind  * Copyright (c) 1988 University of Utah.
5aad01611Sagc  * Copyright (c) 1990, 1993
6aad01611Sagc  *	The Regents of the University of California.  All rights reserved.
7aad01611Sagc  *
8aad01611Sagc  * This code is derived from software contributed to Berkeley by
9aad01611Sagc  * the Systems Programming Group of the University of Utah Computer
10aad01611Sagc  * Science Department and Mark Davies of the Department of Computer
11aad01611Sagc  * Science, Victoria University of Wellington, New Zealand.
12aad01611Sagc  *
13aad01611Sagc  * Redistribution and use in source and binary forms, with or without
14aad01611Sagc  * modification, are permitted provided that the following conditions
15aad01611Sagc  * are met:
16aad01611Sagc  * 1. Redistributions of source code must retain the above copyright
17aad01611Sagc  *    notice, this list of conditions and the following disclaimer.
18aad01611Sagc  * 2. Redistributions in binary form must reproduce the above copyright
19aad01611Sagc  *    notice, this list of conditions and the following disclaimer in the
20aad01611Sagc  *    documentation and/or other materials provided with the distribution.
21aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
22aad01611Sagc  *    may be used to endorse or promote products derived from this software
23aad01611Sagc  *    without specific prior written permission.
24aad01611Sagc  *
25aad01611Sagc  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26aad01611Sagc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27aad01611Sagc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28aad01611Sagc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29aad01611Sagc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30aad01611Sagc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31aad01611Sagc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32aad01611Sagc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33aad01611Sagc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34aad01611Sagc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35aad01611Sagc  * SUCH DAMAGE.
36aad01611Sagc  *
37aad01611Sagc  * from: Utah $Hdr: ite_hy.c 1.1 92/01/22$
38aad01611Sagc  *
39aad01611Sagc  *	@(#)ite_hy.c	8.1 (Berkeley) 6/10/93
40aad01611Sagc  */
41a0864b3eSthorpej 
42a0864b3eSthorpej #ifdef ITECONSOLE
43a0864b3eSthorpej 
44a0864b3eSthorpej #include <sys/param.h>
45a0864b3eSthorpej 
4613b242e4Stsutsui #include <hp300/stand/common/itereg.h>
4713b242e4Stsutsui #include <hp300/stand/common/grf_hyreg.h>
48a0864b3eSthorpej 
49a0864b3eSthorpej #include <hp300/stand/common/samachdep.h>
50a0864b3eSthorpej #include <hp300/stand/common/itevar.h>
51a0864b3eSthorpej 
52a0864b3eSthorpej void
hyper_init(struct ite_data * ip)53d3dc0553Stsutsui hyper_init(struct ite_data *ip)
54a0864b3eSthorpej {
55212f884fStsutsui 	struct hyboxfb *regbase = (void *)ip->regbase;
56a0864b3eSthorpej 	int width;
57a0864b3eSthorpej 
58*f6330dd7Stsutsui 	ip->bmv = ite_dio_windowmove1bpp;
59a0864b3eSthorpej 	ite_fontinfo(ip);
60a0864b3eSthorpej 	width = ((ip->ftwidth + 7) / 8) * 8;
61a0864b3eSthorpej 	ip->cpl      = (ip->fbwidth - ip->dwidth) / width;
62a0864b3eSthorpej 	ip->cblanky  = ip->fonty + ((128 / ip->cpl) +1) * ip->ftheight;
63a0864b3eSthorpej 
64212f884fStsutsui 	regbase->nblank = 0x05;
65a0864b3eSthorpej 
66a0864b3eSthorpej 	/*
67a0864b3eSthorpej 	 * Clear the framebuffer on all planes.
68a0864b3eSthorpej 	 */
69*f6330dd7Stsutsui 	ite_dio_windowmove1bpp(ip, 0, 0, 0, 0, ip->fbheight, ip->fbwidth,
70*f6330dd7Stsutsui 	    RR_CLEAR);
71a0864b3eSthorpej 
7236ac47efStsutsui 	ite_fontinit1bpp(ip);
73a0864b3eSthorpej 
74a0864b3eSthorpej 	/*
75a0864b3eSthorpej 	 * Stash the inverted cursor.
76a0864b3eSthorpej 	 */
77*f6330dd7Stsutsui 	ite_dio_windowmove1bpp(ip, charY(ip, ' '), charX1bpp(ip, ' '),
78*f6330dd7Stsutsui 	    ip->cblanky, ip->cblankx, ip->ftheight, ip->ftwidth,
79*f6330dd7Stsutsui 	    RR_COPYINVERTED);
80a0864b3eSthorpej }
81a0864b3eSthorpej #endif
82