1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47 #define P9000_SYSTEM_CONFIG 0x00000004
48
49 #define SCR_PIXEL_MASK 0x1c000000
50 #define SCR_PIXEL_8BPP 0x08000000
51 #define SCR_PIXEL_16BPP 0x0c000000
52 #define SCR_PIXEL_24BPP 0x1c000000
53 #define SCR_PIXEL_32BPP 0x14000000
54 #define SCR_SWAP_WORDS 0x00002000
55 #define SCR_SWAP_BYTES 0x00001000
56 #define SCR_SWAP_BITS 0x00000800
57 #define SCR_READ_BUFFER_MASK 0x00000400
58 #define SCR_WRITE_BUFFER_MASK 0x00000200
59 #define SCR_ID_MASK 0x00000007
60 #define SCR_SC(sc0, sc1, sc2, sc3) \
61 (((sc0) << 14) | ((sc1) << 17) | ((sc2) << 20) | ((sc3) << 29))
62
63
64 #define P9000_INTERRUPT 0x00000008
65
66
67 #define P9000_INTERRUPT_ENABLE 0x0000000c
68
69 #define IER_MASTER_ENABLE 0x00000080
70 #define IER_MASTER_INTERRUPT 0x00000040
71 #define IER_VBLANK_ENABLE 0x00000020
72 #define IER_VBLANK_INTERRUPT 0x00000010
73 #define IER_PICK_ENABLE 0x00000008
74 #define IER_PICK_INTERRUPT 0x00000004
75 #define IER_IDLE_ENABLE 0x00000002
76 #define IER_IDLE_INTERRUPT 0x00000001
77
78
79 #define P9000_ALTBANK_READ 0x00000010
80
81
82 #define P9000_ALTBANK_WRITE 0x00000014
83
84
85
86
87
88
89 #define P9000_HCR 0x00000104
90
91 #define P9000_HTR 0x00000108
92
93 #define P9000_HSRE 0x0000010c
94
95 #define P9000_HBRE 0x00000110
96
97 #define P9000_HBFE 0x00000114
98
99 #define P9000_HCP 0x00000118
100
101
102 #define P9000_VCR 0x0000011c
103
104 #define P9000_VL 0x00000120
105
106 #define P9000_VSRE 0x00000124
107
108 #define P9000_VBRE 0x00000128
109
110 #define P9000_VBFE 0x0000012c
111
112 #define P9000_VCP 0x00000130
113
114
115 #define P9000_SRA 0x00000134
116
117 #define P9000_SRTC1 0x00000138
118
119 #define SRTC1_VSYNC_INTERNAL 0x00000100
120 #define SRTC1_HSYNC_INTERNAL 0x00000080
121 #define SRTC1_VIDEN 0x00000020
122 #define SRTC1_RESTRICTED 0x00000010
123 #define SRTC1_BUFFER1 0x00000008
124
125
126 #define P9000_QSF 0x0000013c
127
128 #define P9000_SRTC2 0x00000140
129
130
131
132
133
134
135 #define P9000_MCR 0x00000184
136
137 #define P9000_REFRESH_PERIOD 0x00000188
138
139 #define P9000_REFRESH_COUNT 0x0000018c
140
141 #define P9000_RASLOW_MAXIMUM 0x00000190
142
143 #define P9000_RASLOW_CURRENT 0x00000194
144
145 #define P9000_POWERUP_CONFIG 0x00000198
146 #define P9100_FREE_FIFO 0x00000198
147
148
149
150
151
152 #define P9100_RAMDAC_REGISTER(index) (0x00000200 + ((index) << 2))
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167 #define P9000_PE_STATUS 0x00000000
168 #define STATUS_QUAD_BUSY 0x80000000
169 #define STATUS_BLIT_BUSY 0x40000000
170 #define STATUS_PICK_DETECTED 0x00000080
171 #define STATUS_PIXEL_ERROR 0x00000040
172 #define STATUS_BLIT_ERROR 0x00000020
173 #define STATUS_QUAD_ERROR 0x00000010
174 #define STATUS_QUAD_CONCAVE 0x00000008
175 #define STATUS_QUAD_OUTSIDE 0x00000004
176 #define STATUS_QUAD_INSIDE 0x00000002
177 #define STATUS_QUAD_STRADDLE 0x00000001
178
179
180 #define P9000_PE_BLIT 0x00000004
181 #define P9000_PE_QUAD 0x00000008
182 #define P9000_PE_PIXEL8 0x0000000c
183 #define P9000_PE_NEXTPIXELS 0x00000014
184 #define P9000_PE_PIXEL1(index) (0x00000080 + ((index) << 2))
185
186
187
188
189 #define P9000_PE_OOR 0x00000184
190
191 #define P9000_PE_INDEX 0x0000018c
192
193 #define P9000_PE_WINOFFSET 0x00000190
194
195 #define P9000_PE_WINMIN 0x00000194
196 #define P9000_PE_WINMAX 0x00000198
197
198 #define P9000_X_CLIPPING 0x000001a0
199
200 #define P9000_Y_CLIPPING 0x000001a4
201
202 #define P9000_X_EDGE_LESS 0x000001a8
203
204 #define P9000_X_EDGE_GREATER 0x000001ac
205
206 #define P9000_Y_EDGE_LESS 0x000001b0
207
208 #define P9000_Y_EDGE_GREATER 0x000001b4
209
210
211
212
213
214
215 #define P9000_DE_FG_COLOR 0x00000200
216 #define P9000_DE_BG_COLOR 0x00000204
217 #define P9100_DE_COLOR0 0x00000200
218 #define P9100_DE_COLOR1 0x00000204
219 #define P9100_DE_COLOR2 0x00000238
220 #define P9100_DE_COLOR3 0x0000023c
221
222
223 #define P9100_COLOR8(c) ((c) | ((c) << 8) | ((c) << 16) | ((c) << 24))
224 #define P9100_COLOR16(c) ((c) | ((c) << 16))
225
226
227 #define P9000_DE_PLANEMASK 0x00000208
228
229
230 #define P9000_DE_DRAWMODE 0x0000020c
231 #define DM_PICK_CONTROL 0x00000008
232 #define DM_PICK_ENABLE 0x00000004
233 #define DM_BUFFER_CONTROL 0x00000002
234 #define DM_BUFFER_ENABLE0 0x00000000
235 #define DM_BUFFER_ENABLE1 0x00000001
236
237
238 #define P9000_DE_PATTERN_ORIGIN_X 0x00000210
239 #define P9000_DE_PATTERN_ORIGIN_Y 0x00000214
240
241
242 #define P9000_DE_RASTER 0x00000218
243 #define P9100_RASTER_NO_SOLID 0x00002000
244 #define P9100_RASTER_PATTERN_4COLOR 0x00004000
245 #define P9100_RASTER_PIXEL1_TRANSPARENT 0x00008000
246 #define P9000_RASTER_QUAD_OVERSIZE 0x00010000
247 #define P9000_RASTER_QUAD_PATTERN 0x00020000
248
249
250 #define P9000_RASTER_SRC 0xcccc
251 #define P9000_RASTER_DST 0xaaaa
252 #define P9000_RASTER_PATTERN 0xff00
253 #define P9000_RASTER_MASK 0xffff
254 #define P9100_RASTER_SRC 0x00cc
255 #define P9100_RASTER_DST 0x00aa
256 #define P9100_RASTER_PATTERN 0x00f0
257 #define P9100_RASTER_MASK 0x00ff
258
259
260 #define P9000_DE_PIXEL8 0x0000021c
261
262
263 #define P9000_DE_WINMIN 0x00000220
264 #define P9000_DE_WINMAX 0x00000224
265
266
267 #define P9000_DE_PATTERN(index) (0x00000280 + ((index) << 2))
268
269
270 #define P9000_DE_USER(index) (0x00000290 + ((index) << 2))
271
272
273 #define P9100_DE_B_WINMIN 0x000002a0
274 #define P9100_DE_B_WINMAX 0x000002a4
275
276
277
278
279
280
281 #define P9000_COORD_X 0x00000008
282
283 #define P9000_COORD_Y 0x00000010
284
285 #define P9000_COORD_XY 0x00000018
286
287
288 #define P9000_COORD_ABS 0x00000000
289
290 #define P9000_COORD_REL 0x00000020
291
292
293 #define P9000_COORDS(x,y) ((((x) & 0x0fff) << 16) | ((y) & 0x0fff))
294
295
296 #define P9000_DC_COORD(index) (0x00001000 + ((index) * 0x40))
297
298
299 #define P9000_LC_POINT 0x00001200
300 #define P9000_LC_LINE 0x00001240
301 #define P9000_LC_TRI 0x00001280
302 #define P9000_LC_QUAD 0x000012c0
303 #define P9000_LC_RECT 0x00001300