|
|
1.1 root 1: /*
2: * Copyright (c) 1988 University of Utah.
3: * Copyright (c) 1990 The Regents of the University of California.
4: * All rights reserved.
5: *
6: * This code is derived from software contributed to Berkeley by
7: * the Systems Programming Group of the University of Utah Computer
8: * Science Department.
9: *
10: * Redistribution and use in source and binary forms, with or without
11: * modification, are permitted provided that the following conditions
12: * are met:
13: * 1. Redistributions of source code must retain the above copyright
14: * notice, this list of conditions and the following disclaimer.
15: * 2. Redistributions in binary form must reproduce the above copyright
16: * notice, this list of conditions and the following disclaimer in the
17: * documentation and/or other materials provided with the distribution.
18: * 3. All advertising materials mentioning features or use of this software
19: * must display the following acknowledgement:
20: * This product includes software developed by the University of
21: * California, Berkeley and its contributors.
22: * 4. Neither the name of the University nor the names of its contributors
23: * may be used to endorse or promote products derived from this software
24: * without specific prior written permission.
25: *
26: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36: * SUCH DAMAGE.
37: *
38: * from: Utah $Hdr: ite_tc.c 1.9 89/02/20$
39: *
1.1.1.2 ! root 40: * from: @(#)ite_tc.c 7.2 (Berkeley) 12/16/90
! 41: * ite_tc.c,v 1.2 1993/05/22 07:59:09 cgd Exp
1.1 root 42: */
43:
44: #include "samachdep.h"
45:
46: #ifdef ITECONSOLE
47:
48: #include "sys/param.h"
49: #include "../dev/itevar.h"
50: #include "../dev/itereg.h"
51: #include "../dev/grfvar.h"
52: #include "../dev/grf_tcreg.h"
53:
54: #define REGBASE ((struct tcboxfb *)(ip->regbase))
55: #define WINDOWMOVER topcat_windowmove
56:
57: topcat_init(ip)
58: register struct ite_softc *ip;
59: {
60:
61: /*
62: * Determine the number of planes by writing to the first frame
63: * buffer display location, then reading it back.
64: */
65: REGBASE->wen = ~0;
66: REGBASE->fben = ~0;
67: REGBASE->prr = RR_COPY;
68: *FBBASE = 0xFF;
69: ip->planemask = *FBBASE;
70:
71: /*
72: * Enable reading/writing of all the planes.
73: */
74: REGBASE->fben = ip->planemask;
75: REGBASE->wen = ip->planemask;
76: REGBASE->ren = ip->planemask;
77: REGBASE->prr = RR_COPY;
78:
79: ite_devinfo(ip);
80:
81: /*
82: * Clear the framebuffer on all planes.
83: */
84: topcat_windowmove(ip, 0, 0, 0, 0, ip->fbheight, ip->fbwidth, RR_CLEAR);
85: tc_waitbusy(REGADDR, ip->planemask);
86:
87: ite_fontinit(ip);
88:
89: /*
90: * Stash the inverted cursor.
91: */
92: topcat_windowmove(ip, charY(ip, ' '), charX(ip, ' '),
93: ip->cblanky, ip->cblankx, ip->ftheight,
94: ip->ftwidth, RR_COPYINVERTED);
95: }
96:
97: topcat_putc(ip, c, dy, dx, mode)
98: register struct ite_softc *ip;
99: register int dy, dx;
100: int c, mode;
101: {
102: topcat_windowmove(ip, charY(ip, c), charX(ip, c),
103: dy * ip->ftheight, dx * ip->ftwidth,
104: ip->ftheight, ip->ftwidth, RR_COPY);
105: }
106:
107: topcat_cursor(ip, flag)
108: register struct ite_softc *ip;
109: register int flag;
110: {
111: if (flag == DRAW_CURSOR)
112: draw_cursor(ip)
113: else if (flag == MOVE_CURSOR) {
114: erase_cursor(ip)
115: draw_cursor(ip)
116: }
117: else
118: erase_cursor(ip)
119: }
120:
121: topcat_clear(ip, sy, sx, h, w)
122: struct ite_softc *ip;
123: register int sy, sx, h, w;
124: {
125: topcat_windowmove(ip, sy * ip->ftheight, sx * ip->ftwidth,
126: sy * ip->ftheight, sx * ip->ftwidth,
127: h * ip->ftheight, w * ip->ftwidth,
128: RR_CLEAR);
129: }
130:
131: topcat_scroll(ip, sy, sx, count, dir)
132: register struct ite_softc *ip;
133: register int sy, count;
134: int dir, sx;
135: {
136: register int dy = sy - count;
137: register int height = ip->rows - sy;
138:
139: topcat_cursor(ip, ERASE_CURSOR);
140:
141: topcat_windowmove(ip, sy * ip->ftheight, sx * ip->ftwidth,
142: dy * ip->ftheight, sx * ip->ftwidth,
143: height * ip->ftheight,
144: ip->cols * ip->ftwidth, RR_COPY);
145: }
146:
147: topcat_windowmove(ip, sy, sx, dy, dx, h, w, func)
148: struct ite_softc *ip;
149: int sy, sx, dy, dx, h, w, func;
150: {
151: register struct tcboxfb *rp = REGBASE;
152:
153: if (h == 0 || w == 0)
154: return;
155: tc_waitbusy(REGADDR, ip->planemask);
156: rp->wmrr = func;
157: rp->source_y = sy;
158: rp->source_x = sx;
159: rp->dest_y = dy;
160: rp->dest_x = dx;
161: rp->wheight = h;
162: rp->wwidth = w;
163: rp->wmove = ip->planemask;
164: }
165: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.