video.h revision 1.6 1 /* $NetBSD: video.h,v 1.6 1996/03/27 10:08:49 leo Exp $ */
2
3 /*
4 * Copyright (c) 1995 Leo Weppelman.
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 Leo Weppelman.
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 #ifndef _MACHINE_VIDEO_H
34 #define _MACHINE_VIDEO_H
35 /*
36 * Access to circuitry for video
37 */
38
39 #define VIDEO ((struct video *)AD_VIDEO)
40
41 struct video {
42 volatile char vdb[14]; /* sparsely filled */
43 volatile u_short vd_line_wide; /* Falcon line word distance */
44 volatile u_short vd_vert_wrap; /* Falcon line length */
45 volatile char vd_fill0[45]; /* filler */
46 volatile u_short vd_st_rgb[16]; /* RGB for simultaneous colors (ST)*/
47 volatile u_char vd_st_res; /* ST resolution */
48 volatile char vd_fill1; /* filler */
49 volatile u_short vd_tt_res; /* TT-resultion mode */
50 volatile u_char vd_ste_hscroll; /* MEGA STe hor bitwise scroll */
51 volatile u_short vd_fal_res; /* Falcon resolution */
52 volatile char vd_fill2[23];
53 volatile u_short vd_h_hold_cnt; /* Falcon horizontal hold counter */
54 volatile u_short vd_h_hold_tim; /* Falcon horizontal hold timer */
55 volatile u_short vd_h_bord_beg; /* Falcon horizontal border begin */
56 volatile u_short vd_h_bord_end; /* Falcon horizontal border end */
57 volatile u_short vd_h_dis_beg; /* Falcon horizontal display begin */
58 volatile u_short vd_h_dis_end; /* Falcon horizontal display end */
59 volatile u_short vd_h_ss; /* Falcon horizontal SS */
60 volatile u_short vd_h_fs; /* Falcon horizontal FS */
61 volatile u_short vd_h_hh; /* Falcon horizontal HH */
62 volatile char vd_fill3[13];
63 volatile u_short vd_v_freq_cnt; /* Falcon vertical frequency count */
64 volatile u_short vd_v_freq_tim; /* Falcon vertical frequency timer */
65 volatile u_short vd_v_bord_beg; /* Falcon vertical border begin */
66 volatile u_short vd_v_bord_end; /* Falcon vertical border end */
67 volatile u_short vd_v_dis_beg; /* Falcon vertical display begin */
68 volatile u_short vd_v_dis_end; /* Falcon vertical display end */
69 volatile u_short vd_v_ss; /* Falcon vertical SS */
70 volatile char vd_fill4[17];
71 volatile u_short vd_fal_ctrl; /* Falcon video control */
72 volatile u_short vd_fal_mode; /* Falcon video mode */
73 volatile char vd_fill5[315];
74 volatile u_short vd_tt_rgb[256]; /* RGB for simultaneous TT colors */
75 volatile char vd_fill6[4608];
76 volatile u_long vd_fal_rgb[256];/* RGB for Falcon colors */
77 };
78
79 #define vd_ramh vdb[ 1] /* base address Video RAM, high byte */
80 #define vd_ramm vdb[ 3] /* base address Video RAM, mid byte */
81 #define vd_raml vdb[13] /* base address Video RAM, low byte */
82 #define vd_ptrh vdb[ 5] /* scan address Video RAM, high byte */
83 #define vd_ptrm vdb[ 7] /* scan address Video RAM, mid byte */
84 #define vd_ptrl vdb[ 9] /* scan address Video RAM, low byte */
85 #define vd_sync vdb[10] /* synchronization mode */
86
87 /* bits in vd_sync: */
88 #define SYNC_EXT 0x01 /* extern sync */
89 #define SYNC_50 0x02 /* 50 Hertz (used for color) */
90
91 /* bits in vd_st_rgb[]: */
92 #define RGB_B 0x0007
93 #define RGB_G 0x0070
94 #define RGB_R 0x0700
95
96 /* some values for vd_st_rgb[]: */
97 #define RGB_BLACK 0x0000
98 #define RGB_RED 0x0700
99 #define RGB_GREEN 0x0070
100 #define RGB_BLUE 0x0007
101 #define RGB_WHITE 0x0777
102 #define RGB_MAGENTA 0x0707
103 #define RGB_CYAN 0x0077
104 #define RGB_YELLOW 0x0770
105 #define RGB_LGREY 0x0555
106 #define RGB_DGREY 0x0222
107
108 /* values for vd_st_res: */
109 #define RES_LOW 0x00 /* 320x200, 16 colors */
110 #define RES_MID 0x01 /* 640x200, 4 colors */
111 #define RES_HIGH 0x02 /* 640x400, monochrome */
112
113 /* masks for vd_tt_res: */
114 #define RES_STLOW 0x0000 /* 320x200, 16 colors */
115 #define RES_STMID 0x0100 /* 640x200, 4 colors */
116 #define RES_STHIGH 0x0200 /* 640x400, monochrome */
117 #define RES_TTMID 0x0400 /* 640x480, 16 colors */
118 #define RES_TTHIGH 0x0600 /* 1280x960, monochrome */
119 #define RES_TTLOW 0x0700 /* 320x480, 256 colors */
120 #define TT_PALLET 0x000f /* Pallette number */
121 #define TT_HYMONO 0x8000 /* Hyper mono mode */
122 #define TT_SHOLD 0x1000 /* Sample/hold mode */
123
124 /* The falcon video modes */
125 #define RES_FALAUTO 0 /* Falcon resolution dedected at boot */
126 #define RES_VGA2 1 /* 640x480, 2 colors */
127 #define RES_VGA4 2 /* 640x480, 4 colors */
128 #define RES_VGA16 3 /* 640x480, 16 colors */
129 #define RES_VGA256 4 /* 640x480, 256 colors */
130 #define RES_DIRECT 5 /* 320x200, 65536 colors */
131 #define RES_FAL_STLOW 6 /* 320x200, 16 colors */
132 #define RES_FAL_STMID 7 /* 640x200, 4 colors */
133 #define RES_FAL_STHIGH 8 /* 640x400, 2 colors */
134 #define RES_FAL_TTLOW 9 /* 320x480, 256 colors */
135
136 /* Falcon monitor types */
137 #define FAL_SM 0x0000
138 #define FAL_SC 0x0100
139 #define FAL_VGA 0x0200
140 #define FAL_TV 0x0300
141
142 #endif /* _MACHINE_VIDEO_H */
143