d_varsa.s 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. /*
  2. Copyright (C) 1996-1997 Id Software, Inc.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. //
  16. // d_varsa.s
  17. //
  18. #include "asm_i386.h"
  19. #include "quakeasm.h"
  20. #include "asm_draw.h"
  21. #include "d_ifacea.h"
  22. #if id386
  23. .data
  24. //-------------------------------------------------------
  25. // global refresh variables
  26. //-------------------------------------------------------
  27. // FIXME: put all refresh variables into one contiguous block. Make into one
  28. // big structure, like cl or sv?
  29. .align 4
  30. .globl C(d_sdivzstepu)
  31. .globl C(d_tdivzstepu)
  32. .globl C(d_zistepu)
  33. .globl C(d_sdivzstepv)
  34. .globl C(d_tdivzstepv)
  35. .globl C(d_zistepv)
  36. .globl C(d_sdivzorigin)
  37. .globl C(d_tdivzorigin)
  38. .globl C(d_ziorigin)
  39. C(d_sdivzstepu): .single 0
  40. C(d_tdivzstepu): .single 0
  41. C(d_zistepu): .single 0
  42. C(d_sdivzstepv): .single 0
  43. C(d_tdivzstepv): .single 0
  44. C(d_zistepv): .single 0
  45. C(d_sdivzorigin): .single 0
  46. C(d_tdivzorigin): .single 0
  47. C(d_ziorigin): .single 0
  48. .globl C(sadjust)
  49. .globl C(tadjust)
  50. .globl C(bbextents)
  51. .globl C(bbextentt)
  52. C(sadjust): .long 0
  53. C(tadjust): .long 0
  54. C(bbextents): .long 0
  55. C(bbextentt): .long 0
  56. .globl C(cacheblock)
  57. .globl C(d_viewbuffer)
  58. .globl C(cachewidth)
  59. .globl C(d_pzbuffer)
  60. .globl C(d_zrowbytes)
  61. .globl C(d_zwidth)
  62. C(cacheblock): .long 0
  63. C(cachewidth): .long 0
  64. C(d_viewbuffer): .long 0
  65. C(d_pzbuffer): .long 0
  66. C(d_zrowbytes): .long 0
  67. C(d_zwidth): .long 0
  68. //-------------------------------------------------------
  69. // ASM-only variables
  70. //-------------------------------------------------------
  71. .globl izi
  72. izi: .long 0
  73. .globl pbase, s, t, sfracf, tfracf, snext, tnext
  74. .globl spancountminus1, zi16stepu, sdivz16stepu, tdivz16stepu
  75. .globl zi8stepu, sdivz8stepu, tdivz8stepu, pz
  76. s: .long 0
  77. t: .long 0
  78. snext: .long 0
  79. tnext: .long 0
  80. sfracf: .long 0
  81. tfracf: .long 0
  82. pbase: .long 0
  83. zi8stepu: .long 0
  84. sdivz8stepu: .long 0
  85. tdivz8stepu: .long 0
  86. zi16stepu: .long 0
  87. sdivz16stepu: .long 0
  88. tdivz16stepu: .long 0
  89. spancountminus1: .long 0
  90. pz: .long 0
  91. .globl izistep
  92. izistep: .long 0
  93. //-------------------------------------------------------
  94. // local variables for d_draw16.s
  95. //-------------------------------------------------------
  96. .globl reciprocal_table_16, entryvec_table_16
  97. // 1/2, 1/3, 1/4, 1/5, 1/6, 1/7, 1/8, 1/9, 1/10, 1/11, 1/12, 1/13,
  98. // 1/14, and 1/15 in 0.32 form
  99. reciprocal_table_16: .long 0x40000000, 0x2aaaaaaa, 0x20000000
  100. .long 0x19999999, 0x15555555, 0x12492492
  101. .long 0x10000000, 0xe38e38e, 0xccccccc, 0xba2e8ba
  102. .long 0xaaaaaaa, 0x9d89d89, 0x9249249, 0x8888888
  103. #ifndef NeXT
  104. .extern Entry2_16
  105. .extern Entry3_16
  106. .extern Entry4_16
  107. .extern Entry5_16
  108. .extern Entry6_16
  109. .extern Entry7_16
  110. .extern Entry8_16
  111. .extern Entry9_16
  112. .extern Entry10_16
  113. .extern Entry11_16
  114. .extern Entry12_16
  115. .extern Entry13_16
  116. .extern Entry14_16
  117. .extern Entry15_16
  118. .extern Entry16_16
  119. #endif
  120. entryvec_table_16: .long 0, Entry2_16, Entry3_16, Entry4_16
  121. .long Entry5_16, Entry6_16, Entry7_16, Entry8_16
  122. .long Entry9_16, Entry10_16, Entry11_16, Entry12_16
  123. .long Entry13_16, Entry14_16, Entry15_16, Entry16_16
  124. //-------------------------------------------------------
  125. // local variables for d_parta.s
  126. //-------------------------------------------------------
  127. .globl DP_Count, DP_u, DP_v, DP_32768, DP_Color, DP_Pix, DP_EntryTable
  128. DP_Count: .long 0
  129. DP_u: .long 0
  130. DP_v: .long 0
  131. DP_32768: .single 32768.0
  132. DP_Color: .long 0
  133. DP_Pix: .long 0
  134. #ifndef NeXT
  135. .extern DP_1x1
  136. .extern DP_2x2
  137. .extern DP_3x3
  138. .extern DP_4x4
  139. #endif
  140. DP_EntryTable: .long DP_1x1, DP_2x2, DP_3x3, DP_4x4
  141. //
  142. // advancetable is 8 bytes, but points to the middle of that range so negative
  143. // offsets will work
  144. //
  145. .globl advancetable, sstep, tstep, pspantemp, counttemp, jumptemp
  146. advancetable: .long 0, 0
  147. sstep: .long 0
  148. tstep: .long 0
  149. pspantemp: .long 0
  150. counttemp: .long 0
  151. jumptemp: .long 0
  152. // 1/2, 1/3, 1/4, 1/5, 1/6, and 1/7 in 0.32 form
  153. .globl reciprocal_table, entryvec_table
  154. reciprocal_table: .long 0x40000000, 0x2aaaaaaa, 0x20000000
  155. .long 0x19999999, 0x15555555, 0x12492492
  156. #ifndef NeXT
  157. .extern Entry2_8
  158. .extern Entry3_8
  159. .extern Entry4_8
  160. .extern Entry5_8
  161. .extern Entry6_8
  162. .extern Entry7_8
  163. .extern Entry8_8
  164. #endif
  165. entryvec_table: .long 0, Entry2_8, Entry3_8, Entry4_8
  166. .long Entry5_8, Entry6_8, Entry7_8, Entry8_8
  167. #ifndef NeXT
  168. .extern Spr8Entry2_8
  169. .extern Spr8Entry3_8
  170. .extern Spr8Entry4_8
  171. .extern Spr8Entry5_8
  172. .extern Spr8Entry6_8
  173. .extern Spr8Entry7_8
  174. .extern Spr8Entry8_8
  175. #endif
  176. .globl spr8entryvec_table
  177. spr8entryvec_table: .long 0, Spr8Entry2_8, Spr8Entry3_8, Spr8Entry4_8
  178. .long Spr8Entry5_8, Spr8Entry6_8, Spr8Entry7_8, Spr8Entry8_8
  179. #endif // id386