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
116 jmp _v_clear_common_mmx
118 /* Desc: void v_clear16_mmx (int color);
123 * Note: uses current draw buffer
126 .global _v_clear16_mmx
133 jmp _v_clear_common_mmx
135 /* Desc: void v_clear32_mmx (int color);
140 * Note: uses current draw buffer
143 .global _v_clear32_mmx
151 movl _vl_current_bytes, %ecx
152 movl _vl_current_draw_buffer, %edx
166 /* Desc: void v_clear24 (int color);
171 * Note: uses current draw buffer
176 movl $0xaaaaaaab, %eax
177 mull _vl_current_bytes
181 movl _vl_current_draw_buffer, %edx
194 /* Desc: void v_clear24_mmx (int color);
199 * Note: uses current draw buffer
202 .global _v_clear24_mmx
225 movl $0xaaaaaaab, %eax
226 mull _vl_current_bytes
228 movl _vl_current_draw_buffer, %edx
243 /* Desc: void v_rect8 (int color);
248 * Note: uses current draw buffer
257 movl _vl_current_width, %esi
269 addl _vl_current_draw_buffer, %edi
296 /* Desc: void v_rect16 (int color);
301 * Note: uses current draw buffer
310 movl _vl_current_width, %esi
323 addl _vl_current_draw_buffer, %edi
344 /* Desc: void v_rect24 (int color);
349 * Note: uses current draw buffer
357 movl _vl_current_width, %esi
364 leal (%esi, %esi, 2), %esi
366 leal (%edi, %edi, 2), %edi
368 addl _vl_current_draw_buffer, %edi
389 /* Desc: void v_rect32 (int color);
394 * Note: uses current draw buffer
401 movl _vl_current_width, %esi
411 addl _vl_current_draw_buffer, %edi
429 /* Desc: void v_putpixel8 (unsigned int offset, int color);
431 * In : offset within buffer, color
434 * Note: uses current draw buffer
441 movl _vl_current_draw_buffer, %eax
442 movb %cl, (%eax,%edx)
445 /* Desc: void v_putpixel16 (unsigned int offset, int color);
447 * In : offset within buffer, color
450 * Note: uses current draw buffer
453 .global _v_putpixel16
457 movl _vl_current_draw_buffer, %eax
458 movw %cx, (%eax,%edx,2)
461 /* Desc: void v_putpixel24 (unsigned int offset, int color);
463 * In : offset within buffer, color
466 * Note: uses current draw buffer
469 .global _v_putpixel24
473 movl _vl_current_draw_buffer, %ecx
474 leal (%eax,%eax,2), %eax
475 movw %dx, (%ecx,%eax)
477 movb %dl, 2(%ecx,%eax)
480 /* Desc: void v_putpixel32 (unsigned int offset, int color);
482 * In : offset within buffer, color
485 * Note: uses current draw buffer
488 .global _v_putpixel32
492 movl _vl_current_draw_buffer, %eax
493 movl %ecx, (%eax,%edx,4)