Rev 741 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
431 | serge | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
||
3 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
||
4 | ;; Distributed under terms of the GNU General Public License ;; |
||
5 | ;; ;; |
||
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
214 | serge | 7 | |
8 | format MS COFF |
||
9 | |||
10 | include 'proc32.inc' |
||
281 | serge | 11 | include 'imports.inc' |
214 | serge | 12 | |
729 | serge | 13 | R500_HW2D equ 0 |
14 | |||
465 | serge | 15 | API_VERSION equ 0x01000100 |
214 | serge | 16 | |
465 | serge | 17 | DEBUG equ 1 |
214 | serge | 18 | |
630 | serge | 19 | STRIDE equ 8 |
20 | |||
465 | serge | 21 | VID_ATI equ 0x1002 |
22 | |||
227 | serge | 23 | LOAD_FROM_FILE equ 0 |
24 | LOAD_FROM_MEM equ 1 |
||
25 | LOAD_INDIRECT equ 2 |
||
26 | LOAD_SYSTEM equ 3 |
||
27 | |||
465 | serge | 28 | SRV_GETVERSION equ 0 |
233 | serge | 29 | |
227 | serge | 30 | struc BITMAPINFOHEADER { |
31 | .biSize dd ? ; DWORD |
||
32 | .biWidth dd ? ; LONG |
||
33 | .biHeight dd ? ; LONG |
||
34 | .biPlanes dw ? ; WORD |
||
35 | .biBitCount dw ? ; WORD |
||
36 | .biCompression dd ? ; DWORD |
||
37 | .biSizeImage dd ? ; DWORD |
||
38 | .biXPelsPerMeter dd ? ; LONG |
||
39 | .biYPelsPerMeter dd ? ; LONG |
||
40 | .biClrUsed dd ? ; DWORD |
||
41 | .biClrImportant dd ? ; DWORD |
||
42 | } |
||
43 | |||
44 | virtual at 0 |
||
45 | BI BITMAPINFOHEADER |
||
46 | end virtual |
||
47 | |||
48 | struc CURSOR |
||
281 | serge | 49 | {;common object header |
50 | .magic dd ? ;'CURS' |
||
51 | .destroy dd ? ;internal destructor |
||
52 | .fd dd ? ;next object in list |
||
53 | .bk dd ? ;prev object in list |
||
54 | .pid dd ? ;owner id |
||
55 | |||
56 | ;cursor data |
||
57 | .base dd ? ;allocated memory |
||
58 | .hot_x dd ? ;hotspot coords |
||
227 | serge | 59 | .hot_y dd ? |
60 | } |
||
61 | virtual at 0 |
||
62 | CURSOR CURSOR |
||
63 | end virtual |
||
64 | |||
281 | serge | 65 | CURSOR_SIZE equ 32 |
227 | serge | 66 | |
465 | serge | 67 | OS_BASE equ 0x80000000 |
68 | SLOT_BASE equ (OS_BASE+0x0080000) |
||
630 | serge | 69 | LFB_BASE equ 0xFE000000 |
214 | serge | 70 | |
71 | PG_SW equ 0x003 |
||
72 | PG_NOCACHE equ 0x018 |
||
73 | |||
74 | struc IOCTL |
||
75 | { .handle dd ? |
||
76 | .io_code dd ? |
||
77 | .input dd ? |
||
78 | .inp_size dd ? |
||
79 | .output dd ? |
||
80 | .out_size dd ? |
||
81 | } |
||
82 | |||
83 | virtual at 0 |
||
84 | IOCTL IOCTL |
||
85 | end virtual |
||
86 | |||
378 | serge | 87 | ;MMIO equ 0F9000000h |
630 | serge | 88 | RD_RB3D_CNTL equ 1c3ch |
214 | serge | 89 | |
90 | RD_MEM_CNTL equ 0140h |
||
91 | RD_CRTC_GEN_CNTL equ 0050h |
||
92 | RD_CRTC_CUR_EN equ 10000h |
||
93 | RD_DISPLAY_BASE_ADDR equ 023ch |
||
94 | RD_DEFAULT_OFFSET equ 16e0h |
||
630 | serge | 95 | |
214 | serge | 96 | CUR_HORZ_VERT_OFF equ 0268h |
97 | CUR_HORZ_VERT_POSN equ 0264h |
||
98 | CUR_OFFSET equ 0260h |
||
630 | serge | 99 | |
100 | |||
214 | serge | 101 | RD_RB3D_CNTL equ 1c3ch |
102 | RD_RBBM_STATUS equ 0e40h |
||
103 | RD_RBBM_FIFOCNT_MASK equ 007fh |
||
104 | RD_RBBM_ACTIVE equ 80000000h |
||
105 | RD_TIMEOUT equ 2000000 |
||
106 | |||
107 | RD_DP_GUI_MASTER_CNTL equ 0146ch |
||
108 | RD_DP_BRUSH_BKGD_CLR equ 01478h |
||
109 | RD_DP_BRUSH_FRGD_CLR equ 0147ch |
||
110 | RD_DP_SRC_BKGD_CLR equ 015dch |
||
111 | RD_DP_SRC_FRGD_CLR equ 015d8h |
||
112 | RD_DP_CNTL equ 016c0h |
||
113 | RD_DP_DATATYPE equ 016c4h |
||
114 | RD_DP_WRITE_MASK equ 016cch |
||
115 | RD_DP_SRC_SOURCE_MEMORY equ (2 shl 24) |
||
116 | RD_DP_SRC_SOURCE_HOST_DATA equ (3 shl 24) |
||
117 | RD_DEFAULT_SC_BOTTOM_RIGHT equ 16e8h |
||
118 | RD_GMC_BRUSH_SOLID_COLOR equ (13 shl 4) |
||
119 | RD_DEFAULT_SC_RIGHT_MAX equ 1fffh |
||
120 | RD_DEFAULT_SC_BOTTOM_MAX equ 1fff0000h |
||
121 | RD_GMC_DST_DATATYPE_SHIFT equ 8 |
||
122 | |||
123 | RD_ROP3_S equ 00cc0000h |
||
124 | RD_ROP3_P equ 00f00000h |
||
125 | |||
126 | RD_RB2D_DSTCACHE_MODE equ 03428h |
||
127 | RD_RB2D_DSTCACHE_CTLSTAT equ 0342ch |
||
128 | RD_RB2D_DC_FLUSH_ALL equ 000fh |
||
129 | RD_RB2D_DC_BUSY equ 80000000h |
||
130 | |||
131 | RD_GMC_BRUSH_SOLID_COLOR equ 000000D0h |
||
132 | RD_GMC_SRC_DATATYPE_COLOR equ (3 shl 12) |
||
133 | RD_GMC_CLR_CMP_CNTL_DIS equ (1 shl 28) |
||
134 | RD_GMC_WR_MSK_DIS equ (1 shl 30) |
||
135 | |||
136 | cmdSolidFill equ 73f036d0h |
||
137 | |||
138 | RD_DST_PITCH_OFFSET equ 142ch |
||
139 | RD_SRC_PITCH_OFFSET equ 1428h |
||
140 | |||
141 | RD_DST_X_LEFT_TO_RIGHT equ 1 |
||
142 | RD_DST_Y_TOP_TO_BOTTOM equ 2 |
||
143 | RD_DST_Y_X equ 1438h |
||
144 | RD_DST_WIDTH_HEIGHT equ 1598h |
||
145 | RD_DST_LINE_START equ 1600h |
||
146 | RD_DST_LINE_END equ 1604h |
||
147 | R300_MEM_NUM_CHANNELS_MASK equ 0003h |
||
148 | |||
149 | macro rdr op1, op2 |
||
150 | { |
||
151 | mov edi, [ati_io] |
||
152 | mov op1, [edi+op2] |
||
153 | } |
||
154 | |||
155 | macro wrr dest, src |
||
156 | { |
||
157 | mov edi, [ati_io] |
||
158 | mov dword [edi+dest], src |
||
159 | } |
||
160 | |||
729 | serge | 161 | macro rmask dest, val, mask |
162 | { |
||
163 | mov edi, [ati_io] |
||
164 | mov eax, [edi+dest] |
||
165 | and eax, not mask |
||
166 | or eax, (val and mask) |
||
167 | mov [edi+dest], eax |
||
168 | } |
||
214 | serge | 169 | |
170 | public START |
||
171 | public service_proc |
||
227 | serge | 172 | public version |
214 | serge | 173 | |
174 | CURSOR_IMAGE_OFFSET equ 0x00500000 |
||
175 | |||
176 | DRV_ENTRY equ 1 |
||
177 | DRV_EXIT equ -1 |
||
178 | |||
179 | section '.flat' code readable align 16 |
||
180 | |||
181 | proc START stdcall, state:dword |
||
182 | |||
227 | serge | 183 | cmp [state], 1 |
630 | serge | 184 | jne .restore |
227 | serge | 185 | |
214 | serge | 186 | if DEBUG |
187 | mov esi, msgInit |
||
188 | call SysMsgBoardStr |
||
189 | end if |
||
190 | |||
191 | call detect_ati |
||
227 | serge | 192 | test eax, eax |
214 | serge | 193 | jz .fail |
194 | |||
630 | serge | 195 | mov ebx, [SelectHwCursor] |
196 | mov ecx, [SetHwCursor] |
||
197 | mov edx, [HwCursorRestore] |
||
198 | mov esi, [HwCursorCreate] |
||
214 | serge | 199 | |
630 | serge | 200 | mov [oldSelect], ebx |
201 | mov [oldSet], ecx |
||
202 | mov [oldRestore], edx |
||
203 | mov [oldCreate], esi |
||
204 | |||
205 | call eax |
||
206 | |||
281 | serge | 207 | or eax, -1 |
227 | serge | 208 | mov [cursor_map], eax |
209 | mov [cursor_map+4], eax |
||
210 | mov edx, cursor_map |
||
211 | mov [cursor_start], edx |
||
281 | serge | 212 | add edx, 8 |
227 | serge | 213 | mov [cursor_end], edx |
214 | |||
214 | serge | 215 | stdcall RegService, sz_ati_srv, service_proc |
216 | test eax, eax |
||
630 | serge | 217 | jz .restore |
218 | |||
732 | serge | 219 | if R500_HW2D |
220 | stdcall RegService, sz_HDraw_srv, r500_HDraw |
||
221 | |||
222 | mov ebx, START |
||
223 | and ebx, -4096 |
||
224 | mov [eax+0x20], ebx |
||
225 | mov [eax+0x24], dword 0 ;hack |
||
226 | end if |
||
630 | serge | 227 | mov ebx, [fnSelect] |
228 | mov ecx, [fnSet] |
||
229 | |||
230 | mov [SelectHwCursor], ebx |
||
231 | mov [SetHwCursor], ecx |
||
227 | serge | 232 | mov dword [HwCursorRestore], drv_restore |
233 | mov dword [HwCursorCreate], ati_cursor |
||
630 | serge | 234 | |
227 | serge | 235 | ret |
630 | serge | 236 | .restore: |
237 | mov eax, [oldSelect] |
||
238 | mov ebx, [oldSet] |
||
239 | mov ecx, [oldRestore] |
||
240 | mov edx, [oldCreate] |
||
241 | |||
242 | mov [SelectHwCursor], eax |
||
243 | mov [SetHwCursor], ebx |
||
244 | mov [HwCursorRestore], ecx |
||
245 | mov [HwCursorCreate], edx |
||
246 | |||
247 | xor eax, eax |
||
248 | ret |
||
249 | |||
214 | serge | 250 | .fail: |
251 | if DEBUG |
||
227 | serge | 252 | mov esi, msgFail |
214 | serge | 253 | call SysMsgBoardStr |
254 | end if |
||
255 | |||
256 | xor eax, eax |
||
257 | ret |
||
258 | endp |
||
259 | |||
260 | handle equ IOCTL.handle |
||
261 | io_code equ IOCTL.io_code |
||
262 | input equ IOCTL.input |
||
263 | inp_size equ IOCTL.inp_size |
||
264 | output equ IOCTL.output |
||
265 | out_size equ IOCTL.out_size |
||
266 | |||
267 | align 4 |
||
268 | proc service_proc stdcall, ioctl:dword |
||
269 | |||
465 | serge | 270 | mov ebx, [ioctl] |
271 | cmp [ebx+io_code], SRV_GETVERSION |
||
233 | serge | 272 | jne .fail |
214 | serge | 273 | |
465 | serge | 274 | mov eax, [ebx+output] |
275 | cmp [ebx+out_size], 4 |
||
276 | jne .fail |
||
277 | mov [eax], dword API_VERSION |
||
278 | xor eax, eax |
||
279 | ret |
||
233 | serge | 280 | .fail: |
378 | serge | 281 | or eax, -1 |
233 | serge | 282 | ret |
214 | serge | 283 | endp |
284 | |||
285 | restore handle |
||
286 | restore io_code |
||
287 | restore input |
||
288 | restore inp_size |
||
289 | restore output |
||
290 | restore out_size |
||
291 | |||
292 | align 4 |
||
293 | proc detect_ati |
||
227 | serge | 294 | locals |
295 | last_bus dd ? |
||
296 | endl |
||
214 | serge | 297 | |
227 | serge | 298 | xor eax, eax |
299 | mov [bus], eax |
||
300 | inc eax |
||
214 | serge | 301 | call PciApi |
227 | serge | 302 | cmp eax, -1 |
214 | serge | 303 | je .err |
304 | |||
227 | serge | 305 | mov [last_bus], eax |
214 | serge | 306 | |
307 | .next_bus: |
||
227 | serge | 308 | and [devfn], 0 |
214 | serge | 309 | .next_dev: |
310 | stdcall PciRead32, [bus], [devfn], dword 0 |
||
227 | serge | 311 | test eax, eax |
312 | jz .next |
||
313 | cmp eax, -1 |
||
314 | je .next |
||
214 | serge | 315 | |
227 | serge | 316 | mov edi, devices |
214 | serge | 317 | @@: |
227 | serge | 318 | mov ebx, [edi] |
319 | test ebx, ebx |
||
320 | jz .next |
||
214 | serge | 321 | |
227 | serge | 322 | cmp eax, ebx |
323 | je .found |
||
630 | serge | 324 | add edi, STRIDE |
227 | serge | 325 | jmp @B |
326 | .next: |
||
327 | inc [devfn] |
||
328 | cmp [devfn], 256 |
||
329 | jb .next_dev |
||
330 | mov eax, [bus] |
||
331 | inc eax |
||
332 | mov [bus], eax |
||
333 | cmp eax, [last_bus] |
||
334 | jna .next_bus |
||
335 | xor eax, eax |
||
336 | ret |
||
214 | serge | 337 | .found: |
630 | serge | 338 | mov eax, [edi+4] |
227 | serge | 339 | ret |
214 | serge | 340 | .err: |
341 | xor eax, eax |
||
342 | ret |
||
343 | endp |
||
344 | |||
345 | align 4 |
||
630 | serge | 346 | proc init_r200 |
741 | serge | 347 | stdcall PciRead32, [bus], [devfn], dword 0x18 |
348 | stdcall MapIoMem,eax,0x10000,(PG_SW+PG_NOCACHE) |
||
214 | serge | 349 | test eax, eax |
350 | jz .fail |
||
351 | |||
352 | mov [ati_io], eax |
||
741 | serge | 353 | mov edi, eax |
214 | serge | 354 | |
355 | mov dword [edi+RD_RB3D_CNTL], 0 |
||
356 | call engRestore |
||
357 | |||
358 | mov edi, [ati_io] |
||
359 | mov eax, [edi+0x50] |
||
360 | mov ebx,3 |
||
361 | shl ebx,20 |
||
362 | not ebx |
||
363 | and eax,ebx |
||
364 | mov ebx, 2 |
||
365 | shl ebx,20 |
||
366 | or eax, ebx |
||
367 | mov [edi+0x50], eax |
||
368 | |||
630 | serge | 369 | call r200_ShowCursor |
370 | |||
371 | mov [fnSelect], r200_SelectCursor |
||
372 | mov [fnSet], r200_SetCursor |
||
373 | |||
214 | serge | 374 | xor eax, eax |
375 | inc eax |
||
376 | .fail: |
||
377 | ret |
||
378 | endp |
||
379 | |||
729 | serge | 380 | if R500_HW2D |
381 | include 'r500hw.inc' |
||
382 | end if |
||
383 | |||
214 | serge | 384 | align 4 |
630 | serge | 385 | proc init_r500 |
386 | |||
741 | serge | 387 | stdcall PciRead32, [bus], [devfn], dword 0x18 |
388 | stdcall MapIoMem,eax,0x10000,(PG_SW+PG_NOCACHE) |
||
630 | serge | 389 | test eax, eax |
390 | jz .fail |
||
391 | |||
392 | mov [ati_io], eax |
||
393 | |||
394 | mov [fnSelect], r500_SelectCursor |
||
395 | mov [fnSet], r500_SetCursor |
||
396 | |||
397 | rdr eax, 0x6110 |
||
398 | mov [r500_LFB], eax |
||
399 | |||
729 | serge | 400 | if R500_HW2D |
401 | call R5xx2DInit |
||
402 | end if |
||
630 | serge | 403 | wrr 0x6410, 0x001F001F |
404 | wrr 0x6400, dword (3 shl 8) |
||
405 | |||
406 | xor eax, eax |
||
407 | inc eax |
||
408 | .fail: |
||
409 | ret |
||
410 | endp |
||
411 | |||
412 | |||
413 | align 4 |
||
227 | serge | 414 | drv_restore: |
415 | ret 8 |
||
416 | |||
630 | serge | 417 | |
227 | serge | 418 | align 4 |
630 | serge | 419 | proc r500_SelectCursor stdcall,hcursor:dword |
420 | |||
421 | mov esi, [hcursor] |
||
422 | |||
423 | mov edx, [esi+CURSOR.base] |
||
424 | sub edx, LFB_BASE |
||
425 | add edx, [r500_LFB] |
||
426 | wrr 0x6408, edx |
||
427 | |||
428 | mov eax, [esi+CURSOR.hot_x] |
||
429 | shl eax, 16 |
||
430 | mov ax, word [esi+CURSOR.hot_y] |
||
431 | wrr 0x6418, eax |
||
432 | ret |
||
433 | endp |
||
434 | |||
435 | align 4 |
||
436 | proc r500_SetCursor stdcall, hcursor:dword, x:dword, y:dword |
||
437 | pushfd |
||
438 | cli |
||
439 | |||
440 | mov esi, [hcursor] |
||
214 | serge | 441 | mov edi, [ati_io] |
442 | |||
630 | serge | 443 | mov eax, [x] |
444 | shl eax, 16 |
||
445 | mov ax, word [y] |
||
446 | |||
447 | mov [edi+0x6414], eax |
||
448 | or dword [edi+0x6400], 1 |
||
449 | |||
729 | serge | 450 | if 0 |
451 | stdcall R5xxSetupForSolidFill, 0x80808080, 3, 0xFFFFFFFF |
||
452 | stdcall R5xxSolidFillRect, 100,100, 100,100 |
||
453 | |||
454 | stdcall R5xxSetupForSolidFill, 0xFFFF0000, 3, 0xFFFFFFFF |
||
455 | stdcall R5xxSolidFillRect, 110,110, 80,80 |
||
456 | |||
457 | stdcall R5xxSetupForSolidFill, 0xFF00FF00, 3, 0xFFFFFFFF |
||
458 | stdcall R5xxSolidFillRect, 120,120, 60,60 |
||
459 | |||
460 | stdcall R5xxSetupForSolidFill, 0xFF0000FF, 3, 0xFFFFFFFF |
||
461 | stdcall R5xxSolidFillRect, 130,130, 40,40 |
||
462 | end if |
||
463 | |||
630 | serge | 464 | popfd |
465 | ret |
||
466 | endp |
||
467 | |||
468 | align 4 |
||
469 | r500_ShowCursor: |
||
470 | |||
471 | mov edi, [ati_io] |
||
472 | or dword [edi+0x6400], 1 |
||
473 | ret |
||
474 | |||
475 | align 4 |
||
476 | r200_ShowCursor: |
||
477 | mov edi, [ati_io] |
||
478 | |||
214 | serge | 479 | mov eax, [edi+RD_CRTC_GEN_CNTL] |
480 | bts eax,16 |
||
481 | mov [edi+RD_CRTC_GEN_CNTL], eax |
||
482 | ret |
||
483 | |||
630 | serge | 484 | |
214 | serge | 485 | align 4 |
630 | serge | 486 | proc r200_SelectCursor stdcall,hcursor:dword |
487 | |||
488 | ret |
||
489 | endp |
||
490 | |||
491 | align 4 |
||
492 | proc r200_SetCursor stdcall, hcursor:dword, x:dword, y:dword |
||
233 | serge | 493 | pushfd |
494 | cli |
||
227 | serge | 495 | |
233 | serge | 496 | xor eax, eax |
497 | xor edx, edx |
||
498 | mov esi, [hcursor] |
||
499 | mov ebx, [x] |
||
500 | mov ecx, [y] |
||
214 | serge | 501 | |
233 | serge | 502 | sub ebx, [esi+CURSOR.hot_x] |
503 | jnc @F |
||
504 | neg ebx |
||
505 | mov eax, ebx |
||
214 | serge | 506 | shl eax, 16 |
233 | serge | 507 | xor ebx, ebx |
508 | @@: |
||
509 | sub ecx, [esi+CURSOR.hot_y] |
||
510 | jnc @F |
||
511 | neg ecx |
||
512 | mov ax, cx |
||
513 | mov edx, ecx |
||
514 | xor ecx, ecx |
||
515 | @@: |
||
516 | or eax, 0x80000000 |
||
517 | wrr CUR_HORZ_VERT_OFF, eax |
||
214 | serge | 518 | |
233 | serge | 519 | shl ebx, 16 |
520 | mov bx, cx |
||
521 | or ebx, 0x80000000 |
||
522 | wrr CUR_HORZ_VERT_POSN, ebx |
||
523 | |||
524 | shl edx, 8 |
||
525 | add edx, [esi+CURSOR.base] |
||
526 | sub edx, LFBAddress |
||
527 | wrr CUR_OFFSET, edx |
||
528 | popfd |
||
227 | serge | 529 | ret |
530 | endp |
||
214 | serge | 531 | |
532 | align 4 |
||
227 | serge | 533 | proc video_alloc |
534 | |||
535 | pushfd |
||
536 | cli |
||
537 | mov ebx, [cursor_start] |
||
538 | mov ecx, [cursor_end] |
||
539 | .l1: |
||
540 | bsf eax,[ebx]; |
||
541 | jnz .found |
||
542 | add ebx,4 |
||
543 | cmp ebx, ecx |
||
544 | jb .l1 |
||
545 | popfd |
||
546 | xor eax,eax |
||
547 | ret |
||
548 | .found: |
||
549 | btr [ebx], eax |
||
550 | popfd |
||
551 | |||
552 | mov [cursor_start],ebx |
||
553 | sub ebx, cursor_map |
||
254 | serge | 554 | lea eax,[eax+ebx*8] |
227 | serge | 555 | |
556 | shl eax,14 |
||
557 | add eax, LFBAddress+CURSOR_IMAGE_OFFSET |
||
558 | ret |
||
559 | endp |
||
560 | |||
561 | align 4 |
||
233 | serge | 562 | video_free: |
563 | pushfd |
||
564 | cli |
||
565 | sub eax, LFBAddress+CURSOR_IMAGE_OFFSET |
||
566 | shr eax, 14 |
||
567 | mov ebx, cursor_map |
||
568 | bts [ebx], eax |
||
569 | shr eax, 3 |
||
570 | and eax, not 3 |
||
571 | add eax, ebx |
||
572 | cmp [cursor_start], eax |
||
573 | ja @f |
||
574 | popfd |
||
575 | ret |
||
576 | @@: |
||
577 | mov [cursor_start], eax |
||
578 | popfd |
||
579 | ret |
||
580 | |||
281 | serge | 581 | ; param |
582 | ; eax= pid |
||
583 | ; ebx= src |
||
584 | ; ecx= flags |
||
585 | |||
233 | serge | 586 | align 4 |
281 | serge | 587 | ati_cursor: |
588 | .src equ esp |
||
589 | .flags equ esp+4 |
||
590 | .hcursor equ esp+8 |
||
227 | serge | 591 | |
281 | serge | 592 | sub esp, 4 ;space for .hcursor |
593 | push ecx |
||
594 | push ebx |
||
227 | serge | 595 | |
281 | serge | 596 | mov ebx, eax |
597 | mov eax, CURSOR_SIZE |
||
598 | call CreateObject |
||
599 | test eax, eax |
||
600 | jz .fail |
||
601 | |||
602 | mov [.hcursor],eax |
||
603 | |||
604 | xor ebx, ebx |
||
605 | mov [eax+CURSOR.magic], 'CURS' |
||
606 | mov [eax+CURSOR.destroy], destroy_cursor |
||
607 | mov [eax+CURSOR.hot_x], ebx |
||
608 | mov [eax+CURSOR.hot_y], ebx |
||
609 | |||
610 | call video_alloc |
||
611 | mov edi, [.hcursor] |
||
227 | serge | 612 | mov [edi+CURSOR.base], eax |
613 | |||
281 | serge | 614 | mov esi, [.src] |
615 | mov ebx, [.flags] |
||
227 | serge | 616 | cmp bx, LOAD_INDIRECT |
617 | je .indirect |
||
618 | |||
619 | movzx ecx, word [esi+10] |
||
620 | movzx edx, word [esi+12] |
||
621 | mov [edi+CURSOR.hot_x], ecx |
||
622 | mov [edi+CURSOR.hot_y], edx |
||
623 | |||
624 | stdcall ati_init_cursor, eax, esi |
||
281 | serge | 625 | mov eax, [.hcursor] |
227 | serge | 626 | .fail: |
281 | serge | 627 | add esp, 12 |
227 | serge | 628 | ret |
629 | .indirect: |
||
630 | shr ebx, 16 |
||
631 | movzx ecx, bh |
||
632 | movzx edx, bl |
||
233 | serge | 633 | mov [edi+CURSOR.hot_x], ecx |
634 | mov [edi+CURSOR.hot_y], edx |
||
227 | serge | 635 | |
281 | serge | 636 | mov edi, eax |
637 | mov ebx, eax |
||
227 | serge | 638 | mov ecx, 64*64 |
639 | xor eax,eax |
||
281 | serge | 640 | cld |
227 | serge | 641 | rep stosd |
281 | serge | 642 | mov edi, ebx |
227 | serge | 643 | |
281 | serge | 644 | mov esi, [.src] |
227 | serge | 645 | mov ebx, 32 |
646 | cld |
||
647 | @@: |
||
648 | mov ecx, 32 |
||
649 | rep movsd |
||
650 | add edi, 128 |
||
651 | dec ebx |
||
652 | jnz @B |
||
281 | serge | 653 | mov eax, [.hcursor] |
654 | add esp, 12 |
||
227 | serge | 655 | ret |
656 | |||
657 | align 4 |
||
281 | serge | 658 | destroy_cursor: |
659 | |||
660 | push eax |
||
661 | mov eax, [eax+CURSOR.base] |
||
662 | call video_free |
||
663 | pop eax |
||
664 | |||
665 | call DestroyObject |
||
666 | ret |
||
667 | |||
668 | align 4 |
||
227 | serge | 669 | proc ati_init_cursor stdcall, dst:dword, src:dword |
214 | serge | 670 | locals |
671 | rBase dd ? |
||
672 | pQuad dd ? |
||
673 | pBits dd ? |
||
674 | pAnd dd ? |
||
675 | width dd ? |
||
676 | height dd ? |
||
677 | counter dd ? |
||
678 | endl |
||
679 | |||
227 | serge | 680 | mov esi, [src] |
681 | add esi,[esi+18] |
||
682 | mov eax,esi |
||
214 | serge | 683 | |
227 | serge | 684 | cmp [esi+BI.biBitCount], 24 |
685 | je .img_24 |
||
233 | serge | 686 | cmp [esi+BI.biBitCount], 8 |
687 | je .img_8 |
||
688 | cmp [esi+BI.biBitCount], 4 |
||
689 | je .img_4 |
||
690 | |||
691 | .img_2: |
||
692 | add eax, [esi] |
||
693 | mov [pQuad],eax |
||
694 | add eax,8 |
||
695 | mov [pBits],eax |
||
696 | add eax, 128 |
||
697 | mov [pAnd],eax |
||
698 | mov eax,[esi+4] |
||
699 | mov [width],eax |
||
700 | mov ebx,[esi+8] |
||
701 | shr ebx,1 |
||
702 | mov [height],ebx |
||
703 | |||
704 | mov edi, pCursor |
||
705 | add edi, 32*31*4 |
||
706 | mov [rBase],edi |
||
707 | |||
708 | mov esi,[pQuad] |
||
709 | .l21: |
||
710 | mov ebx, [pBits] |
||
711 | mov ebx, [ebx] |
||
712 | bswap ebx |
||
713 | mov eax, [pAnd] |
||
714 | mov eax, [eax] |
||
715 | bswap eax |
||
716 | mov [counter], 32 |
||
717 | @@: |
||
718 | xor edx, edx |
||
719 | shl eax,1 |
||
720 | setc dl |
||
721 | dec edx |
||
722 | |||
723 | xor ecx, ecx |
||
724 | shl ebx,1 |
||
725 | setc cl |
||
726 | mov ecx, [esi+ecx*4] |
||
727 | and ecx, edx |
||
728 | and edx, 0xFF000000 |
||
729 | or edx, ecx |
||
730 | mov [edi], edx |
||
731 | |||
732 | add edi, 4 |
||
733 | dec [counter] |
||
734 | jnz @B |
||
735 | |||
736 | add [pBits], 4 |
||
737 | add [pAnd], 4 |
||
738 | mov edi,[rBase] |
||
739 | sub edi,128 |
||
740 | mov [rBase],edi |
||
741 | sub [height],1 |
||
742 | jnz .l21 |
||
743 | jmp .copy |
||
227 | serge | 744 | .img_4: |
214 | serge | 745 | add eax, [esi] |
746 | mov [pQuad],eax |
||
747 | add eax,64 |
||
748 | mov [pBits],eax |
||
749 | add eax, 0x200 |
||
750 | mov [pAnd],eax |
||
751 | mov eax,[esi+4] |
||
752 | mov [width],eax |
||
753 | mov ebx,[esi+8] |
||
754 | shr ebx,1 |
||
755 | mov [height],ebx |
||
756 | |||
757 | mov edi, pCursor |
||
758 | add edi, 32*31*4 |
||
759 | mov [rBase],edi |
||
760 | |||
233 | serge | 761 | mov esi,[pQuad] |
214 | serge | 762 | mov ebx, [pBits] |
233 | serge | 763 | .l4: |
764 | mov eax, [pAnd] |
||
765 | mov eax, [eax] |
||
214 | serge | 766 | bswap eax |
767 | mov [counter], 16 |
||
768 | @@: |
||
769 | xor edx, edx |
||
770 | shl eax,1 |
||
771 | setc dl |
||
772 | dec edx |
||
773 | |||
233 | serge | 774 | movzx ecx, byte [ebx] |
775 | and cl, 0xF0 |
||
214 | serge | 776 | shr ecx, 2 |
233 | serge | 777 | mov ecx, [esi+ecx] |
214 | serge | 778 | and ecx, edx |
779 | and edx, 0xFF000000 |
||
780 | or edx, ecx |
||
781 | mov [edi], edx |
||
782 | |||
783 | xor edx, edx |
||
784 | shl eax,1 |
||
785 | setc dl |
||
786 | dec edx |
||
787 | |||
233 | serge | 788 | movzx ecx, byte [ebx] |
789 | and cl, 0x0F |
||
790 | mov ecx, [esi+ecx*4] |
||
214 | serge | 791 | and ecx, edx |
792 | and edx, 0xFF000000 |
||
793 | or edx, ecx |
||
794 | mov [edi+4], edx |
||
795 | |||
796 | inc ebx |
||
797 | add edi, 8 |
||
798 | dec [counter] |
||
799 | jnz @B |
||
800 | |||
233 | serge | 801 | add [pAnd], 4 |
214 | serge | 802 | mov edi,[rBase] |
803 | sub edi,128 |
||
804 | mov [rBase],edi |
||
805 | sub [height],1 |
||
233 | serge | 806 | jnz .l4 |
227 | serge | 807 | jmp .copy |
233 | serge | 808 | .img_8: |
809 | add eax, [esi] |
||
810 | mov [pQuad],eax |
||
811 | add eax,1024 |
||
812 | mov [pBits],eax |
||
813 | add eax, 1024 |
||
814 | mov [pAnd],eax |
||
815 | mov eax,[esi+4] |
||
816 | mov [width],eax |
||
817 | mov ebx,[esi+8] |
||
818 | shr ebx,1 |
||
819 | mov [height],ebx |
||
214 | serge | 820 | |
233 | serge | 821 | mov edi, pCursor |
822 | add edi, 32*31*4 |
||
823 | mov [rBase],edi |
||
824 | |||
825 | mov esi,[pQuad] |
||
826 | mov ebx, [pBits] |
||
827 | .l81: |
||
828 | mov eax, [pAnd] |
||
829 | mov eax, [eax] |
||
830 | bswap eax |
||
831 | mov [counter], 32 |
||
832 | @@: |
||
833 | xor edx, edx |
||
834 | shl eax,1 |
||
835 | setc dl |
||
836 | dec edx |
||
837 | |||
838 | movzx ecx, byte [ebx] |
||
839 | mov ecx, [esi+ecx*4] |
||
840 | and ecx, edx |
||
841 | and edx, 0xFF000000 |
||
842 | or edx, ecx |
||
843 | mov [edi], edx |
||
844 | |||
845 | inc ebx |
||
846 | add edi, 4 |
||
847 | dec [counter] |
||
848 | jnz @B |
||
849 | |||
850 | add [pAnd], 4 |
||
851 | mov edi,[rBase] |
||
852 | sub edi,128 |
||
853 | mov [rBase],edi |
||
854 | sub [height],1 |
||
855 | jnz .l81 |
||
856 | jmp .copy |
||
227 | serge | 857 | .img_24: |
858 | add eax, [esi] |
||
859 | mov [pQuad],eax |
||
860 | add eax, 0xC00 |
||
861 | mov [pAnd],eax |
||
862 | mov eax,[esi+BI.biWidth] |
||
863 | mov [width],eax |
||
864 | mov ebx,[esi+BI.biHeight] |
||
865 | shr ebx,1 |
||
866 | mov [height],ebx |
||
867 | |||
868 | mov edi, pCursor |
||
869 | add edi, 32*31*4 |
||
870 | mov [rBase],edi |
||
871 | |||
872 | mov esi,[pAnd] |
||
873 | mov ebx, [pQuad] |
||
874 | .row_24: |
||
875 | mov eax, [esi] |
||
876 | bswap eax |
||
877 | mov [counter], 32 |
||
878 | @@: |
||
879 | xor edx, edx |
||
880 | shl eax,1 |
||
881 | setc dl |
||
882 | dec edx |
||
883 | |||
884 | mov ecx, [ebx] |
||
885 | and ecx, 0x00FFFFFF |
||
886 | and ecx, edx |
||
887 | and edx, 0xFF000000 |
||
888 | or edx, ecx |
||
889 | mov [edi], edx |
||
890 | add ebx, 3 |
||
891 | add edi, 4 |
||
892 | dec [counter] |
||
893 | jnz @B |
||
894 | |||
895 | add esi, 4 |
||
896 | mov edi,[rBase] |
||
897 | sub edi,128 |
||
898 | mov [rBase],edi |
||
899 | sub [height],1 |
||
900 | jnz .row_24 |
||
901 | .copy: |
||
902 | mov edi, [dst] |
||
214 | serge | 903 | mov ecx, 64*64 |
904 | xor eax,eax |
||
905 | rep stosd |
||
906 | |||
907 | mov esi, pCursor |
||
227 | serge | 908 | mov edi, [dst] |
214 | serge | 909 | mov ebx, 32 |
227 | serge | 910 | cld |
911 | @@: |
||
214 | serge | 912 | mov ecx, 32 |
227 | serge | 913 | rep movsd |
214 | serge | 914 | add edi, 128 |
227 | serge | 915 | dec ebx |
916 | jnz @B |
||
214 | serge | 917 | ret |
918 | endp |
||
919 | |||
920 | align 4 |
||
921 | proc engFlush |
||
922 | |||
923 | mov edi, [ati_io] |
||
924 | |||
925 | mov eax, [edi+RD_RB2D_DSTCACHE_CTLSTAT] |
||
926 | or eax,RD_RB2D_DC_FLUSH_ALL |
||
927 | mov [edi+RD_RB2D_DSTCACHE_CTLSTAT],eax |
||
928 | |||
929 | mov ecx, RD_TIMEOUT |
||
930 | @@: |
||
931 | mov eax,[edi+RD_RB2D_DSTCACHE_CTLSTAT] |
||
932 | and eax, RD_RB2D_DC_BUSY |
||
933 | jz .exit |
||
934 | |||
935 | sub ecx,1 |
||
936 | jnz @B |
||
937 | .exit: |
||
938 | ret |
||
939 | endp |
||
940 | |||
630 | serge | 941 | |
214 | serge | 942 | align 4 |
943 | engWaitForFifo: |
||
944 | cnt equ bp+8 |
||
945 | push ebp |
||
946 | mov ebp, esp |
||
947 | |||
948 | mov edi, [ati_io] |
||
949 | |||
950 | mov ecx, RD_TIMEOUT |
||
951 | @@: |
||
952 | mov eax, [edi+RD_RBBM_STATUS] |
||
953 | and eax, RD_RBBM_FIFOCNT_MASK |
||
954 | cmp eax, [ebp+8] |
||
955 | jae .exit |
||
956 | |||
957 | sub ecx,1 |
||
958 | jmp @B |
||
959 | |||
960 | .exit: |
||
961 | leave |
||
962 | ret 4 |
||
963 | |||
964 | align 4 |
||
965 | proc engWaitForIdle |
||
966 | |||
227 | serge | 967 | push dword 64 |
968 | call engWaitForFifo |
||
214 | serge | 969 | |
227 | serge | 970 | mov edi, [ati_io] |
971 | mov ecx ,RD_TIMEOUT |
||
214 | serge | 972 | @@: |
227 | serge | 973 | mov eax, [edi+RD_RBBM_STATUS] |
974 | and eax,RD_RBBM_ACTIVE |
||
975 | jz .exit |
||
214 | serge | 976 | |
227 | serge | 977 | sub ecx,1 |
978 | jnz @B |
||
214 | serge | 979 | .exit: |
227 | serge | 980 | call engFlush |
981 | ret |
||
214 | serge | 982 | endp |
983 | |||
630 | serge | 984 | |
214 | serge | 985 | align 4 |
986 | proc engRestore |
||
987 | |||
988 | ; push dword 1 |
||
989 | ; call engWaitForFifo |
||
990 | |||
991 | ; mov dword [MMIO+RD_RB2D_DSTCACHE_MODE], 0 |
||
992 | |||
227 | serge | 993 | push dword 3 |
994 | call engWaitForFifo |
||
214 | serge | 995 | |
996 | mov edi, [ati_io] |
||
997 | |||
998 | mov eax, [edi+RD_DISPLAY_BASE_ADDR] |
||
999 | shr eax, 10d |
||
1000 | or eax,(64d shl 22d) |
||
1001 | mov [edi+RD_DEFAULT_OFFSET],eax |
||
1002 | mov [edi+RD_SRC_PITCH_OFFSET],eax |
||
1003 | mov [edi+RD_DST_PITCH_OFFSET],eax |
||
1004 | |||
1005 | push dword 1 |
||
1006 | call engWaitForFifo |
||
1007 | |||
1008 | mov edi, [ati_io] |
||
1009 | mov eax, [edi+RD_DP_DATATYPE] |
||
1010 | btr eax, 29d |
||
1011 | mov [edi+RD_DP_DATATYPE],eax |
||
1012 | |||
1013 | push dword 1 |
||
1014 | call engWaitForFifo |
||
1015 | |||
1016 | mov edi, [ati_io] |
||
1017 | mov dword [edi+RD_DEFAULT_SC_BOTTOM_RIGHT],\ |
||
1018 | (RD_DEFAULT_SC_RIGHT_MAX or RD_DEFAULT_SC_BOTTOM_MAX) |
||
1019 | |||
1020 | push dword 1 |
||
1021 | call engWaitForFifo |
||
1022 | |||
1023 | mov edi, [ati_io] |
||
1024 | mov dword [edi+RD_DP_GUI_MASTER_CNTL],\ |
||
1025 | (RD_GMC_BRUSH_SOLID_COLOR or \ |
||
1026 | RD_GMC_SRC_DATATYPE_COLOR or \ |
||
1027 | (6 shl RD_GMC_DST_DATATYPE_SHIFT) or \ |
||
1028 | RD_GMC_CLR_CMP_CNTL_DIS or \ |
||
1029 | RD_ROP3_P or \ |
||
1030 | RD_GMC_WR_MSK_DIS) |
||
1031 | |||
1032 | |||
1033 | push dword 7 |
||
1034 | call engWaitForFifo |
||
1035 | |||
1036 | mov edi, [ati_io] |
||
1037 | |||
1038 | mov dword [edi+RD_DST_LINE_START],0 |
||
1039 | mov dword [edi+RD_DST_LINE_END], 0 |
||
1040 | mov dword [edi+RD_DP_BRUSH_FRGD_CLR], 808000ffh |
||
1041 | mov dword [edi+RD_DP_BRUSH_BKGD_CLR], 002020ffh |
||
1042 | mov dword [edi+RD_DP_SRC_FRGD_CLR], 808000ffh |
||
1043 | mov dword [edi+RD_DP_SRC_BKGD_CLR], 004000ffh |
||
1044 | mov dword [edi+RD_DP_WRITE_MASK],0ffffffffh |
||
1045 | |||
1046 | call engWaitForIdle |
||
1047 | |||
1048 | ret |
||
1049 | endp |
||
1050 | |||
1051 | |||
1052 | |||
630 | serge | 1053 | align 4 |
1054 | dword2str: |
||
1055 | mov esi, hex_buff |
||
1056 | mov ecx, -8 |
||
1057 | @@: |
||
1058 | rol eax, 4 |
||
1059 | mov ebx, eax |
||
1060 | and ebx, 0x0F |
||
1061 | mov bl, [ebx+hexletters] |
||
1062 | mov [8+esi+ecx], bl |
||
1063 | inc ecx |
||
1064 | jnz @B |
||
1065 | ret |
||
214 | serge | 1066 | |
630 | serge | 1067 | hexletters db '0123456789ABCDEF' |
1068 | hex_buff db 8 dup(0),13,10,0 |
||
214 | serge | 1069 | |
669 | andrew_pro | 1070 | R200M equ 0x5a62 ;R300 |
640 | andrew_pro | 1071 | R7000 equ 0x5159 ;R200 |
749 | Lrz | 1072 | R750M equ 0x4c57 ;M7 mobile rv200 |
630 | serge | 1073 | R8500 equ 0x514C ;R200 |
1074 | R9000 equ 0x4966 ;RV250 |
||
1075 | R9200 equ 0x5961 ;RV280 |
||
1076 | R9200SE equ 0x5964 ;RV280 |
||
1077 | R9500 equ 0x4144 ;R300 |
||
1078 | R9500P equ 0x4E45 ;R300 |
||
1079 | R9550 equ 0x4153 ;RV350 |
||
1080 | R9600 equ 0x4150 ;RV350 |
||
1081 | R9600XT equ 0x4152 ;RV360 |
||
1082 | R9700P equ 0x4E44 ;R300 |
||
1083 | R9800 equ 0x4E49 ;R350 |
||
1084 | R9800P equ 0x4E48 ;R350 |
||
1085 | R9800XT equ 0x4E4A ;R360 |
||
214 | serge | 1086 | |
1087 | |||
1088 | align 4 |
||
1089 | |||
640 | andrew_pro | 1090 | devices: |
669 | andrew_pro | 1091 | dd (R200M shl 16)+VID_ATI, init_r200 ;R300 |
1092 | dd (R7000 shl 16)+VID_ATI, init_r200 |
||
749 | Lrz | 1093 | dd (R750M shl 16)+VID_ATI, init_r200 ;M7 |
669 | andrew_pro | 1094 | dd (R8500 shl 16)+VID_ATI, init_r200 |
630 | serge | 1095 | dd (R9000 shl 16)+VID_ATI, init_r200 |
639 | serge | 1096 | dd (0x514D shl 16)+VID_ATI, init_r200 ;R200 9100 |
1097 | |||
630 | serge | 1098 | dd (R9200 shl 16)+VID_ATI, init_r200 |
1099 | dd (R9200SE shl 16)+VID_ATI, init_r200 |
||
639 | serge | 1100 | |
1101 | dd (0x5960 shl 16)+VID_ATI, init_r200 ;RV280 9250 |
||
1102 | |||
630 | serge | 1103 | dd (R9500 shl 16)+VID_ATI, init_r200 |
1104 | dd (R9500P shl 16)+VID_ATI, init_r200 |
||
1105 | dd (R9550 shl 16)+VID_ATI, init_r200 |
||
214 | serge | 1106 | |
630 | serge | 1107 | dd (R9600 shl 16)+VID_ATI, init_r200 |
1108 | dd (R9600XT shl 16)+VID_ATI, init_r200 |
||
1109 | dd (0x4155 shl 16)+VID_ATI, init_r200 ;RV350 9600 |
||
1110 | dd (0x4151 shl 16)+VID_ATI, init_r200 ;RV350 9600 |
||
1111 | dd (0x4E51 shl 16)+VID_ATI, init_r200 ;RV350 9600 |
||
214 | serge | 1112 | |
630 | serge | 1113 | dd (R9700P shl 16)+VID_ATI, init_r200 |
214 | serge | 1114 | |
630 | serge | 1115 | dd (0x4148 shl 16)+VID_ATI, init_r200 ;R350 9800 |
1116 | dd (R9800 shl 16)+VID_ATI, init_r200 |
||
1117 | dd (R9800P shl 16)+VID_ATI, init_r200 |
||
1118 | dd (R9800XT shl 16)+VID_ATI, init_r200 |
||
214 | serge | 1119 | |
630 | serge | 1120 | dd (0x5B60 shl 16)+VID_ATI, init_r200 ;RV370 X300/X550 |
1121 | dd (0x5B63 shl 16)+VID_ATI, init_r200 ;RV370 X550 |
||
1122 | dd (0x5B62 shl 16)+VID_ATI, init_r200 ;RV380x X600 |
||
1123 | dd (0x3E50 shl 16)+VID_ATI, init_r200 ;RV380 X600/X550 |
||
214 | serge | 1124 | |
630 | serge | 1125 | dd (0x5B4F shl 16)+VID_ATI, init_r200 ;RV410 X700 |
1126 | dd (0x5B4D shl 16)+VID_ATI, init_r200 ;RV410 X700 |
||
1127 | dd (0x5B4B shl 16)+VID_ATI, init_r200 ;RV410 X700 |
||
1128 | dd (0x5B4C shl 16)+VID_ATI, init_r200 ;RV410 X700 |
||
1129 | |||
1130 | dd (0x4a49 shl 16)+VID_ATI, init_r200 ;R420 X800 PRO/GTO |
||
1131 | dd (0x4a4B shl 16)+VID_ATI, init_r200 ;R420 X800 |
||
1132 | dd (0x5549 shl 16)+VID_ATI, init_r200 ;R423 X800 |
||
1133 | dd (0x4a4A shl 16)+VID_ATI, init_r200 ;R420 X800 |
||
1134 | dd (0x554F shl 16)+VID_ATI, init_r200 ;R430 X800 |
||
1135 | dd (0x554D shl 16)+VID_ATI, init_r200 ;R430 X800 |
||
1136 | dd (0x554E shl 16)+VID_ATI, init_r200 ;R430 X800 |
||
1137 | dd (0x5D57 shl 16)+VID_ATI, init_r200 ;R423 X800 XT |
||
1138 | dd (0x4A50 shl 16)+VID_ATI, init_r200 ;R420 X800 XT |
||
1139 | dd (0x554A shl 16)+VID_ATI, init_r200 ;R423 X800 XT |
||
1140 | dd (0x5D4F shl 16)+VID_ATI, init_r200 ;R423 X800/X850 |
||
1141 | dd (0x554B shl 16)+VID_ATI, init_r200 ;R423 X800 GT |
||
1142 | |||
1143 | dd (0x4B4B shl 16)+VID_ATI, init_r200 ;R481 X850 |
||
1144 | dd (0x4B49 shl 16)+VID_ATI, init_r200 ;R481 X850 |
||
1145 | dd (0x4B4C shl 16)+VID_ATI, init_r200 ;R481 X850 |
||
1146 | |||
1147 | dd (0x5D4D shl 16)+VID_ATI, init_r200 ;R480 X850 |
||
1148 | dd (0x5D52 shl 16)+VID_ATI, init_r200 ;R480 X850 |
||
1149 | |||
1150 | dd (0x791E shl 16)+VID_ATI, init_r500 ;RS690 X1200 |
||
1151 | |||
1152 | dd (0x7140 shl 16)+VID_ATI, init_r500 ;RV515 X1300 |
||
1153 | dd (0x7142 shl 16)+VID_ATI, init_r500 ;RV515 X1300 |
||
1154 | dd (0x7146 shl 16)+VID_ATI, init_r500 ;RV515 X1300 |
||
1155 | dd (0x714D shl 16)+VID_ATI, init_r500 ;RV515 X1300 |
||
1156 | dd (0x714E shl 16)+VID_ATI, init_r500 ;RV515 X1300 |
||
1157 | |||
1158 | dd (0x7183 shl 16)+VID_ATI, init_r500 ;RV515 X1300 |
||
1159 | dd (0x7187 shl 16)+VID_ATI, init_r500 ;RV515 X1300 |
||
1160 | dd (0x718F shl 16)+VID_ATI, init_r500 ;RV515 X1300 |
||
1161 | |||
1162 | dd (0x7143 shl 16)+VID_ATI, init_r500 ;RV515 X1550 |
||
1163 | dd (0x7147 shl 16)+VID_ATI, init_r500 ;RV515 X1550 |
||
1164 | dd (0x715F shl 16)+VID_ATI, init_r500 ;RV515 X1550 |
||
1165 | dd (0x7193 shl 16)+VID_ATI, init_r500 ;RV515 X1550 |
||
1166 | dd (0x719F shl 16)+VID_ATI, init_r500 ;RV515 X1550 |
||
1167 | |||
1168 | dd (0x71C0 shl 16)+VID_ATI, init_r500 ;RV530 X1600 |
||
1169 | dd (0x71C1 shl 16)+VID_ATI, init_r500 ;RV535 X1650 |
||
1170 | dd (0x71C2 shl 16)+VID_ATI, init_r500 ;RV530 X1600 |
||
1171 | dd (0x71C3 shl 16)+VID_ATI, init_r500 ;RV535 X1600 |
||
1172 | dd (0x71C6 shl 16)+VID_ATI, init_r500 ;RV530 X1600 |
||
1173 | dd (0x71C7 shl 16)+VID_ATI, init_r500 ;RV534 X1650 |
||
1174 | |||
1175 | dd (0x7181 shl 16)+VID_ATI, init_r500 ;RV515 X1600 |
||
1176 | dd (0x71CD shl 16)+VID_ATI, init_r500 ;RV530 X1600 |
||
1177 | |||
1178 | dd (0x7291 shl 16)+VID_ATI, init_r500 ;R580 X1650 |
||
1179 | dd (0x7293 shl 16)+VID_ATI, init_r500 ;R580 X1650 |
||
1180 | |||
1181 | dd (0x7100 shl 16)+VID_ATI, init_r500 ;RV520 X1800 |
||
1182 | dd (0x7109 shl 16)+VID_ATI, init_r500 ;RV520 X1800 |
||
1183 | dd (0x710A shl 16)+VID_ATI, init_r500 ;RV520 X1800 GTO |
||
1184 | |||
1185 | dd (0x7249 shl 16)+VID_ATI, init_r500 ;RV580 X1900 |
||
1186 | dd (0x724B shl 16)+VID_ATI, init_r500 ;RV580 X1900 GT |
||
1187 | |||
1188 | dd (0x7240 shl 16)+VID_ATI, init_r500 ;RV580 X1950 |
||
1189 | dd (0x7244 shl 16)+VID_ATI, init_r500 ;RV580 X1950 |
||
1190 | dd (0x7248 shl 16)+VID_ATI, init_r500 ;RV580 X1950 |
||
1191 | |||
1192 | dd (0x7288 shl 16)+VID_ATI, init_r500 ;R580 X1950 GT |
||
1193 | dd (0x7280 shl 16)+VID_ATI, init_r500 ;R580 X1950 PRO |
||
1194 | |||
1195 | dd (0x94C3 shl 16)+VID_ATI, init_r500 ;RV610 HD 2400 PRO |
||
1196 | dd (0x94C1 shl 16)+VID_ATI, init_r500 ;RV610 HD 2400 XT |
||
1197 | |||
1198 | dd (0x9589 shl 16)+VID_ATI, init_r500 ;RV630 HD 2600 PRO |
||
1199 | dd (0x958A shl 16)+VID_ATI, init_r500 ;RV630 HD 2600 X2 |
||
1200 | dd (0x9588 shl 16)+VID_ATI, init_r500 ;RV630 HD 2600 XT |
||
1201 | |||
1202 | dd (0x9403 shl 16)+VID_ATI, init_r500 ;R600 HD 2900 PRO |
||
1203 | dd (0x9409 shl 16)+VID_ATI, init_r500 ;R600 HD 2900 XT |
||
1204 | |||
1205 | |||
214 | serge | 1206 | dd 0 ;terminator |
1207 | |||
465 | serge | 1208 | version dd (5 shl 16) or (API_VERSION and 0xFFFF) |
214 | serge | 1209 | |
729 | serge | 1210 | if R500_HW2D |
630 | serge | 1211 | |
729 | serge | 1212 | align 16 |
1213 | R5xxRops dd R5XX_ROP3_ZERO, R5XX_ROP3_ZERO ;GXclear |
||
1214 | dd R5XX_ROP3_DSa, R5XX_ROP3_DPa ;Gxand |
||
1215 | dd R5XX_ROP3_SDna, R5XX_ROP3_PDna ;GXandReverse |
||
1216 | dd R5XX_ROP3_S, R5XX_ROP3_P ;GXcopy |
||
1217 | dd R5XX_ROP3_DSna, R5XX_ROP3_DPna ;GXandInverted |
||
1218 | dd R5XX_ROP3_D, R5XX_ROP3_D ;GXnoop |
||
1219 | dd R5XX_ROP3_DSx, R5XX_ROP3_DPx ;GXxor |
||
1220 | dd R5XX_ROP3_DSo, R5XX_ROP3_DPo ;GXor |
||
1221 | dd R5XX_ROP3_DSon, R5XX_ROP3_DPon ;GXnor |
||
1222 | dd R5XX_ROP3_DSxn, R5XX_ROP3_PDxn ;GXequiv |
||
1223 | dd R5XX_ROP3_Dn, R5XX_ROP3_Dn ;GXinvert |
||
1224 | dd R5XX_ROP3_SDno, R5XX_ROP3_PDno ;GXorReverse |
||
1225 | dd R5XX_ROP3_Sn, R5XX_ROP3_Pn ;GXcopyInverted |
||
1226 | dd R5XX_ROP3_DSno, R5XX_ROP3_DPno ;GXorInverted |
||
1227 | dd R5XX_ROP3_DSan, R5XX_ROP3_DPan ;GXnand |
||
1228 | dd R5XX_ROP3_ONE, R5XX_ROP3_ONE ;GXset |
||
1229 | end if |
||
1230 | |||
1231 | |||
227 | serge | 1232 | sz_ati_srv db 'HWCURSOR',0 |
214 | serge | 1233 | |
1234 | msgInit db 'detect hardware...',13,10,0 |
||
1235 | msgPCI db 'PCI accsess not supported',13,10,0 |
||
1236 | msgFail db 'device not found',13,10,0 |
||
233 | serge | 1237 | msg_neg db 'neg ecx',13,10,0 |
630 | serge | 1238 | |
729 | serge | 1239 | if R500_HW2D |
1240 | |||
732 | serge | 1241 | sz_HDraw_srv db 'HDRAW',0 |
1242 | |||
729 | serge | 1243 | msgR5xx2DFlushtimeout \ |
1244 | db 'R5xx2DFlush timeout error',13,10,0 |
||
1245 | msgR5xxFIFOWaitLocaltimeout \ |
||
1246 | db 'R5xxFIFOWaitLocal timeout error', 13, 10,0 |
||
1247 | msgR5xx2DIdleLocaltimeout \ |
||
1248 | db 'R5xx2DIdleLocal timeout error', 13,10,0 |
||
1249 | end if |
||
1250 | |||
630 | serge | 1251 | if 0 |
1252 | msg6100 db '6100: ',0 |
||
1253 | msg6104 db '6104: ',0 |
||
1254 | msg6108 db '6108: ',0 |
||
1255 | msg6110 db '6110: ',0 |
||
1256 | msg6120 db '6120: ',0 |
||
1257 | msg6124 db '6124: ',0 |
||
1258 | msg6128 db '6128: ',0 |
||
1259 | msg612C db '612C: ',0 |
||
1260 | msg6130 db '6130: ',0 |
||
1261 | msg6134 db '6134: ',0 |
||
1262 | msg6138 db '6138: ',0 |
||
1263 | end if |
||
1264 | |||
233 | serge | 1265 | buff db 8 dup(0) |
1266 | db 13,10, 0 |
||
214 | serge | 1267 | |
1268 | section '.data' data readable writable align 16 |
||
1269 | |||
1270 | pCursor db 4096 dup(?) |
||
1271 | |||
227 | serge | 1272 | cursor_map rd 2 |
1273 | cursor_start rd 1 |
||
1274 | cursor_end rd 1 |
||
214 | serge | 1275 | |
630 | serge | 1276 | fnSelect rd 1 |
1277 | fnSet rd 1 |
||
1278 | oldSelect rd 1 |
||
1279 | oldSet rd 1 |
||
1280 | oldRestore rd 1 |
||
1281 | oldCreate rd 1 |
||
1282 | |||
1283 | r500_LFB rd 1 |
||
1284 | |||
227 | serge | 1285 | bus dd ? |
1286 | devfn dd ? |
||
1287 | ati_io dd ? |
||
214 | serge | 1288 | |
729 | serge | 1289 | if R500_HW2D |
214 | serge | 1290 | |
734 | serge | 1291 | __xmin rd 1 |
1292 | __xmax rd 1 |
||
1293 | __ymin rd 1 |
||
1294 | __ymax rd 1 |
||
1295 | |||
729 | serge | 1296 | rhd RHD |
227 | serge | 1297 | |
729 | serge | 1298 | end if |