qasm.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. #ifndef __ASM_I386__
  2. #define __ASM_I386__
  3. #ifdef ELF
  4. #define C(label) label
  5. #else
  6. #define C(label) _##label
  7. #endif
  8. //#define GLQUAKE 1
  9. #if defined(_WIN32) && !defined(WINDED)
  10. #if defined(_M_IX86)
  11. #define __i386__ 1
  12. #endif
  13. #endif
  14. #ifdef __i386__
  15. #define id386 1
  16. #else
  17. #define id386 0
  18. #endif
  19. // !!! must be kept the same as in d_iface.h !!!
  20. #define TRANSPARENT_COLOR 255
  21. #ifndef GLQUAKE
  22. .extern C(d_zistepu)
  23. .extern C(d_pzbuffer)
  24. .extern C(d_zistepv)
  25. .extern C(d_zrowbytes)
  26. .extern C(d_ziorigin)
  27. .extern C(r_turb_s)
  28. .extern C(r_turb_t)
  29. .extern C(r_turb_pdest)
  30. .extern C(r_turb_spancount)
  31. .extern C(r_turb_turb)
  32. .extern C(r_turb_pbase)
  33. .extern C(r_turb_sstep)
  34. .extern C(r_turb_tstep)
  35. .extern C(r_bmodelactive)
  36. .extern C(d_sdivzstepu)
  37. .extern C(d_tdivzstepu)
  38. .extern C(d_sdivzstepv)
  39. .extern C(d_tdivzstepv)
  40. .extern C(d_sdivzorigin)
  41. .extern C(d_tdivzorigin)
  42. .extern C(sadjust)
  43. .extern C(tadjust)
  44. .extern C(bbextents)
  45. .extern C(bbextentt)
  46. .extern C(cacheblock)
  47. .extern C(d_viewbuffer)
  48. .extern C(cachewidth)
  49. .extern C(d_pzbuffer)
  50. .extern C(d_zrowbytes)
  51. .extern C(d_zwidth)
  52. .extern C(d_scantable)
  53. .extern C(r_lightptr)
  54. .extern C(r_numvblocks)
  55. .extern C(prowdestbase)
  56. .extern C(pbasesource)
  57. .extern C(r_lightwidth)
  58. .extern C(lightright)
  59. .extern C(lightrightstep)
  60. .extern C(lightdeltastep)
  61. .extern C(lightdelta)
  62. .extern C(lightright)
  63. .extern C(lightdelta)
  64. .extern C(sourcetstep)
  65. .extern C(surfrowbytes)
  66. .extern C(lightrightstep)
  67. .extern C(lightdeltastep)
  68. .extern C(r_sourcemax)
  69. .extern C(r_stepback)
  70. .extern C(colormap)
  71. .extern C(blocksize)
  72. .extern C(sourcesstep)
  73. .extern C(lightleft)
  74. .extern C(blockdivshift)
  75. .extern C(blockdivmask)
  76. .extern C(lightleftstep)
  77. .extern C(r_origin)
  78. .extern C(r_ppn)
  79. .extern C(r_pup)
  80. .extern C(r_pright)
  81. .extern C(ycenter)
  82. .extern C(xcenter)
  83. .extern C(d_vrectbottom_particle)
  84. .extern C(d_vrectright_particle)
  85. .extern C(d_vrecty)
  86. .extern C(d_vrectx)
  87. .extern C(d_pix_shift)
  88. .extern C(d_pix_min)
  89. .extern C(d_pix_max)
  90. .extern C(d_y_aspect_shift)
  91. .extern C(screenwidth)
  92. .extern C(r_leftclipped)
  93. .extern C(r_leftenter)
  94. .extern C(r_rightclipped)
  95. .extern C(r_rightenter)
  96. .extern C(modelorg)
  97. .extern C(xscale)
  98. .extern C(r_refdef)
  99. .extern C(yscale)
  100. .extern C(r_leftexit)
  101. .extern C(r_rightexit)
  102. .extern C(r_lastvertvalid)
  103. .extern C(cacheoffset)
  104. .extern C(newedges)
  105. .extern C(removeedges)
  106. .extern C(r_pedge)
  107. .extern C(r_framecount)
  108. .extern C(r_u1)
  109. .extern C(r_emitted)
  110. .extern C(edge_p)
  111. .extern C(surface_p)
  112. .extern C(surfaces)
  113. .extern C(r_lzi1)
  114. .extern C(r_v1)
  115. .extern C(r_ceilv1)
  116. .extern C(r_nearzi)
  117. .extern C(r_nearzionly)
  118. .extern C(edge_aftertail)
  119. .extern C(edge_tail)
  120. .extern C(current_iv)
  121. .extern C(edge_head_u_shift20)
  122. .extern C(span_p)
  123. .extern C(edge_head)
  124. .extern C(fv)
  125. .extern C(edge_tail_u_shift20)
  126. .extern C(r_apverts)
  127. .extern C(r_anumverts)
  128. .extern C(aliastransform)
  129. .extern C(r_avertexnormals)
  130. .extern C(r_plightvec)
  131. .extern C(r_ambientlight)
  132. .extern C(r_shadelight)
  133. .extern C(aliasxcenter)
  134. .extern C(aliasycenter)
  135. .extern C(a_sstepxfrac)
  136. .extern C(r_affinetridesc)
  137. .extern C(acolormap)
  138. .extern C(d_pcolormap)
  139. .extern C(r_affinetridesc)
  140. .extern C(d_sfrac)
  141. .extern C(d_ptex)
  142. .extern C(d_pedgespanpackage)
  143. .extern C(d_tfrac)
  144. .extern C(d_light)
  145. .extern C(d_zi)
  146. .extern C(d_pdest)
  147. .extern C(d_pz)
  148. .extern C(d_aspancount)
  149. .extern C(erroradjustup)
  150. .extern C(errorterm)
  151. .extern C(d_xdenom)
  152. .extern C(r_p0)
  153. .extern C(r_p1)
  154. .extern C(r_p2)
  155. .extern C(a_tstepxfrac)
  156. .extern C(r_sstepx)
  157. .extern C(r_tstepx)
  158. .extern C(a_ststepxwhole)
  159. .extern C(zspantable)
  160. .extern C(skintable)
  161. .extern C(r_zistepx)
  162. .extern C(erroradjustdown)
  163. .extern C(d_countextrastep)
  164. .extern C(ubasestep)
  165. .extern C(a_ststepxwhole)
  166. .extern C(a_tstepxfrac)
  167. .extern C(r_lstepx)
  168. .extern C(a_spans)
  169. .extern C(erroradjustdown)
  170. .extern C(d_pdestextrastep)
  171. .extern C(d_pzextrastep)
  172. .extern C(d_sfracextrastep)
  173. .extern C(d_ptexextrastep)
  174. .extern C(d_countextrastep)
  175. .extern C(d_tfracextrastep)
  176. .extern C(d_lightextrastep)
  177. .extern C(d_ziextrastep)
  178. .extern C(d_pdestbasestep)
  179. .extern C(d_pzbasestep)
  180. .extern C(d_sfracbasestep)
  181. .extern C(d_ptexbasestep)
  182. .extern C(ubasestep)
  183. .extern C(d_tfracbasestep)
  184. .extern C(d_lightbasestep)
  185. .extern C(d_zibasestep)
  186. .extern C(zspantable)
  187. .extern C(r_lstepy)
  188. .extern C(r_sstepy)
  189. .extern C(r_tstepy)
  190. .extern C(r_zistepy)
  191. .extern C(D_PolysetSetEdgeTable)
  192. .extern C(D_RasterizeAliasPolySmooth)
  193. .extern float_point5
  194. .extern Float2ToThe31nd
  195. .extern izistep
  196. .extern izi
  197. .extern FloatMinus2ToThe31nd
  198. .extern float_1
  199. .extern float_particle_z_clip
  200. .extern float_minus_1
  201. .extern float_0
  202. .extern fp_16
  203. .extern fp_64k
  204. .extern fp_1m
  205. .extern fp_1m_minus_1
  206. .extern fp_8
  207. .extern entryvec_table
  208. .extern advancetable
  209. .extern sstep
  210. .extern tstep
  211. .extern pspantemp
  212. .extern counttemp
  213. .extern jumptemp
  214. .extern reciprocal_table
  215. .extern DP_Count
  216. .extern DP_u
  217. .extern DP_v
  218. .extern DP_32768
  219. .extern DP_Color
  220. .extern DP_Pix
  221. .extern DP_EntryTable
  222. .extern pbase
  223. .extern s
  224. .extern t
  225. .extern sfracf
  226. .extern tfracf
  227. .extern snext
  228. .extern tnext
  229. .extern spancountminus1
  230. .extern zi16stepu
  231. .extern sdivz16stepu
  232. .extern tdivz16stepu
  233. .extern zi8stepu
  234. .extern sdivz8stepu
  235. .extern tdivz8stepu
  236. .extern reciprocal_table_16
  237. .extern entryvec_table_16
  238. .extern ceil_cw
  239. .extern single_cw
  240. .extern fp_64kx64k
  241. .extern pz
  242. .extern spr8entryvec_table
  243. #endif
  244. .extern C(snd_scaletable)
  245. .extern C(paintbuffer)
  246. .extern C(snd_linear_count)
  247. .extern C(snd_p)
  248. .extern C(snd_vol)
  249. .extern C(snd_out)
  250. .extern C(vright)
  251. .extern C(vup)
  252. .extern C(vpn)
  253. .extern C(BOPS_Error)
  254. //
  255. // !!! note that this file must match the corresponding C structures at all
  256. // times !!!
  257. //
  258. // plane_t structure
  259. // !!! if this is changed, it must be changed in model.h too !!!
  260. // !!! if the size of this is changed, the array lookup in SV_HullPointContents
  261. // must be changed too !!!
  262. #define pl_normal 0
  263. #define pl_dist 12
  264. #define pl_type 16
  265. #define pl_signbits 17
  266. #define pl_pad 18
  267. #define pl_size 20
  268. // hull_t structure
  269. // !!! if this is changed, it must be changed in model.h too !!!
  270. #define hu_clipnodes 0
  271. #define hu_planes 4
  272. #define hu_firstclipnode 8
  273. #define hu_lastclipnode 12
  274. #define hu_clip_mins 16
  275. #define hu_clip_maxs 28
  276. #define hu_size 40
  277. // dnode_t structure
  278. // !!! if this is changed, it must be changed in bspfile.h too !!!
  279. #define nd_planenum 0
  280. #define nd_children 4
  281. #define nd_mins 8
  282. #define nd_maxs 20
  283. #define nd_firstface 32
  284. #define nd_numfaces 36
  285. #define nd_size 40
  286. // sfxcache_t structure
  287. // !!! if this is changed, it much be changed in sound.h too !!!
  288. #define sfxc_length 0
  289. #define sfxc_loopstart 4
  290. #define sfxc_speed 8
  291. #define sfxc_width 12
  292. #define sfxc_stereo 16
  293. #define sfxc_data 20
  294. // channel_t structure
  295. // !!! if this is changed, it much be changed in sound.h too !!!
  296. #define ch_sfx 0
  297. #define ch_leftvol 4
  298. #define ch_rightvol 8
  299. #define ch_end 12
  300. #define ch_pos 16
  301. #define ch_looping 20
  302. #define ch_entnum 24
  303. #define ch_entchannel 28
  304. #define ch_origin 32
  305. #define ch_dist_mult 44
  306. #define ch_master_vol 48
  307. #define ch_size 52
  308. // portable_samplepair_t structure
  309. // !!! if this is changed, it much be changed in sound.h too !!!
  310. #define psp_left 0
  311. #define psp_right 4
  312. #define psp_size 8
  313. //
  314. // !!! note that this file must match the corresponding C structures at all
  315. // times !!!
  316. //
  317. // !!! if this is changed, it must be changed in r_local.h too !!!
  318. #define NEAR_CLIP 0.01
  319. // !!! if this is changed, it must be changed in r_local.h too !!!
  320. #define CYCLE 128
  321. // espan_t structure
  322. // !!! if this is changed, it must be changed in r_shared.h too !!!
  323. #define espan_t_u 0
  324. #define espan_t_v 4
  325. #define espan_t_count 8
  326. #define espan_t_pnext 12
  327. #define espan_t_size 16
  328. // sspan_t structure
  329. // !!! if this is changed, it must be changed in d_local.h too !!!
  330. #define sspan_t_u 0
  331. #define sspan_t_v 4
  332. #define sspan_t_count 8
  333. #define sspan_t_size 12
  334. // spanpackage_t structure
  335. // !!! if this is changed, it must be changed in d_polyset.c too !!!
  336. #define spanpackage_t_pdest 0
  337. #define spanpackage_t_pz 4
  338. #define spanpackage_t_count 8
  339. #define spanpackage_t_ptex 12
  340. #define spanpackage_t_sfrac 16
  341. #define spanpackage_t_tfrac 20
  342. #define spanpackage_t_light 24
  343. #define spanpackage_t_zi 28
  344. #define spanpackage_t_size 32
  345. // edge_t structure
  346. // !!! if this is changed, it must be changed in r_shared.h too !!!
  347. #define et_u 0
  348. #define et_u_step 4
  349. #define et_prev 8
  350. #define et_next 12
  351. #define et_surfs 16
  352. #define et_nextremove 20
  353. #define et_nearzi 24
  354. #define et_owner 28
  355. #define et_size 32
  356. // surf_t structure
  357. // !!! if this is changed, it must be changed in r_shared.h too !!!
  358. #define SURF_T_SHIFT 6
  359. #define st_next 0
  360. #define st_prev 4
  361. #define st_spans 8
  362. #define st_key 12
  363. #define st_last_u 16
  364. #define st_spanstate 20
  365. #define st_flags 24
  366. #define st_data 28
  367. #define st_entity 32
  368. #define st_nearzi 36
  369. #define st_insubmodel 40
  370. #define st_d_ziorigin 44
  371. #define st_d_zistepu 48
  372. #define st_d_zistepv 52
  373. #define st_pad 56
  374. #define st_size 64
  375. // clipplane_t structure
  376. // !!! if this is changed, it must be changed in r_local.h too !!!
  377. #define cp_normal 0
  378. #define cp_dist 12
  379. #define cp_next 16
  380. #define cp_leftedge 20
  381. #define cp_rightedge 21
  382. #define cp_reserved 22
  383. #define cp_size 24
  384. // medge_t structure
  385. // !!! if this is changed, it must be changed in model.h too !!!
  386. #define me_v 0
  387. #define me_cachededgeoffset 4
  388. #define me_size 8
  389. // mvertex_t structure
  390. // !!! if this is changed, it must be changed in model.h too !!!
  391. #define mv_position 0
  392. #define mv_size 12
  393. // refdef_t structure
  394. // !!! if this is changed, it must be changed in render.h too !!!
  395. #define rd_vrect 0
  396. #define rd_aliasvrect 20
  397. #define rd_vrectright 40
  398. #define rd_vrectbottom 44
  399. #define rd_aliasvrectright 48
  400. #define rd_aliasvrectbottom 52
  401. #define rd_vrectrightedge 56
  402. #define rd_fvrectx 60
  403. #define rd_fvrecty 64
  404. #define rd_fvrectx_adj 68
  405. #define rd_fvrecty_adj 72
  406. #define rd_vrect_x_adj_shift20 76
  407. #define rd_vrectright_adj_shift20 80
  408. #define rd_fvrectright_adj 84
  409. #define rd_fvrectbottom_adj 88
  410. #define rd_fvrectright 92
  411. #define rd_fvrectbottom 96
  412. #define rd_horizontalFieldOfView 100
  413. #define rd_xOrigin 104
  414. #define rd_yOrigin 108
  415. #define rd_vieworg 112
  416. #define rd_viewangles 124
  417. #define rd_ambientlight 136
  418. #define rd_size 140
  419. // mtriangle_t structure
  420. // !!! if this is changed, it must be changed in model.h too !!!
  421. #define mtri_facesfront 0
  422. #define mtri_vertindex 4
  423. #define mtri_size 16 // !!! if this changes, array indexing in !!!
  424. // !!! d_polysa.s must be changed to match !!!
  425. #define mtri_shift 4
  426. #endif