TMAP_LNT.ASM 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. ; THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  2. ; SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
  3. ; END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  4. ; ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  5. ; IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  6. ; SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  7. ; FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  8. ; CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
  9. ; AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
  10. ; COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
  11. .386
  12. option oldstructs
  13. .nolist
  14. include pstypes.inc
  15. include psmacros.inc
  16. include tmap_inc.asm
  17. .list
  18. assume cs:_TEXT, ds:_DATA
  19. _DATA segment dword public USE32 'DATA'
  20. rcsid db "$Id: tmap_lnt.asm 1.2 1996/01/24 18:33:58 matt Exp $"
  21. align 4
  22. num_big_steps dd ?
  23. _DATA ends
  24. _TEXT segment para public USE32 'CODE'
  25. align 16
  26. public asm_tmap_scanline_lnt_
  27. asm_tmap_scanline_lnt_:
  28. START_TIMER
  29. push eax
  30. push ecx
  31. push edx
  32. push ebx
  33. push ebp
  34. push esi
  35. push edi
  36. ; set edi = address of first pixel to modify
  37. mov edi, _dest_row_data
  38. mov eax, _fx_v
  39. shr eax, 6
  40. mov edx, _fx_u
  41. shl edx, 10
  42. mov dx, ax ; EDX=U:V in 6.10 format
  43. mov eax, _fx_dv_dx
  44. shr eax, 6
  45. mov esi, _fx_du_dx
  46. shl esi, 10
  47. mov si, ax ; ESI=DU:DV in 6.10 format
  48. mov ecx, _pixptr
  49. mov eax, _loop_count
  50. inc eax
  51. mov _loop_count, eax
  52. shr eax, 3
  53. je DoLeftOverPixels
  54. mov num_big_steps, eax
  55. and _loop_count, 7
  56. NextPixelBlock:
  57. COUNT = 0
  58. REPT 8
  59. mov eax, edx
  60. shr ax, 10
  61. rol eax, 6
  62. and eax, 0ffffh
  63. add edx, esi
  64. mov al, [ecx+eax]
  65. cmp al, 255
  66. je @f
  67. mov [edi+COUNT], al
  68. @@:
  69. COUNT = COUNT + 1
  70. ENDM
  71. add edi, COUNT
  72. dec num_big_steps
  73. jne NextPixelBlock
  74. DoLeftOverPixels:
  75. mov eax,_loop_count
  76. test eax, -1
  77. jz _none_to_do
  78. shr eax, 1
  79. je one_more_pix
  80. mov _loop_count, eax
  81. pushf
  82. NextPixel:
  83. COUNT = 0
  84. REPT 2
  85. mov eax, edx
  86. shr ax, 10
  87. rol eax, 6
  88. and eax, 0ffffh
  89. add edx, esi
  90. mov al, [ecx+eax]
  91. cmp al, 255
  92. je @f
  93. mov [edi+COUNT], al
  94. @@:
  95. COUNT = COUNT + 1
  96. ENDM
  97. add edi, COUNT
  98. dec _loop_count
  99. jne NextPixel
  100. popf
  101. jnc _none_to_do
  102. one_more_pix:
  103. mov eax, edx
  104. shr ax, 10
  105. rol eax, 6
  106. and eax, 0ffffh
  107. mov al, [ecx+eax]
  108. cmp al, 255
  109. je @f
  110. mov [edi], al
  111. @@:
  112. _none_to_do:
  113. pop edi
  114. pop esi
  115. pop ebp
  116. pop ebx
  117. pop edx
  118. pop ecx
  119. pop eax
  120. STOP_TIMER
  121. ret
  122. _TEXT ends
  123. end