comparison src/hermes/mmx_main.asm @ 0:74212992fb08

Initial revision
author Sam Lantinga <slouken@lokigames.com>
date Thu, 26 Apr 2001 16:45:43 +0000
parents
children da33b7e6d181
comparison
equal deleted inserted replaced
-1:000000000000 0:74212992fb08
1 ;
2 ; mmx format converter main loops for HERMES
3 ; Some routines Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk)
4 ; This source code is licensed under the GNU LGPL
5 ;
6 ; Please refer to the file COPYING.LIB contained in the distribution for
7 ; licensing conditions
8 ;
9
10 BITS 32
11
12 GLOBAL _ConvertMMX
13 GLOBAL _mmxreturn
14
15
16 SECTION .text
17
18 ;; _ConvertMMX:
19 ;; [ESP+8] ConverterInfo*
20 ;; --------------------------------------------------------------------------
21 ;; ConverterInfo (ebp+..)
22 ;; 0: void *s_pixels
23 ;; 4: int s_width
24 ;; 8: int s_height
25 ;; 12: int s_add
26 ;; 16: void *d_pixels
27 ;; 20: int d_width
28 ;; 24: int d_height
29 ;; 28: int d_add
30 ;; 32: void (*converter_function)()
31 ;; 36: int32 *lookup
32
33 _ConvertMMX:
34 push ebp
35 mov ebp,esp
36
37 ; Save the registers used by the blitters, necessary for optimized code
38 pusha
39
40 mov eax,[ebp+8]
41
42 cmp dword [eax+4],BYTE 0
43 je endconvert
44
45 mov ebp,eax
46
47 mov esi,[ebp+0]
48 mov edi,[ebp+16]
49
50 y_loop:
51 mov ecx,[ebp+4]
52
53 jmp [ebp+32]
54
55 _mmxreturn:
56 add esi,[ebp+12]
57 add edi,[ebp+28]
58
59 dec dword [ebp+8]
60 jnz y_loop
61
62
63 ; Restore the registers used by the blitters, necessary for optimized code
64 popa
65
66 pop ebp
67
68 endconvert:
69 emms
70
71 ret
72
73
74