qasm.h 11 KB

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