Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

260 lines
7.6 KiB

  1. ;-----------------------------------------------------------------------------
  2. ;
  3. ; This file contains the output buffer color writing routines.
  4. ;
  5. ; Copyright (C) Microsoft Corporation, 1997.
  6. ;
  7. ; Need to change this from Segment asm method to be same as other files.
  8. ; This is the only file that is doing it this way.
  9. ;
  10. ;-----------------------------------------------------------------------------
  11. INCLUDE iammx.inc
  12. INCLUDE offs_acp.inc
  13. include(`m4hdr.mh')dnl
  14. include(`cvars.mh')dnl
  15. include(`bufwrite.mh')dnl
  16. .586p
  17. .model flat
  18. .data
  19. PUBLIC g_uDitherValue
  20. g_uDitherValue dq ?
  21. PUBLIC SetAlphato0x00
  22. SetAlphato0x00 dq 0000000000ffffffh
  23. PUBLIC SetAlphato0xff
  24. SetAlphato0xff dq 00000000ff000000h
  25. ; 565 values. Too bad that there are 5 values. 4 values would fit into one cache line.
  26. PUBLIC u888to565RedBlueMask
  27. u888to565RedBlueMask dq 00f800f800f800f8h
  28. PUBLIC u888to565GreenMask
  29. u888to565GreenMask dq 0000fc000000fc00h
  30. PUBLIC u888to565Multiplier
  31. u888to565Multiplier dq 2000000420000004h
  32. PUBLIC uVal0x000007ff03ff07ff
  33. uVal0x000007ff03ff07ff dq 000007ff03ff07ffh ; Or mask to increase 565 color value
  34. PUBLIC uVal0x0000078003c00780
  35. uVal0x0000078003c00780 dq 0000078003c00780h ; Bits to test for dithering in 565
  36. ; 555 values
  37. PUBLIC u888to555RedBlueMask
  38. u888to555RedBlueMask dq 00f800f800f800f8h
  39. PUBLIC u888to555GreenMask
  40. u888to555GreenMask dq 0000f8000000f800h
  41. PUBLIC u888to555Multiplier
  42. u888to555Multiplier dq 2000000820000008h
  43. PUBLIC uVal0x000007ff07ff07ff
  44. uVal0x000007ff07ff07ff dq 000007ff07ff07ffh ; Or mask to increase 555 color value
  45. PUBLIC uVal0x0000078007800780
  46. uVal0x0000078007800780 dq 0000078007800780h ; Bits to test for dithering in 555
  47. Val0x008000800080 dq 0000008000800080h
  48. Val0x002400060001 dq 0000002400060001h
  49. Val0x000500050005 dq 0000000500050005h
  50. .code
  51. ; Names are read LSB to MSB, so B5G6R5 means five bits of blue starting
  52. ; at the LSB, then six bits of green, then five bits of red.
  53. ;-----------------------------------------------------------------------------
  54. ;
  55. ; Write_B8G8R8X8_NoDither
  56. ;
  57. ; Writes output in BGR-888 format.
  58. ;
  59. ;-----------------------------------------------------------------------------
  60. ;void Write_B8G8R8X8_NoDither(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP, PD3DI_RASTSPAN pS)
  61. ;{
  62. PUBLIC _MMX_BufWrite_B8G8R8X8_NoDither
  63. _MMX_BufWrite_B8G8R8X8_NoDither:
  64. d_BufWrite_B8G8R8X8_NoDither(NotMonolithic)
  65. ;; just returns for C, since we really cant loop with function calls
  66. ;ret
  67. jmp dword ptr XpCtx(pfnPixelEnd)
  68. ;}
  69. ;-----------------------------------------------------------------------------
  70. ;
  71. ; Write_B8G8R8A8_NoDither
  72. ;
  73. ; Writes output in BGRA-8888 format.
  74. ;
  75. ;-----------------------------------------------------------------------------
  76. ;void Write_B8G8R8A8_NoDither(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP, PD3DI_RASTSPAN pS)
  77. ;{
  78. PUBLIC _MMX_BufWrite_B8G8R8A8_NoDither
  79. _MMX_BufWrite_B8G8R8A8_NoDither:
  80. d_BufWrite_B8G8R8A8_NoDither(NotMonolithic)
  81. ; just returns for C, since we really cant loop with function calls
  82. ;ret
  83. jmp dword ptr XpCtx(pfnPixelEnd)
  84. ;}
  85. ;-----------------------------------------------------------------------------
  86. ;
  87. ; Write_B5G6R5_NoDither
  88. ;
  89. ; Writes output in BGR-565 format.
  90. ;
  91. ;-----------------------------------------------------------------------------
  92. ;void Write_B5G6R5_NoDither(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP, PD3DI_RASTSPAN pS)
  93. ;{
  94. PUBLIC _MMX_BufWrite_B5G6R5_NoDither
  95. _MMX_BufWrite_B5G6R5_NoDither:
  96. d_BufWrite_B5G6R5_NoDither(NotMonolithic)
  97. ; just returns for C, since we really cant loop with function calls
  98. jmp dword ptr XpCtx(pfnPixelEnd)
  99. ;}
  100. ;-----------------------------------------------------------------------------
  101. ;
  102. ; Write_B5G6R5_Dither
  103. ;
  104. ; Writes output in BGR-565 format, dithered.
  105. ;
  106. ;-----------------------------------------------------------------------------
  107. ;void Write_B5G6R5_Dither(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP, PD3DI_RASTSPAN pS)
  108. ;{
  109. PUBLIC _MMX_BufWrite_B5G6R5_Dither
  110. _MMX_BufWrite_B5G6R5_Dither:
  111. d_BufWrite_B5G6R5_Dither(NotMonolithic)
  112. ; just returns for C, since we really cant loop with function calls
  113. ;ret
  114. jmp dword ptr XpCtx(pfnPixelEnd)
  115. ;}
  116. ;-----------------------------------------------------------------------------
  117. ;
  118. ; Write_B5G5R5_NoDither
  119. ;
  120. ; Writes output in BGR-555 format.
  121. ;
  122. ;-----------------------------------------------------------------------------
  123. ;void Write_B5G5R5_NoDither(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP, PD3DI_RASTSPAN pS)
  124. ;{
  125. PUBLIC _MMX_BufWrite_B5G5R5_NoDither
  126. _MMX_BufWrite_B5G5R5_NoDither:
  127. d_BufWrite_B5G5R5_NoDither(NotMonolithic)
  128. ; just returns for C, since we really cant loop with function calls
  129. ;ret
  130. jmp dword ptr XpCtx(pfnPixelEnd)
  131. ;}
  132. ;-----------------------------------------------------------------------------
  133. ;
  134. ; Write_B5G5R5_Dither
  135. ;
  136. ; Writes output in BGR-555 format, dithered.
  137. ;
  138. ;-----------------------------------------------------------------------------
  139. ;void Write_B5G5R5_Dither(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP, PD3DI_RASTSPAN pS)
  140. ;{
  141. PUBLIC _MMX_BufWrite_B5G5R5_Dither
  142. _MMX_BufWrite_B5G5R5_Dither:
  143. d_BufWrite_B5G5R5_Dither(NotMonolithic)
  144. ; just returns for C, since we really cant loop with function calls
  145. ;ret
  146. jmp dword ptr XpCtx(pfnPixelEnd)
  147. ;}
  148. ;-----------------------------------------------------------------------------
  149. ;
  150. ; Write_B5G5R5A1_NoDither
  151. ;
  152. ; Writes output in BGRA-1555 format.
  153. ;
  154. ;-----------------------------------------------------------------------------
  155. ;void Write_B5G5R5A1_NoDither(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP, PD3DI_RASTSPAN pS)
  156. ;{
  157. PUBLIC _MMX_BufWrite_B5G5R5A1_NoDither
  158. _MMX_BufWrite_B5G5R5A1_NoDither:
  159. d_BufWrite_B5G5R5A1_NoDither(NotMonolithic)
  160. ; just returns for C, since we really cant loop with function calls
  161. ;ret
  162. jmp dword ptr XpCtx(pfnPixelEnd)
  163. ;}
  164. ;-----------------------------------------------------------------------------
  165. ;
  166. ; Write_B5G5R5A1_Dither
  167. ;
  168. ; Writes output in BGRA-1555 format, dithered.
  169. ;
  170. ;-----------------------------------------------------------------------------
  171. ;void Write_B5G5R5A1_Dither(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP, PD3DI_RASTSPAN pS)
  172. ;{
  173. PUBLIC _MMX_BufWrite_B5G5R5A1_Dither
  174. _MMX_BufWrite_B5G5R5A1_Dither:
  175. d_BufWrite_B5G5R5A1_Dither(NotMonolithic)
  176. ; just returns for C, since we really cant loop with function calls
  177. ;ret
  178. jmp dword ptr XpCtx(pfnPixelEnd)
  179. ;}
  180. ;-----------------------------------------------------------------------------
  181. ;
  182. ; Write_B8G8R8_NoDither
  183. ;
  184. ; Writes output in BGR-888 format.
  185. ;
  186. ;-----------------------------------------------------------------------------
  187. ;void Write_B8G8R8_NoDither(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP, PD3DI_RASTSPAN pS)
  188. ;{
  189. PUBLIC _MMX_BufWrite_B8G8R8_NoDither
  190. _MMX_BufWrite_B8G8R8_NoDither:
  191. d_BufWrite_B8G8R8_NoDither(NotMonolithic)
  192. jmp dword ptr XpCtx(pfnPixelEnd)
  193. ;}
  194. ;-----------------------------------------------------------------------------
  195. ;
  196. ; Write_Palette8_NoDither
  197. ;
  198. ; Writes output in Palette8 format.
  199. ;
  200. ;-----------------------------------------------------------------------------
  201. ;void Write_Palette8_NoDither(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP, PD3DI_RASTSPAN pS)
  202. ;{
  203. PUBLIC _MMX_BufWrite_Palette8_NoDither
  204. _MMX_BufWrite_Palette8_NoDither:
  205. d_BufWrite_Palette8_Dither(NotMonolithic)
  206. jmp dword ptr XpCtx(pfnPixelEnd)
  207. ;}
  208. END