xref: /original-bsd/sys/hp/dev/itereg.h (revision 74d2773b)
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  * %sccs.include.redist.c%
11  *
12  * from: Utah $Hdr: itereg.h 1.1 90/07/09$
13  *
14  *	@(#)itereg.h	7.2 (Berkeley) 11/04/90
15  */
16 
17 #define REGADDR		ip->regbase
18 #define FBBASE		((volatile u_char *)ip->fbbase)
19 #define	FONTROM		((u_char *)(REGADDR+0x3B))
20 #define ITEREGS		((struct iteregs *)(REGADDR))
21 
22 /*
23  * All of the HP displays use the same font ROM setup. These structures
24  * are used to get at them.
25  */
26 
27 struct	iteregs {
28 	u_short	reset;
29 	u_short	interrupt;
30 	u_char	:8,
31 		fbwidth_h,
32 		:8,
33 		fbwidth_l,
34 		:8,
35 		fbheight_h,
36 		:8,
37 		fbheight_l,
38 		:8,
39 		dispwidth_h,
40 		:8,
41 		dispwidth_l,
42 		:8,
43 		dispheight_h,
44 		:8,
45 		dispheight_l;
46 };
47 
48 struct	fontinfo {
49 	u_char	nfonts,	:8,
50 		fontid,	:8,
51 		haddr,	:8,
52 		laddr,	:8;
53 };
54 
55 struct	font {
56 	u_char	fh,	:8,
57 		fw;
58 	u_char	pad[7],
59 		data[256];
60 };
61 
62 #define draw_cursor(ip) { \
63 	WINDOWMOVER(ip, ip->cblanky, ip->cblankx, \
64 		    ip->cury * ip->ftheight, \
65 		    ip->curx * ip->ftwidth, \
66 		    ip->ftheight, ip->ftwidth, RR_XOR); \
67         ip->cursorx = ip->curx; \
68 	ip->cursory = ip->cury; }
69 
70 #define erase_cursor(ip) \
71   	WINDOWMOVER(ip, ip->cblanky, ip->cblankx, \
72 		    ip->cursory * ip->ftheight, \
73 		    ip->cursorx * ip->ftwidth, \
74 		    ip->ftheight, ip->ftwidth, RR_XOR);
75