r_varsa.s 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. //
  2. // r_varsa.s
  3. //
  4. #include "qasm.h"
  5. #include "d_ifacea.h"
  6. #if id386
  7. .data
  8. //-------------------------------------------------------
  9. // ASM-only variables
  10. //-------------------------------------------------------
  11. .globl float_1, float_particle_z_clip, float_point5
  12. .globl float_minus_1, float_0
  13. float_0: .single 0.0
  14. float_1: .single 1.0
  15. float_minus_1: .single -1.0
  16. float_particle_z_clip: .single PARTICLE_Z_CLIP
  17. float_point5: .single 0.5
  18. .globl fp_16, fp_64k, fp_1m, fp_64kx64k
  19. .globl fp_1m_minus_1
  20. .globl fp_8
  21. fp_1m: .single 1048576.0
  22. fp_1m_minus_1: .single 1048575.0
  23. fp_64k: .single 65536.0
  24. fp_8: .single 8.0
  25. fp_16: .single 16.0
  26. fp_64kx64k: .long 0x4f000000 // (float)0x8000*0x10000
  27. .globl FloatZero, Float2ToThe31nd, FloatMinus2ToThe31nd
  28. FloatZero: .long 0
  29. Float2ToThe31nd: .long 0x4f000000
  30. FloatMinus2ToThe31nd: .long 0xcf000000
  31. .globl C(r_bmodelactive)
  32. C(r_bmodelactive): .long 0
  33. //-------------------------------------------------------
  34. // global refresh variables
  35. //-------------------------------------------------------
  36. // FIXME: put all refresh variables into one contiguous block. Make into one
  37. // big structure, like cl or sv?
  38. .align 4
  39. .globl C(d_sdivzstepu)
  40. .globl C(d_tdivzstepu)
  41. .globl C(d_zistepu)
  42. .globl C(d_sdivzstepv)
  43. .globl C(d_tdivzstepv)
  44. .globl C(d_zistepv)
  45. .globl C(d_sdivzorigin)
  46. .globl C(d_tdivzorigin)
  47. .globl C(d_ziorigin)
  48. C(d_sdivzstepu): .single 0
  49. C(d_tdivzstepu): .single 0
  50. C(d_zistepu): .single 0
  51. C(d_sdivzstepv): .single 0
  52. C(d_tdivzstepv): .single 0
  53. C(d_zistepv): .single 0
  54. C(d_sdivzorigin): .single 0
  55. C(d_tdivzorigin): .single 0
  56. C(d_ziorigin): .single 0
  57. .globl C(sadjust)
  58. .globl C(tadjust)
  59. .globl C(bbextents)
  60. .globl C(bbextentt)
  61. C(sadjust): .long 0
  62. C(tadjust): .long 0
  63. C(bbextents): .long 0
  64. C(bbextentt): .long 0
  65. .globl C(cacheblock)
  66. .globl C(d_viewbuffer)
  67. .globl C(cachewidth)
  68. .globl C(d_pzbuffer)
  69. .globl C(d_zrowbytes)
  70. .globl C(d_zwidth)
  71. C(cacheblock): .long 0
  72. C(cachewidth): .long 0
  73. C(d_viewbuffer): .long 0
  74. C(d_pzbuffer): .long 0
  75. C(d_zrowbytes): .long 0
  76. C(d_zwidth): .long 0
  77. //-------------------------------------------------------
  78. // ASM-only variables
  79. //-------------------------------------------------------
  80. .globl izi
  81. izi: .long 0
  82. .globl pbase, s, t, sfracf, tfracf, snext, tnext
  83. .globl spancountminus1, zi16stepu, sdivz16stepu, tdivz16stepu
  84. .globl zi8stepu, sdivz8stepu, tdivz8stepu, pz
  85. s: .long 0
  86. t: .long 0
  87. snext: .long 0
  88. tnext: .long 0
  89. sfracf: .long 0
  90. tfracf: .long 0
  91. pbase: .long 0
  92. zi8stepu: .long 0
  93. sdivz8stepu: .long 0
  94. tdivz8stepu: .long 0
  95. zi16stepu: .long 0
  96. sdivz16stepu: .long 0
  97. tdivz16stepu: .long 0
  98. spancountminus1: .long 0
  99. pz: .long 0
  100. .globl izistep
  101. izistep: .long 0
  102. //-------------------------------------------------------
  103. // local variables for d_draw16.s
  104. //-------------------------------------------------------
  105. .globl reciprocal_table_16, entryvec_table_16
  106. // 1/2, 1/3, 1/4, 1/5, 1/6, 1/7, 1/8, 1/9, 1/10, 1/11, 1/12, 1/13,
  107. // 1/14, and 1/15 in 0.32 form
  108. reciprocal_table_16: .long 0x40000000, 0x2aaaaaaa, 0x20000000
  109. .long 0x19999999, 0x15555555, 0x12492492
  110. .long 0x10000000, 0xe38e38e, 0xccccccc, 0xba2e8ba
  111. .long 0xaaaaaaa, 0x9d89d89, 0x9249249, 0x8888888
  112. #ifndef NeXT
  113. .extern Entry2_16
  114. .extern Entry3_16
  115. .extern Entry4_16
  116. .extern Entry5_16
  117. .extern Entry6_16
  118. .extern Entry7_16
  119. .extern Entry8_16
  120. .extern Entry9_16
  121. .extern Entry10_16
  122. .extern Entry11_16
  123. .extern Entry12_16
  124. .extern Entry13_16
  125. .extern Entry14_16
  126. .extern Entry15_16
  127. .extern Entry16_16
  128. #endif
  129. entryvec_table_16: .long 0, Entry2_16, Entry3_16, Entry4_16
  130. .long Entry5_16, Entry6_16, Entry7_16, Entry8_16
  131. .long Entry9_16, Entry10_16, Entry11_16, Entry12_16
  132. .long Entry13_16, Entry14_16, Entry15_16, Entry16_16
  133. //-------------------------------------------------------
  134. // local variables for d_parta.s
  135. //-------------------------------------------------------
  136. .globl DP_Count, DP_u, DP_v, DP_32768, DP_Color, DP_Pix, DP_EntryTable
  137. DP_Count: .long 0
  138. DP_u: .long 0
  139. DP_v: .long 0
  140. DP_32768: .single 32768.0
  141. DP_Color: .long 0
  142. DP_Pix: .long 0
  143. #if 0
  144. .extern DP_1x1
  145. .extern DP_2x2
  146. .extern DP_3x3
  147. .extern DP_4x4
  148. DP_EntryTable: .long DP_1x1, DP_2x2, DP_3x3, DP_4x4
  149. #endif
  150. //
  151. // advancetable is 8 bytes, but points to the middle of that range so negative
  152. // offsets will work
  153. //
  154. .globl advancetable, sstep, tstep, pspantemp, counttemp, jumptemp
  155. advancetable: .long 0, 0
  156. sstep: .long 0
  157. tstep: .long 0
  158. pspantemp: .long 0
  159. counttemp: .long 0
  160. jumptemp: .long 0
  161. // 1/2, 1/3, 1/4, 1/5, 1/6, and 1/7 in 0.32 form
  162. .globl reciprocal_table, entryvec_table
  163. reciprocal_table: .long 0x40000000, 0x2aaaaaaa, 0x20000000
  164. .long 0x19999999, 0x15555555, 0x12492492
  165. #if 0
  166. .extern Entry2_8
  167. .extern Entry3_8
  168. .extern Entry4_8
  169. .extern Entry5_8
  170. .extern Entry6_8
  171. .extern Entry7_8
  172. .extern Entry8_8
  173. entryvec_table: .long 0, Entry2_8, Entry3_8, Entry4_8
  174. .long Entry5_8, Entry6_8, Entry7_8, Entry8_8
  175. #endif
  176. #ifndef NeXT
  177. .extern Spr8Entry2_8
  178. .extern Spr8Entry3_8
  179. .extern Spr8Entry4_8
  180. .extern Spr8Entry5_8
  181. .extern Spr8Entry6_8
  182. .extern Spr8Entry7_8
  183. .extern Spr8Entry8_8
  184. #endif
  185. .globl spr8entryvec_table
  186. spr8entryvec_table: .long 0, Spr8Entry2_8, Spr8Entry3_8, Spr8Entry4_8
  187. .long Spr8Entry5_8, Spr8Entry6_8, Spr8Entry7_8, Spr8Entry8_8
  188. #endif // id386