Subversion Repositories Kolibri OS

Rev

Rev 9172 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  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. %include "common.inc"
  13.  
  14. SDL_FUNC _ConvertMMX
  15. SDL_FUNC ConvertMMX
  16.  
  17. SECTION .text
  18.                
  19. ;; _ConvertMMX:  
  20. ;; [ESP+8] ConverterInfo*
  21. ;; --------------------------------------------------------------------------
  22. ;; ConverterInfo (ebp+..)
  23. ;;   0: void *s_pixels
  24. ;;   4: int s_width
  25. ;;   8: int s_height
  26. ;;  12: int s_add
  27. ;;  16: void *d_pixels
  28. ;;  20: int d_width
  29. ;;  24: int d_height
  30. ;;  28: int d_add
  31. ;;  32: void (*converter_function)()
  32. ;;  36: int32 *lookup
  33.  
  34. ConvertMMX
  35. _ConvertMMX:
  36.         push ebp
  37.         mov ebp,esp
  38.  
  39. ; Save the registers used by the blitters, necessary for optimized code
  40.         pusha
  41.  
  42.         mov eax,[ebp+8]
  43.  
  44.         cmp dword [eax+4],BYTE 0
  45.         je endconvert
  46.        
  47.         mov ebp,eax
  48.        
  49.         mov esi,[ebp+0]
  50.         mov edi,[ebp+16]
  51.        
  52. y_loop:
  53.         mov ecx,[ebp+4]
  54.  
  55.         call [ebp+32]
  56.  
  57.         add esi,[ebp+12]
  58.         add edi,[ebp+28]
  59.        
  60.         dec dword  [ebp+8]
  61.         jnz y_loop
  62.  
  63.        
  64. ; Restore the registers used by the blitters, necessary for optimized code
  65.         popa
  66.  
  67.         pop ebp
  68.  
  69. endconvert:
  70.         emms
  71.        
  72.         ret            
  73.  
  74. %ifidn __OUTPUT_FORMAT__,elf32
  75. section .note.GNU-stack noalloc noexec nowrite progbits
  76. %endif
  77.