2 * Mesa 3-D graphics library
5 * Copyright (C) 1999 Brian Paul All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 * DOS/DJGPP device driver v1.3 for Mesa 5.0
28 * Copyright (C) 2002 - Borca Daniel
29 * Email : dborca@yahoo.com
30 * Web : http://www.geocities.com/dborca
37 * extern void *vl_current_draw_buffer;
38 * extern int vl_current_width, vl_current_bytes;
43 /* Desc: void v_clear8 (int color);
48 * Note: uses current draw buffer
60 /* Desc: void v_clear16 (int color);
65 * Note: uses current draw buffer
76 /* Desc: void v_clear32 (int color);
81 * Note: uses current draw buffer
89 movl _vl_current_bytes, %ecx
90 movl _vl_current_draw_buffer, %edx
100 /* Desc: void v_clear8_mmx (int color);
105 * Note: uses current draw buffer
108 .global _v_clear8_mmx
114 jmp _v_clear_common_mmx
117 /* Desc: void v_clear16_mmx (int color);
122 * Note: uses current draw buffer
125 .global _v_clear16_mmx
130 jmp _v_clear_common_mmx
133 /* Desc: void v_clear32_mmx (int color);
138 * Note: uses current draw buffer
141 .global _v_clear32_mmx
148 movl _vl_current_bytes, %ecx
149 movl _vl_current_draw_buffer, %edx
161 /* Desc: void v_clear24 (int color);
166 * Note: uses current draw buffer
171 movl $0xaaaaaaab, %eax
172 mull _vl_current_bytes
176 movl _vl_current_draw_buffer, %edx
189 /* Desc: void v_clear24_mmx (int color);
194 * Note: uses current draw buffer
197 .global _v_clear24_mmx
220 movl $0xaaaaaaab, %eax
221 mull _vl_current_bytes
223 movl _vl_current_draw_buffer, %edx
238 /* Desc: void v_rect8 (int color);
243 * Note: uses current draw buffer
252 movl _vl_current_width, %esi
264 addl _vl_current_draw_buffer, %edi
291 /* Desc: void v_rect16 (int color);
296 * Note: uses current draw buffer
305 movl _vl_current_width, %esi
318 addl _vl_current_draw_buffer, %edi
339 /* Desc: void v_rect24 (int color);
344 * Note: uses current draw buffer
352 movl _vl_current_width, %esi
359 leal (%esi, %esi, 2), %esi
361 leal (%edi, %edi, 2), %edi
363 addl _vl_current_draw_buffer, %edi
384 /* Desc: void v_rect32 (int color);
389 * Note: uses current draw buffer
396 movl _vl_current_width, %esi
406 addl _vl_current_draw_buffer, %edi
424 /* Desc: void v_putpixel8 (unsigned int offset, int color);
426 * In : offset within buffer, color
429 * Note: uses current draw buffer
436 movl _vl_current_draw_buffer, %eax
437 movb %cl, (%eax,%edx)
440 /* Desc: void v_putpixel16 (unsigned int offset, int color);
442 * In : offset within buffer, color
445 * Note: uses current draw buffer
448 .global _v_putpixel16
452 movl _vl_current_draw_buffer, %eax
453 movw %cx, (%eax,%edx,2)
456 /* Desc: void v_putpixel24 (unsigned int offset, int color);
458 * In : offset within buffer, color
461 * Note: uses current draw buffer
464 .global _v_putpixel24
468 movl _vl_current_draw_buffer, %ecx
469 leal (%eax,%eax,2), %eax
470 movw %dx, (%ecx,%eax)
472 movb %dl, 2(%ecx,%eax)
475 /* Desc: void v_putpixel32 (unsigned int offset, int color);
477 * In : offset within buffer, color
480 * Note: uses current draw buffer
483 .global _v_putpixel32
487 movl _vl_current_draw_buffer, %eax
488 movl %ecx, (%eax,%edx,4)