grfabs_ccglb.c revision 1.2 1 1.1 chopps /*
2 1.1 chopps * Copyright (c) 1994 Christian E. Hopps
3 1.1 chopps * All rights reserved.
4 1.1 chopps *
5 1.1 chopps * Redistribution and use in source and binary forms, with or without
6 1.1 chopps * modification, are permitted provided that the following conditions
7 1.1 chopps * are met:
8 1.1 chopps * 1. Redistributions of source code must retain the above copyright
9 1.1 chopps * notice, this list of conditions and the following disclaimer.
10 1.1 chopps * 2. Redistributions in binary form must reproduce the above copyright
11 1.1 chopps * notice, this list of conditions and the following disclaimer in the
12 1.1 chopps * documentation and/or other materials provided with the distribution.
13 1.1 chopps * 3. All advertising materials mentioning features or use of this software
14 1.1 chopps * must display the following acknowledgement:
15 1.1 chopps * This product includes software developed by Christian E. Hopps.
16 1.1 chopps * 4. The name of the author may not be used to endorse or promote products
17 1.1 chopps * derived from this software without specific prior written permission
18 1.1 chopps *
19 1.1 chopps * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 1.1 chopps * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 1.1 chopps * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 1.1 chopps * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 1.1 chopps * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 1.1 chopps * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 1.1 chopps * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 1.1 chopps * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 1.1 chopps * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 1.1 chopps * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 1.1 chopps *
30 1.2 chopps * $Id: grfabs_ccglb.c,v 1.2 1994/02/17 09:10:37 chopps Exp $
31 1.1 chopps */
32 1.1 chopps
33 1.1 chopps #include <sys/types.h>
34 1.1 chopps #include <amiga/amiga/dlists.h>
35 1.1 chopps #include <amiga/amiga/cc.h>
36 1.1 chopps #include <amiga/dev/grfabs_reg.h>
37 1.1 chopps #include <amiga/dev/grfabs_ccreg.h>
38 1.1 chopps
39 1.1 chopps /* the custom thips monitor */
40 1.1 chopps monitor_t *cc_monitor;
41 1.1 chopps
42 1.1 chopps cop_t std_copper_list[] = {
43 1.1 chopps { CI_WAIT (0, 12), 0xfffe },
44 1.1 chopps #if defined (GRF_ECS)
45 1.1 chopps { R_BEAMCON0, 0x0000 },
46 1.1 chopps { R_BPLCON3, 0x0020 }, /* enable border blank */
47 1.1 chopps #endif
48 1.1 chopps /* bit plane pointers */
49 1.1 chopps { R_BPL0PTH, 0x0000 }, { R_BPL0PTL, 0x0000 },
50 1.1 chopps { R_BPL1PTH, 0x0000 }, { R_BPL1PTL, 0x0000 },
51 1.1 chopps { R_BPL2PTH, 0x0000 }, { R_BPL2PTL, 0x0000 },
52 1.1 chopps { R_BPL3PTH, 0x0000 }, { R_BPL3PTL, 0x0000 },
53 1.1 chopps { R_BPL4PTH, 0x0000 }, { R_BPL4PTL, 0x0000 },
54 1.1 chopps { R_BPL5PTH, 0x0000 }, { R_BPL5PTL, 0x0000 },
55 1.1 chopps { R_BPL6PTH, 0x0000 }, { R_BPL6PTL, 0x0000 },
56 1.1 chopps { R_BPL7PTH, 0x0000 }, { R_BPL7PTL, 0x0000 },
57 1.1 chopps /* view specific stuff. */
58 1.1 chopps { R_BPL1MOD, 0x0000 },
59 1.1 chopps { R_BPL2MOD, 0x0000 },
60 1.1 chopps { R_DIWSTRT, 0xffff },
61 1.1 chopps { R_BPLCON0, 0x0000 },
62 1.1 chopps { R_DIWSTOP, 0x0000 },
63 1.1 chopps #if defined (GRF_ECS)
64 1.1 chopps { R_DIWHIGH, 0x0000 },
65 1.1 chopps #endif
66 1.1 chopps { R_DDFSTRT, 0x0000 },
67 1.1 chopps { R_DDFSTOP, 0x0000 },
68 1.1 chopps { R_BPLCON1, 0x0000 },
69 1.1 chopps /* colors */
70 1.1 chopps { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B },
71 1.1 chopps { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff },
72 1.1 chopps { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 },
73 1.1 chopps { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc },
74 1.1 chopps { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec },
75 1.1 chopps { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 },
76 1.1 chopps { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb },
77 1.1 chopps { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff },
78 1.1 chopps { R_COP1LCH, 0x0000 }, { R_COP1LCL, 0x0000 },
79 1.1 chopps { 0xffff, 0xfffe }, { 0xffff, 0xfffe } /* COPEND, COPEND */
80 1.1 chopps };
81 1.1 chopps
82 1.1 chopps /* standard custom chips copper list. */
83 1.1 chopps int std_copper_list_len = sizeof (std_copper_list) / sizeof (cop_t);
84 1.1 chopps int std_copper_list_size = sizeof (std_copper_list);
85 1.1 chopps
86 1.1 chopps
87 1.1 chopps #if defined (GRF_A2024)
88 1.1 chopps cop_t std_dlace_copper_list[] = {
89 1.1 chopps { CI_WAIT(0,12), 0xfffe }, /* WAIT (0, 12) */
90 1.1 chopps #if defined (GRF_ECS)
91 1.1 chopps { R_BEAMCON0, 0x0000 },
92 1.1 chopps { R_BPLCON3, 0x0020 }, /* enable border blank */
93 1.1 chopps #endif
94 1.1 chopps /* colors */
95 1.1 chopps { R_COLOR00, 0x0000 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0000 }, { R_COLOR03, 0x0000 },
96 1.1 chopps { R_COLOR04, 0x0000 }, { R_COLOR05, 0x0000 }, { R_COLOR06, 0x0000 }, { R_COLOR07, 0x0000 },
97 1.1 chopps { R_COLOR08, 0x0000 }, { R_COLOR09, 0x0000 }, { R_COLOR0A, 0x0000}, { R_COLOR0B, 0x0000 },
98 1.1 chopps { R_COLOR0C, 0x0000 }, { R_COLOR0D, 0x0000 }, { R_COLOR0E, 0x0000}, { R_COLOR0F, 0x0000 },
99 1.1 chopps { R_COLOR10, 0x0009 }, { R_COLOR11, 0x0009 }, { R_COLOR12, 0x0001 }, { R_COLOR13, 0x0809 },
100 1.1 chopps { R_COLOR14, 0x0009 }, { R_COLOR15, 0x0009 }, { R_COLOR16, 0x0001 }, { R_COLOR17, 0x0809 },
101 1.1 chopps { R_COLOR18, 0x0008 }, { R_COLOR19, 0x0008 }, { R_COLOR1A, 0x0000 }, { R_COLOR1B, 0x0808 },
102 1.1 chopps { R_COLOR1C, 0x0089 }, { R_COLOR1D, 0x0089 }, { R_COLOR1E, 0x0081 }, { R_COLOR1F, 0x0889 },
103 1.1 chopps /* set the registers up. */
104 1.1 chopps { R_DIWSTRT, 0xffff },
105 1.1 chopps { R_BPLCON0, 0x0000 },
106 1.1 chopps { R_DIWSTOP, 0x0000 },
107 1.1 chopps #if defined (GRF_ECS)
108 1.1 chopps { R_DIWHIGH, 0x0000 },
109 1.1 chopps #endif
110 1.1 chopps { R_DDFSTRT, 0x0000 },
111 1.1 chopps { R_DDFSTOP, 0x0000 },
112 1.1 chopps { R_BPLCON1, 0x0000 },
113 1.1 chopps /* view specific stuff. */
114 1.1 chopps { R_BPL1MOD, 0x0000 },
115 1.1 chopps { R_BPL2MOD, 0x0000 },
116 1.1 chopps /* bit plane pointers */
117 1.1 chopps { R_BPL0PTH, 0x0000 }, { R_BPL0PTL, 0x0000 },
118 1.1 chopps { R_BPL1PTH, 0x0000 }, { R_BPL1PTL, 0x0000 },
119 1.1 chopps { R_BPL2PTH, 0x0000 }, { R_BPL2PTL, 0x0000 },
120 1.1 chopps { R_BPL3PTH, 0x0000 }, { R_BPL3PTL, 0x0000 },
121 1.1 chopps { R_COP1LCH, 0x0000 }, { R_COP1LCL, 0x0000 },
122 1.1 chopps { 0xffff, 0xfffe }, { 0xffff, 0xfffe } /* COPEND, COPEND */
123 1.1 chopps };
124 1.1 chopps int std_dlace_copper_list_len = sizeof (std_dlace_copper_list) / sizeof (cop_t);
125 1.1 chopps int std_dlace_copper_list_size = sizeof (std_dlace_copper_list);
126 1.1 chopps
127 1.1 chopps cop_t std_a2024_copper_list[] = {
128 1.1 chopps { CI_WAIT(0,12), 0xfffe }, /* WAIT (0, 12) */
129 1.1 chopps #if defined (GRF_ECS)
130 1.1 chopps { R_BEAMCON0, 0x0000 },
131 1.1 chopps #endif
132 1.1 chopps /* hedley card init setup section */
133 1.1 chopps { R_COLOR00, 0x0f00 },
134 1.1 chopps { R_BPL0PTH, 0x0000 }, { R_BPL0PTL, 0x0000 }, /* init plane of 1's with first set for centering */
135 1.1 chopps { R_DIWSTRT, 0x1561 }, { R_DIWSTOP, 0x16d1 },
136 1.1 chopps #if defined (GRF_ECS)
137 1.1 chopps { R_DIWHIGH, 0x2000 },
138 1.1 chopps #endif
139 1.1 chopps { R_DDFSTRT, 0x0040 }, { R_DDFSTOP, 0x00d0 },
140 1.1 chopps { R_BPLCON0, 0x9200 },
141 1.1 chopps /* actual data that will be latched by hedley card. */
142 1.1 chopps { R_COLOR01, 0x0001 }, /* Stuff1 */
143 1.1 chopps { CI_WAIT(126,21), 0xfffe }, { R_COLOR01, 0x0001 }, /* Display Quadrent */
144 1.1 chopps { CI_WAIT(158,21), 0xfffe }, { R_COLOR01, 0x08f0 }, /* Stuff */
145 1.1 chopps { CI_WAIT(190,21), 0xfffe }, { R_COLOR01, 0x0ff1 }, /* Stuff2 */
146 1.1 chopps { CI_WAIT(0,22), 0xfffe },
147 1.1 chopps { R_COLOR00, 0x0000 }, { R_BPLCON0, 0x0000 },
148 1.1 chopps { CI_WAIT(0,43), 0xfffe },
149 1.1 chopps /* set the registers up. */
150 1.1 chopps { R_COLOR00, 0x0009 }, { R_COLOR01, 0x0001 }, { R_COLOR02, 0x0008 }, { R_COLOR03, 0x0000 },
151 1.1 chopps { R_COLOR04, 0x0809 }, { R_COLOR05, 0x0801 }, { R_COLOR06, 0x0808 }, { R_COLOR07, 0x0800 },
152 1.1 chopps { R_COLOR08, 0x0089 }, { R_COLOR09, 0x0081 }, { R_COLOR0A, 0x0088 }, { R_COLOR0B, 0x0080 },
153 1.1 chopps { R_COLOR0C, 0x0889 }, { R_COLOR0D, 0x0881 }, { R_COLOR0E, 0x0888 }, { R_COLOR0F, 0x0880 },
154 1.1 chopps { R_COLOR10, 0x0009 }, { R_COLOR11, 0x0009 }, { R_COLOR12, 0x0001 }, { R_COLOR13, 0x0809 },
155 1.1 chopps { R_COLOR14, 0x0009 }, { R_COLOR15, 0x0009 }, { R_COLOR16, 0x0001 }, { R_COLOR17, 0x0809 },
156 1.1 chopps { R_COLOR18, 0x0008 }, { R_COLOR19, 0x0008 }, { R_COLOR1A, 0x0000 }, { R_COLOR1B, 0x0808 },
157 1.1 chopps { R_COLOR1C, 0x0089 }, { R_COLOR1D, 0x0089 }, { R_COLOR1E, 0x0081 }, { R_COLOR1F, 0x0889 },
158 1.1 chopps /* window size. */
159 1.1 chopps { R_DIWSTRT, 0x2c81 }, { R_BPLCON0, 0x0000 }, { R_DIWSTOP, 0xf481 },
160 1.1 chopps /* datafetch */
161 1.1 chopps { R_DDFSTRT, 0x0038 }, { R_DDFSTOP, 0x00b8 },
162 1.1 chopps { R_BPLCON1, 0x0000 },
163 1.1 chopps { R_BPL1MOD, 0x00bc }, { R_BPL2MOD, 0x00bc },
164 1.1 chopps /* bitplanes */
165 1.1 chopps { R_BPL0PTH, 0x0000 }, { R_BPL0PTL, 0x0000 },
166 1.1 chopps { R_BPL1PTH, 0x0000 }, { R_BPL1PTL, 0x0000 },
167 1.1 chopps { R_BPL2PTH, 0x0000 }, { R_BPL2PTL, 0x0000 },
168 1.1 chopps { R_BPL3PTH, 0x0000 }, { R_BPL3PTL, 0x0000 },
169 1.1 chopps #if defined (GRF_ECS)
170 1.1 chopps { R_DIWHIGH, 0x2000 },
171 1.1 chopps #endif
172 1.1 chopps { R_COP1LCH, 0x0000 }, { R_COP1LCL, 0x0000 },
173 1.1 chopps { 0xffff, 0xfffe }, { 0xffff, 0xfffe } /* COPEND, COPEND */
174 1.1 chopps };
175 1.1 chopps int std_a2024_copper_list_len = sizeof (std_a2024_copper_list) / sizeof (cop_t);
176 1.1 chopps int std_a2024_copper_list_size = sizeof (std_a2024_copper_list);
177 1.1 chopps
178 1.1 chopps cop_t std_pal_a2024_copper_list[] = {
179 1.1 chopps { CI_WAIT(0,20), 0xfffe }, /* WAIT (0, 12) */
180 1.1 chopps #if defined (GRF_ECS)
181 1.1 chopps { R_BEAMCON0, STANDARD_PAL_BEAMCON },
182 1.1 chopps #endif
183 1.1 chopps /* hedley card init setup section */
184 1.1 chopps { R_COLOR00, 0x0f00 },
185 1.1 chopps { R_BPL0PTH, 0x0000 }, { R_BPL0PTL, 0x0000 }, /* init plane of 1's with first set for centering */
186 1.1 chopps { R_DIWSTRT, 0x1d61 }, { R_DIWSTOP, 0x1ed1 },
187 1.1 chopps #if defined (GRF_ECS)
188 1.1 chopps { R_DIWHIGH, 0x2000 },
189 1.1 chopps #endif
190 1.1 chopps { R_DDFSTRT, 0x0040 }, { R_DDFSTOP, 0x00d0 },
191 1.1 chopps { R_BPLCON0, 0x9200 },
192 1.1 chopps /* actual data that will be latched by hedley card. */
193 1.1 chopps { R_COLOR01, 0x0001 }, /* Stuff1 */
194 1.1 chopps { CI_WAIT(126,29), 0xfffe }, { R_COLOR01, 0x0001 }, /* Display Quadrent */
195 1.1 chopps { CI_WAIT(158,29), 0xfffe }, { R_COLOR01, 0x08f0 }, /* Stuff */
196 1.1 chopps { CI_WAIT(190,29), 0xfffe }, { R_COLOR01, 0x0ff1 }, /* Stuff2 */
197 1.1 chopps { CI_WAIT(0,30), 0xfffe },
198 1.1 chopps { R_COLOR00, 0x0000 }, { R_BPLCON0, 0x0000 },
199 1.1 chopps { CI_WAIT(0,43), 0xfffe },
200 1.1 chopps
201 1.1 chopps /* set the registers up. */
202 1.1 chopps { R_COLOR00, 0x0009 }, { R_COLOR01, 0x0001 }, { R_COLOR02, 0x0008 }, { R_COLOR03, 0x0000 },
203 1.1 chopps { R_COLOR04, 0x0809 }, { R_COLOR05, 0x0801 }, { R_COLOR06, 0x0808 }, { R_COLOR07, 0x0800 },
204 1.1 chopps { R_COLOR08, 0x0089 }, { R_COLOR09, 0x0081 }, { R_COLOR0A, 0x0088 }, { R_COLOR0B, 0x0080 },
205 1.1 chopps { R_COLOR0C, 0x0889 }, { R_COLOR0D, 0x0881 }, { R_COLOR0E, 0x0888 }, { R_COLOR0F, 0x0880 },
206 1.1 chopps { R_COLOR10, 0x0009 }, { R_COLOR11, 0x0009 }, { R_COLOR12, 0x0001 }, { R_COLOR13, 0x0809 },
207 1.1 chopps { R_COLOR14, 0x0009 }, { R_COLOR15, 0x0009 }, { R_COLOR16, 0x0001 }, { R_COLOR17, 0x0809 },
208 1.1 chopps { R_COLOR18, 0x0008 }, { R_COLOR19, 0x0008 }, { R_COLOR1A, 0x0000 }, { R_COLOR1B, 0x0808 },
209 1.1 chopps { R_COLOR1C, 0x0089 }, { R_COLOR1D, 0x0089 }, { R_COLOR1E, 0x0081 }, { R_COLOR1F, 0x0889 },
210 1.1 chopps /* window size. */
211 1.1 chopps { R_DIWSTRT, 0x2c81 }, { R_BPLCON0, 0x0000 }, { R_DIWSTOP, 0x2c81 },
212 1.1 chopps /* datafetch */
213 1.1 chopps { R_DDFSTRT, 0x0038 }, { R_DDFSTOP, 0x00b8 },
214 1.1 chopps { R_BPLCON1, 0x0000 },
215 1.1 chopps { R_BPL1MOD, 0x00bc }, { R_BPL2MOD, 0x00bc },
216 1.1 chopps /* bitplanes */
217 1.1 chopps { R_BPL0PTH, 0x0000 }, { R_BPL0PTL, 0x0000 },
218 1.1 chopps { R_BPL1PTH, 0x0000 }, { R_BPL1PTL, 0x0000 },
219 1.1 chopps { R_BPL2PTH, 0x0000 }, { R_BPL2PTL, 0x0000 },
220 1.1 chopps { R_BPL3PTH, 0x0000 }, { R_BPL3PTL, 0x0000 },
221 1.1 chopps #if defined (GRF_ECS)
222 1.1 chopps { R_DIWHIGH, 0x2100 },
223 1.1 chopps #endif
224 1.1 chopps { R_COP1LCH, 0x0000 }, { R_COP1LCL, 0x0000 },
225 1.1 chopps { 0xffff, 0xfffe }, { 0xffff, 0xfffe } /* COPEND, COPEND */
226 1.1 chopps };
227 1.1 chopps int std_pal_a2024_copper_list_len = sizeof (std_pal_a2024_copper_list) / sizeof (cop_t);
228 1.1 chopps int std_pal_a2024_copper_list_size = sizeof (std_pal_a2024_copper_list);
229 1.1 chopps
230 1.1 chopps /* color tables for figuring color regs for 2024 */
231 1.1 chopps u_short a2024_color_value_line0[4] = {
232 1.1 chopps A2024_L0_BLACK,
233 1.1 chopps A2024_L0_DGREY,
234 1.1 chopps A2024_L0_LGREY,
235 1.1 chopps A2024_L0_WHITE
236 1.1 chopps };
237 1.1 chopps
238 1.1 chopps u_short a2024_color_value_line1[4] = {
239 1.1 chopps A2024_L1_BLACK,
240 1.1 chopps A2024_L1_DGREY,
241 1.1 chopps A2024_L1_LGREY,
242 1.1 chopps A2024_L1_WHITE
243 1.1 chopps };
244 1.1 chopps
245 1.1 chopps #endif /* GRF_A2024 */
246 1.1 chopps
247 1.1 chopps u_short cc_default_colors[32] = {
248 1.1 chopps 0xAAA, 0x000, 0x68B, 0xFFF,
249 1.1 chopps 0x369, 0x963, 0x639, 0x936,
250 1.1 chopps 0x000, 0x00F, 0x0F0, 0xF00,
251 1.1 chopps 0x0FF, 0xFF0, 0xF0F, 0xFFF,
252 1.1 chopps 0x000, 0x111, 0x222, 0x333,
253 1.1 chopps 0x444, 0x555, 0x666, 0x777,
254 1.1 chopps 0x888, 0x999, 0xAAA, 0xBBB,
255 1.1 chopps 0xCCC, 0xDDD, 0xEEE, 0xFFF
256 1.1 chopps };
257 1.1 chopps #if defined (GRF_A2024)
258 1.1 chopps u_short cc_a2024_default_colors[4] = {
259 1.2 chopps 0x2, /* LGREY */
260 1.1 chopps 0x0, /* BLACK */
261 1.1 chopps 0x3, /* WHITE */
262 1.1 chopps 0x1 /* DGREY */
263 1.1 chopps };
264 1.1 chopps #endif /* GRF_A2024 */
265