Annotation of sys/arch/hp300/stand/common/ite_tc.c, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: ite_tc.c,v 1.5 2006/08/17 06:31:10 miod Exp $ */
2: /* $NetBSD: ite_tc.c,v 1.8 1996/03/03 04:23:41 thorpej Exp $ */
3:
4: /*
5: * Copyright (c) 1988 University of Utah.
6: * Copyright (c) 1990, 1993
7: * The Regents of the University of California. All rights reserved.
8: *
9: * This code is derived from software contributed to Berkeley by
10: * the Systems Programming Group of the University of Utah Computer
11: * Science Department.
12: *
13: * Redistribution and use in source and binary forms, with or without
14: * modification, are permitted provided that the following conditions
15: * are met:
16: * 1. Redistributions of source code must retain the above copyright
17: * notice, this list of conditions and the following disclaimer.
18: * 2. Redistributions in binary form must reproduce the above copyright
19: * notice, this list of conditions and the following disclaimer in the
20: * documentation and/or other materials provided with the distribution.
21: * 3. Neither the name of the University nor the names of its contributors
22: * may be used to endorse or promote products derived from this software
23: * without specific prior written permission.
24: *
25: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35: * SUCH DAMAGE.
36: *
37: * from: Utah $Hdr: ite_tc.c 1.11 92/01/20$
38: *
39: * @(#)ite_tc.c 8.1 (Berkeley) 6/10/93
40: */
41:
42: #ifdef ITECONSOLE
43:
44: #include <sys/param.h>
45:
46: #include "samachdep.h"
47: #include "itevar.h"
48: #include "itereg.h"
49: #include "grfreg.h"
50: #include "grf_tcreg.h"
51:
52: #define REGBASE ((struct tcboxfb *)(ip->regbase))
53:
54: void topcat_windowmove(struct ite_data *, int, int, int, int,
55: int, int, int);
56:
57: void
58: topcat_init(struct ite_data *ip)
59: {
60: ip->bmv = topcat_windowmove;
61:
62: /*
63: * Catseye looks a lot like a topcat, but not completely.
64: * So, we set some bits to make it work.
65: */
66: if (REGBASE->fbid != GID_TOPCAT) {
67: while ((REGBASE->catseye_status & 1))
68: ;
69: REGBASE->catseye_status = 0x0;
70: REGBASE->vb_select = 0x0;
71: REGBASE->tcntrl = 0x0;
72: REGBASE->acntrl = 0x0;
73: REGBASE->pncntrl = 0x0;
74: REGBASE->rug_cmdstat = 0x90;
75: }
76:
77: /*
78: * Determine the number of planes by writing to the first frame
79: * buffer display location, then reading it back.
80: */
81: REGBASE->wen = ~0;
82: REGBASE->fben = ~0;
83: REGBASE->prr = RR_COPY;
84: *FBBASE = 0xFF;
85: ip->planemask = *FBBASE;
86:
87: /*
88: * Enable reading/writing of all the planes.
89: */
90: REGBASE->fben = ip->planemask;
91: REGBASE->wen = ip->planemask;
92: REGBASE->ren = ip->planemask;
93: REGBASE->prr = RR_COPY;
94:
95: ite_fontinfo(ip);
96:
97: /*
98: * Clear the framebuffer on all planes.
99: */
100: topcat_windowmove(ip, 0, 0, 0, 0, ip->fbheight, ip->fbwidth, RR_CLEAR);
101: tc_waitbusy(ip->regbase, ip->planemask);
102:
103: ite_fontinit8bpp(ip);
104:
105: /*
106: * Stash the inverted cursor.
107: */
108: topcat_windowmove(ip, charY(ip, ' '), charX(ip, ' '),
109: ip->cblanky, ip->cblankx, ip->ftheight,
110: ip->ftwidth, RR_COPYINVERTED);
111: }
112:
113: void
114: topcat_windowmove(struct ite_data *ip, int sy, int sx, int dy, int dx, int h,
115: int w, int func)
116: {
117: struct tcboxfb *rp = REGBASE;
118:
119: if (h == 0 || w == 0)
120: return;
121: tc_waitbusy(ip->regbase, ip->planemask);
122: rp->wmrr = func;
123: rp->source_y = sy;
124: rp->source_x = sx;
125: rp->dest_y = dy;
126: rp->dest_x = dx;
127: rp->wheight = h;
128: rp->wwidth = w;
129: rp->wmove = ip->planemask;
130: }
131: #endif
CVSweb