|
|
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: itevar.h 1.1 90/07/09$
39: *
1.1.1.2 ! root 40: * from: @(#)itevar.h 7.2 (Berkeley) 11/4/90
! 41: * itevar.h,v 1.3 1993/05/29 19:41:03 cgd Exp
1.1 root 42: */
43:
44: #define UNIT(dev) minor(dev)
45:
46: struct itesw {
47: int (*ite_init)();
48: int (*ite_deinit)();
49: int (*ite_clear)();
50: int (*ite_putc)();
51: int (*ite_cursor)();
52: int (*ite_scroll)();
53: };
54:
55: struct ite_softc {
56: int flags;
57: int type;
58: caddr_t regbase, fbbase;
59: short curx, cury;
60: short cursorx, cursory;
61: short cblankx, cblanky;
62: short rows, cols;
63: short cpl;
64: short dheight, dwidth;
65: short fbheight, fbwidth;
66: short ftheight, ftwidth;
67: short fontx, fonty;
68: short attribute;
69: u_char *attrbuf;
70: short planemask;
71: short pos;
72: char imode, escape, fpd, hold;
73: };
74:
75: /* Flags */
76: #define ITE_ALIVE 0x01 /* hardware exists */
77: #define ITE_INITED 0x02 /* device has been initialized */
78: #define ITE_CONSOLE 0x04 /* device can be console */
79: #define ITE_ISCONS 0x08 /* device is console */
80: #define ITE_ACTIVE 0x10 /* device is being used as ITE */
81: #define ITE_INGRF 0x20 /* device in use as non-ITE */
82:
83: /* Types - indices into itesw */
84: #define ITE_TOPCAT 0
85: #define ITE_GATORBOX 1
86: #define ITE_RENAISSANCE 2
87: #define ITE_DAVINCI 3
88:
89: #define attrloc(ip, y, x) \
90: (ip->attrbuf + ((y) * ip->cols) + (x))
91:
92: #define attrclr(ip, sy, sx, h, w) \
93: bzero(ip->attrbuf + ((sy) * ip->cols) + (sx), (h) * (w))
94:
95: #define attrmov(ip, sy, sx, dy, dx, h, w) \
96: bcopy(ip->attrbuf + ((sy) * ip->cols) + (sx), \
97: ip->attrbuf + ((dy) * ip->cols) + (dx), \
98: (h) * (w))
99:
100: #define attrtest(ip, attr) \
101: ((* (u_char *) attrloc(ip, ip->cury, ip->curx)) & attr)
102:
103: #define attrset(ip, attr) \
104: ((* (u_char *) attrloc(ip, ip->cury, ip->curx)) = attr)
105:
106: /*
107: * X and Y location of character 'c' in the framebuffer, in pixels.
108: */
109: #define charX(ip,c) \
110: (((c) % (ip)->cpl) * (ip)->ftwidth + (ip)->fontx)
111:
112: #define charY(ip,c) \
113: (((c) / (ip)->cpl) * (ip)->ftheight + (ip)->fonty)
114:
115: /* Character attributes */
116: #define ATTR_NOR 0x0 /* normal */
117: #define ATTR_INV 0x1 /* inverse */
118: #define ATTR_UL 0x2 /* underline */
119: #define ATTR_ALL (ATTR_INV | ATTR_UL)
120:
121: /* Keyboard attributes */
122: #define ATTR_KPAD 0x4 /* keypad transmit */
123:
124: /* Replacement Rules */
125: #define RR_CLEAR 0x0
126: #define RR_COPY 0x3
127: #define RR_XOR 0x6
128: #define RR_COPYINVERTED 0xc
129:
130: #define SCROLL_UP 0x01
131: #define SCROLL_DOWN 0x02
132: #define SCROLL_LEFT 0x03
133: #define SCROLL_RIGHT 0x04
134: #define DRAW_CURSOR 0x05
135: #define ERASE_CURSOR 0x06
136: #define MOVE_CURSOR 0x07
137:
138: #define KBD_SSHIFT 4 /* bits to shift status */
139: #define KBD_CHARMASK 0x7F
140:
141: /* keyboard status */
142: #define KBD_SMASK 0xF /* service request status mask */
143: #define KBD_CTRLSHIFT 0x8 /* key + CTRL + SHIFT */
144: #define KBD_CTRL 0x9 /* key + CTRL */
145: #define KBD_SHIFT 0xA /* key + SHIFT */
146: #define KBD_KEY 0xB /* key only */
147:
148: #define KBD_CAPSLOCK 0x18
149:
150: #define KBD_EXT_LEFT_DOWN 0x12
151: #define KBD_EXT_LEFT_UP 0x92
152: #define KBD_EXT_RIGHT_DOWN 0x13
153: #define KBD_EXT_RIGHT_UP 0x93
154:
155: #define TABSIZE 8
1.1.1.2 ! root 156: #define TABEND(u) (ite_tty[u]->t_winsize.ws_col - TABSIZE)
1.1 root 157:
158: #ifdef KERNEL
159: extern struct ite_softc ite_softc[];
160: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.