xref: /netbsd-src/sys/arch/amiga/dev/grf_ulreg.h (revision 9573504567626934c7ee01c7dce0c4bb1dfe7403)
1 /*	$NetBSD: grf_ulreg.h,v 1.2 1995/10/07 19:54:59 chopps Exp $	*/
2 
3 /*
4  * Copyright (c) 1995 Ignatios Souvatzis
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. All advertising materials mentioning features or use of this software
16  *    must display the following acknowledgement:
17  *      This product includes software developed by Lutz Vieweg.
18  * 4. The name of the author may not be used to endorse or promote products
19  *    derived from this software without specific prior written permission
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 /*
33  * Registers etc. for the University of Lowell graphics board.
34  */
35 
36 struct gspregs {
37 	/*
38 	 * alas, they didn't invert the A1 bit, so be have to write the
39 	 * address pointer in two parts
40 	 */
41 	__volatile u_short hstadrl;
42 	__volatile u_short hstadrh;
43 	__volatile u_short data;
44 	__volatile u_short ctrl;
45 };
46 
47 /* Bits in ctrl */
48 #define HLT	0x8000
49 #define CF	0x4000
50 #define LBL	0x2000
51 #define INCR	0x1000
52 #define INCW	0x0800
53 #define NMIM	0x0200
54 #define NMI	0x0100
55 
56 #define INTOUT	0x0080
57 #define MSGOUT	0x0070
58 #define INTIN	0x0008
59 #define	MSGIN	0x0007
60 
61 /* address macros */
62 
63 #define GSPSETHADRS(gsp,adrs) (gsp)->hstadrh = (adrs)>>16; (gsp)->hstadrl = (adrs)
64 #define GSPGETHADRS(gsp) ((gsp)->hstadrh << 16 | (gsp)->hstadrl)
65 
66 /* Standard addresses in GSP memory */
67 
68 #define PUT_PTR_ADRS    0xFFA20000	/* put pointer in ring buffer */
69 #define PUT_HI_PTR_ADRS 0xFFA20010	/* put pointer high word */
70 #define GET_PTR_ADRS    0xFFA20020	/* get pointer (low word) */
71 #define GSP_MODE_ADRS   0xFFA20040	/* GSP mode word */
72 
73 /* Bits in GSP mode word */
74 #define GMODE_HOLD      1               /* hold screen */
75 #define GMODE_FLUSH     2               /* flush GSP input queue */
76 #define GMODE_ALTSCRN   4               /* use alternate screen */
77 #define GMODE_DISPCTRL  8               /* display control chars */
78 
79 /* command words */
80 #define GCMD_CMD_MSK	0x000F
81 #define GCMD_PAR_MSK	0xFFF0
82 
83 #define GCMD_NOP	0
84 #define GCMD_CHAR	1	/* char, fg, bg, x, y */
85 #define GCMD_FILL	2	/* fg, x, y, w, h, ppop */
86 #define GCMD_PIXBLT	3	/* x, y, w, h, dx, dy */
87 #define GCMD_FNTMIR	4	/* */
88 #define GCMD_CMAP	5	/* overlay==1, index, red, green, blue */
89 #define GCMD_MCHG	6	/* width, height, baseh, basel, pitch, depth */
90 
91 struct grf_ul_softc {
92 	struct grf_softc	gus_sc;
93 	u_int8_t		gus_imcmap[768];
94 	u_int8_t		gus_ovcmap[12];
95 	u_int8_t		gus_ovslct;
96 	/* realconfig stuff assumes this is last, else it would get copied: */
97 	struct isr		gus_isr;
98 };
99 
100 #ifdef _KERNEL
101 void gsp_write(struct gspregs *gsp, u_int16_t *data, size_t size);
102 int grful_cnprobe(void);
103 void grful_iteinit(struct grf_softc *gp);
104 #endif
105 
106