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.

127 lines
3.3 KiB

  1. ;-----------------------------------------------------------------------------
  2. ;
  3. ; This file contains texture read functions.
  4. ; WARNING WARNING WARNING
  5. ; This asm file generated from mas file.
  6. ; EDIT THE MAS FILE.
  7. ; I warned you.
  8. ; WARNING WARNING WARNING
  9. ;
  10. ; Register useage for now.
  11. ;
  12. ; TODO Optimization: make different cases for colorkey and no colorkey since
  13. ; I cant shift to the quad word since I need to compare with colorkey
  14. ;
  15. ; Is all of these register useages still true?
  16. ;
  17. ; In all routines, address of iU and iV will come in as eax
  18. ; mm5 is reserved for border mask.
  19. ; mm6 and mm7 are reserved for bilinear calculation taking place in
  20. ; texture address routines.
  21. ;
  22. ; iShiftU will generate a multiplier to generate texture address
  23. ; it will be in mm3
  24. ;
  25. ; edi = pBits for now.
  26. ; pTex will still be in esi or whatever register I gave it for Texaddr
  27. ; routines.
  28. ;
  29. ; Output will go to mm1 for use by texaddr routines.
  30. ; TBD make sure that alpha value is always set.
  31. ; TBD make sure that color is returned in bytes from low byte to high byte
  32. ; as b, 0, g, 0, r, 0, a, 0. This will make it convient for the pmul.
  33. ;
  34. ;-----------------------------------------------------------------------------
  35. INCLUDE iammx.inc
  36. INCLUDE offs_acp.inc
  37. include(`m4hdr.mh')dnl
  38. include(`cvars.mh')dnl
  39. include(`texread.mh')dnl
  40. .586
  41. .model flat
  42. .data
  43. ; Red and Blue are masked after the shifts.
  44. PUBLIC SetAlphato0xffff
  45. SetAlphato0xffff dq 0ffff000000000000h
  46. CheckLowTwo8BitSignbits dq 08080h
  47. Val0xffff00 dq 0ffff00h
  48. Val0x00ff00ff dq 000ff00ffh
  49. Val0xff00ff00 dq 0ff00ff00h
  50. PUBLIC MaskRed565to888
  51. MaskRed565to888 dq 0000000000f80000h
  52. PUBLIC MaskRed555to888
  53. MaskRed555to888 dq 0000000000f80000h
  54. PUBLIC MaskGreen565to888
  55. MaskGreen565to888 dq 00000000000007e0h
  56. PUBLIC MaskGreen555to888
  57. MaskGreen555to888 dq 00000000000003e0h
  58. PUBLIC MaskBlue565to888
  59. MaskBlue565to888 dd 000000f8h
  60. PUBLIC MaskBlue555to888
  61. MaskBlue555to888 dd 000000f8h
  62. MaskGreen444to888 dq 00000000000000f0h
  63. MaskRedBlue444to888 dq 0000000000000f0fh
  64. MaskAlphaGreen4444to8888 dq 000000000000f0f0h
  65. MaskRedBlue4444to8888 dq 0000000000000f0fh
  66. PUBLIC MaskAlpha1555to8888
  67. MaskAlpha1555to8888 dq 0000000000008000h
  68. PUBLIC MaskRed1555to8888
  69. MaskRed1555to8888 dq 0000000000f80000h
  70. PUBLIC MaskBlue1555to8888
  71. MaskBlue1555to8888 dq 000000f8h
  72. PUBLIC MaskGreen1555to8888
  73. MaskGreen1555to8888 dd 0000f800h
  74. PUBLIC MaskL8A8ALPHA
  75. MaskL8A8ALPHA dd 000000ffh
  76. EXTERN SetAlphato0xff:MMWORD
  77. .code
  78. RedShift565to888 equ 8
  79. GreenShift565to888 equ 5
  80. BlueShift565to888 equ 3
  81. RedShift555to888 equ 9
  82. GreenShift555to888 equ 6
  83. BlueShift555to888 equ 3
  84. AlphaShift1555to8888 equ 16
  85. RedShift1555to8888 equ 9
  86. GreenShift1555to8888 equ 6
  87. BlueShift1555to8888 equ 3
  88. EXTERN Zero:MMWORD
  89. d_DoTex(`d_Palette8') dnl
  90. d_DoTex(`d_Palette4') dnl
  91. d_DoTex(`d_Palette8A') dnl
  92. d_DoTex(`d_Palette4A') dnl
  93. d_DoTex(`d_B8G8R8') dnl
  94. d_DoTex(`d_B8G8R8A8') dnl
  95. d_DoTex(`d_B5G6R5') dnl
  96. d_DoTex(`d_B5G5R5') dnl
  97. d_DoTex(`d_B5G5R5A1') dnl
  98. d_DoTex(`d_B4G4R4') dnl
  99. d_DoTex(`d_B4G4R4A4') dnl
  100. d_DoTex(`d_L8') dnl
  101. d_DoTex(`d_L8A8') dnl
  102. END