Rev 8210 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8210 | Rev 9172 | ||
---|---|---|---|
1 | ; |
1 | ; |
2 | ; mmx format converter main loops for HERMES |
2 | ; mmx format converter main loops for HERMES |
3 | ; Some routines Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk) |
3 | ; Some routines Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk) |
4 | ; This source code is licensed under the GNU LGPL |
4 | ; This source code is licensed under the GNU LGPL |
5 | ; |
5 | ; |
6 | ; Please refer to the file COPYING.LIB contained in the distribution for |
6 | ; Please refer to the file COPYING.LIB contained in the distribution for |
7 | ; licensing conditions |
7 | ; licensing conditions |
8 | ; |
8 | ; |
9 | 9 | ||
10 | BITS 32 |
10 | BITS 32 |
11 | - | ||
12 | GLOBAL _ConvertMMX |
11 | |
- | 12 | %include "common.inc" |
|
13 | GLOBAL _mmxreturn |
13 | |
14 | 14 | SDL_FUNC _ConvertMMX |
|
15 | 15 | ||
16 | SECTION .text |
16 | SECTION .text |
17 | 17 | ||
18 | ;; _ConvertMMX: |
18 | ;; _ConvertMMX: |
19 | ;; [ESP+8] ConverterInfo* |
19 | ;; [ESP+8] ConverterInfo* |
20 | ;; -------------------------------------------------------------------------- |
20 | ;; -------------------------------------------------------------------------- |
21 | ;; ConverterInfo (ebp+..) |
21 | ;; ConverterInfo (ebp+..) |
22 | ;; 0: void *s_pixels |
22 | ;; 0: void *s_pixels |
23 | ;; 4: int s_width |
23 | ;; 4: int s_width |
24 | ;; 8: int s_height |
24 | ;; 8: int s_height |
25 | ;; 12: int s_add |
25 | ;; 12: int s_add |
26 | ;; 16: void *d_pixels |
26 | ;; 16: void *d_pixels |
27 | ;; 20: int d_width |
27 | ;; 20: int d_width |
28 | ;; 24: int d_height |
28 | ;; 24: int d_height |
29 | ;; 28: int d_add |
29 | ;; 28: int d_add |
30 | ;; 32: void (*converter_function)() |
30 | ;; 32: void (*converter_function)() |
31 | ;; 36: int32 *lookup |
31 | ;; 36: int32 *lookup |
32 | 32 | ||
33 | _ConvertMMX: |
33 | _ConvertMMX: |
34 | push ebp |
34 | push ebp |
35 | mov ebp,esp |
35 | mov ebp,esp |
36 | 36 | ||
37 | ; Save the registers used by the blitters, necessary for optimized code |
37 | ; Save the registers used by the blitters, necessary for optimized code |
38 | pusha |
38 | pusha |
39 | 39 | ||
40 | mov eax,[ebp+8] |
40 | mov eax,[ebp+8] |
41 | 41 | ||
42 | cmp dword [eax+4],BYTE 0 |
42 | cmp dword [eax+4],BYTE 0 |
43 | je endconvert |
43 | je endconvert |
44 | 44 | ||
45 | mov ebp,eax |
45 | mov ebp,eax |
46 | 46 | ||
47 | mov esi,[ebp+0] |
47 | mov esi,[ebp+0] |
48 | mov edi,[ebp+16] |
48 | mov edi,[ebp+16] |
49 | 49 | ||
50 | y_loop: |
50 | y_loop: |
51 | mov ecx,[ebp+4] |
51 | mov ecx,[ebp+4] |
52 | 52 | ||
53 | jmp [ebp+32] |
- | |
54 | 53 | call [ebp+32] |
|
55 | _mmxreturn: |
54 | |
56 | add esi,[ebp+12] |
55 | add esi,[ebp+12] |
57 | add edi,[ebp+28] |
56 | add edi,[ebp+28] |
58 | 57 | ||
59 | dec dword [ebp+8] |
58 | dec dword [ebp+8] |
60 | jnz y_loop |
59 | jnz y_loop |
61 | 60 | ||
62 | 61 | ||
63 | ; Restore the registers used by the blitters, necessary for optimized code |
62 | ; Restore the registers used by the blitters, necessary for optimized code |
64 | popa |
63 | popa |
65 | 64 | ||
66 | pop ebp |
65 | pop ebp |
67 | 66 | ||
68 | endconvert: |
67 | endconvert: |
69 | emms |
68 | emms |
70 | 69 | ||
71 | ret |
70 | ret |
72 | - | ||
- | 71 | ||
- | 72 | %ifidn __OUTPUT_FORMAT__,elf32 |
|
73 | 73 | section .note.GNU-stack noalloc noexec nowrite progbits |
|
- | 74 | %endif |