TMAP_LLT.ASM 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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_llt.asm 1.2 1996/01/24 18:33:44 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_llt_
  27. asm_tmap_scanline_llt_:
  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 ebx, _fx_l
  49. mov ebp, _fx_dl_dx
  50. mov ecx, _pixptr
  51. mov eax, _loop_count
  52. inc eax
  53. mov _loop_count, eax
  54. shr eax, 3
  55. je DoLeftOverPixels
  56. mov num_big_steps, eax
  57. and _loop_count, 7
  58. NextPixelBlock:
  59. COUNT = 0
  60. REPT 8
  61. mov eax, edx
  62. shr ax, 10
  63. rol eax, 6
  64. and eax, 0ffffh
  65. add edx, esi
  66. mov al, [ecx+eax]
  67. mov ah, bh
  68. add ebx, ebp
  69. cmp al, 255
  70. je @f
  71. mov al, _gr_fade_table[eax]
  72. mov [edi+COUNT], al
  73. @@:
  74. COUNT = COUNT + 1
  75. ENDM
  76. add edi, COUNT
  77. dec num_big_steps
  78. jne NextPixelBlock
  79. DoLeftOverPixels:
  80. mov eax,_loop_count
  81. test eax, -1
  82. jz _none_to_do
  83. shr eax, 1
  84. je one_more_pix
  85. mov _loop_count, eax
  86. pushf
  87. NextPixel:
  88. COUNT = 0
  89. REPT 2
  90. mov eax, edx
  91. shr ax, 10
  92. rol eax, 6
  93. and eax, 0ffffh
  94. add edx, esi
  95. mov al, [ecx+eax]
  96. mov ah, bh
  97. add ebx, ebp
  98. cmp al, 255
  99. je @f
  100. mov al, _gr_fade_table[eax]
  101. mov [edi+COUNT], al
  102. @@:
  103. COUNT = COUNT + 1
  104. ENDM
  105. add edi, COUNT
  106. dec _loop_count
  107. jne NextPixel
  108. popf
  109. jnc _none_to_do
  110. one_more_pix:
  111. mov eax, edx
  112. shr ax, 10
  113. rol eax, 6
  114. and eax, 0ffffh
  115. mov al, [ecx+eax]
  116. mov ah, bh
  117. cmp al, 255
  118. je @f
  119. mov al, _gr_fade_table[eax]
  120. mov [edi], al
  121. @@:
  122. _none_to_do:
  123. pop edi
  124. pop esi
  125. pop ebp
  126. pop ebx
  127. pop edx
  128. pop ecx
  129. pop eax
  130. STOP_TIMER
  131. ret
  132. _TEXT ends
  133. end