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