1/*         ______   ___    ___
2 *        /\  _  \ /\_ \  /\_ \
3 *        \ \ \L\ \\//\ \ \//\ \      __     __   _ __   ___
4 *         \ \  __ \ \ \ \  \ \ \   /'__`\ /'_ `\/\`'__\/ __`\
5 *          \ \ \/\ \ \_\ \_ \_\ \_/\  __//\ \L\ \ \ \//\ \L\ \
6 *           \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
7 *            \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
8 *                                           /\____/
9 *                                           \_/__/
10 *
11 *      DGA2 bank switching code. These routines will be called
12 *      with a line number in %eax and a pointer to the bitmap in %edx.
13 *      The bank switcher should select the appropriate bank for the
14 *      line, and replace %eax with a pointer to the start of the line.
15 *
16 *      By Angelo Mottola.
17 *
18 *      See readme.txt for copyright information.
19 */
20
21
22#include "allegro/platform/alunixac.h"
23#include "../i386/asmdefs.inc"
24
25.text
26
27
28#if (!defined ALLEGRO_NO_ASM) && (defined ALLEGRO_XWINDOWS_WITH_XF86DGA2)
29#if (!defined ALLEGRO_WITH_MODULES) || (defined ALLEGRO_MODULE)
30
31FUNC (_xdga2_write_line_asm)
32
33	/* check whether bitmap is already locked */
34	testl $BMP_ID_LOCKED, BMP_ID(%edx)
35	jnz Locked
36
37	pushl %ecx
38	pushl %eax
39	pushl %edx
40	call GLOBL(_xdga2_lock)
41	popl %edx
42	popl %eax
43	popl %ecx
44
45   Locked:
46	/* get pointer to the video memory */
47	movl BMP_LINE(%edx,%eax,4), %eax
48
49	ret
50
51#endif
52#endif
53
54