home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / msdos / asm / 3dvect25 / equ.inc < prev    next >
Encoding:
Text File  |  1993-09-04  |  7.7 KB  |  298 lines

  1. ; conditional assembley variables and general constants
  2.  
  3. ; constants for optimal conditional assembley
  4. ; don't pay for features you'll never use! (timewise)
  5.  
  6. usez       equ yes           ; z camera rotations ommited if no, saves 12 imuls
  7.                              ; this speeds up computation in "compound" matrix
  8. usesteel   equ yes           ; set no if no sides will use steel texture.
  9.                              ; makes poly_fill routine faster
  10. useborders equ yes           ; lxupdate and xupdate will be skipped if no.
  11.                              ; set to no if you have no intention of ever
  12.                              ; using the clear_fill routine. this really
  13.                              ; is used if you will have a landscape in the
  14.                              ; background and you want the fake_line routine
  15.                              ; to be faster
  16.  
  17. yes     equ 0
  18. no      equ -1
  19.  
  20. bulletcolour equ 4           ; what colour is single point object
  21.  
  22. ; variables for object and polygon routine
  23.  
  24. tolerance  equ 60            ; max center of gravity offset for objects/ratio
  25. ztruncate  equ 40            ; if z< ztruncate, z=ztruncate:for make3d
  26. minz       equ 60            ; minimum z before object can be seen:for make1obj
  27. maxz       equ 3000000       ; maximum distance in any axis object can be seen
  28. followtol  equ 300           ; tolerance if already looking at object,newfollow
  29.  
  30. ; polygon constants
  31.  
  32. maxpoints   equ 600          ; max points (*total* on screen if 3d2)
  33. maxsurfaces equ 600          ; max object surfaces (*total* on screen if 3d2)
  34. mult        equ 3            ; shl ax,mult for number of sides
  35. maxpolys    equ 8  ;2^mult   ; max sides to a polygon,must = 2^mult,keep small!!
  36.  
  37. maxobjects  equ 10 ;50,100,? ; number of objects
  38.  
  39. cameraobject equ maxobjects  ; camera is last object in list
  40.  
  41. ; constants for distance vs resolution
  42.  
  43. smalla     equ 1100          ; if objects are farther than smallabc, whatshape
  44. smallb     equ 4500          ; will assume smaller form of object
  45. smallc     equ 10000         ; a = close/high resolution, d = far/low res
  46.  
  47. ; mode x definitions
  48.  
  49. ;  0 =  320 x 200
  50. ;  1 =  320 x 400
  51. ;  2 =  360 x 200
  52. ;  3 =  360 x 400
  53. ;  4 =  320 x 240
  54. ;  5 =  320 x 480
  55. ;  6 =  360 x 240
  56. ;  7 =  360 x 480
  57.  
  58. videomode  equ -1
  59.  
  60.            if videomode eq 0
  61.  
  62. xmode      equ videomode
  63. xmax       equ 160
  64. xmin       equ -160
  65. ymax       equ 100
  66. ymin       equ -100
  67. xactual    equ 320
  68. yactual    equ 200
  69.  
  70. xcenter    equ 160
  71. ycenter    equ 100
  72.  
  73. ratiox     equ 320
  74. ratioy     equ 260
  75. pages      equ 4
  76.  
  77.            elseif videomode eq 1
  78.  
  79. xmode      equ videomode
  80. xmax       equ 160         ; right colomn just beyond screen for clipping
  81. xmin       equ -160        ; left coloumn on screen, x's must be "and 0fff8h"
  82. ymax       equ 200         ; lower row just beyond screen
  83. ymin       equ -200        ; upper row on screen
  84. xactual    equ 320
  85. yactual    equ 400
  86.  
  87. xcenter    equ 160         ; screen center x,y for actual screen point (0,0)
  88. ycenter    equ 200         ; make sure clipping still stays inside screen
  89.  
  90. ratiox     equ 320         ; apsect ratio for 3d conversion (zoom)
  91. ratioy     equ 470         ; make x and y different to fine tune (draw circle)
  92. pages      equ 2
  93.  
  94.            elseif videomode eq 2
  95.  
  96. xmode      equ videomode
  97. xmax       equ 180
  98. xmin       equ -180
  99. ymax       equ 100
  100. ymin       equ -100
  101. xactual    equ 360
  102. yactual    equ 200
  103.  
  104. xcenter    equ 180
  105. ycenter    equ 100
  106.  
  107. ratiox     equ 320
  108. ratioy     equ 240
  109. pages      equ 3
  110.  
  111.            elseif videomode eq 3
  112.  
  113. xmode      equ videomode
  114. xmax       equ 180
  115. xmin       equ -180
  116. ymax       equ 200
  117. ymin       equ -200
  118. xactual    equ 360
  119. yactual    equ 400
  120.  
  121. xcenter    equ 180
  122. ycenter    equ 200
  123.  
  124. ratiox     equ 300
  125. ratioy     equ 420
  126. pages      equ 1
  127.  
  128.            elseif videomode eq 4
  129.  
  130. xmode      equ videomode
  131. xmax       equ 160
  132. xmin       equ -160
  133. ymax       equ 120
  134. ymin       equ -120
  135. xactual    equ 320
  136. yactual    equ 240
  137.  
  138. xcenter    equ 160
  139. ycenter    equ 120
  140.  
  141. ratiox     equ 300
  142. ratioy     equ 280
  143. pages      equ 3
  144.  
  145.            elseif videomode eq 5
  146.  
  147. xmode      equ videomode
  148. xmax       equ 160
  149. xmin       equ -160
  150. ymax       equ 240
  151. ymin       equ -240
  152. xactual    equ 320
  153. yactual    equ 480
  154.  
  155. xcenter    equ 160
  156. ycenter    equ 240
  157.  
  158. ratiox     equ 260
  159. ratioy     equ 460
  160. pages      equ 1
  161.  
  162.            elseif videomode eq 6
  163.  
  164. xmode      equ videomode
  165. xmax       equ 180
  166. xmin       equ -180
  167. ymax       equ 120
  168. ymin       equ -120
  169. xactual    equ 360
  170. yactual    equ 240
  171.  
  172. xcenter    equ 180
  173. ycenter    equ 120
  174.  
  175. ratiox     equ 320
  176. ratioy     equ 260
  177. pages      equ 3
  178.  
  179.            elseif videomode eq 7
  180.  
  181. xmode      equ videomode
  182. xmax       equ 180
  183. xmin       equ -180
  184. ymax       equ 240
  185. ymin       equ -240
  186. xactual    equ 360
  187. yactual    equ 480
  188.  
  189. xcenter    equ 180
  190. ycenter    equ 240
  191.  
  192. ratiox     equ 280
  193. ratioy     equ 470
  194. pages      equ 1
  195.  
  196. ; if videomode = -1, custom configuration
  197.  
  198.            elseif videomode eq -1
  199.  
  200. xmode      equ 1
  201. xmax       equ 9*16
  202. xmin       equ -9*16
  203. ymax       equ 140
  204. ymin       equ -140
  205. xactual    equ 320
  206. yactual    equ 400
  207.  
  208. xcenter    equ 160
  209. ycenter    equ 200
  210.  
  211. ratiox     equ 320
  212. ratioy     equ 464
  213. pages      equ 2
  214.  
  215. ; if videomode = -2, custom configuration
  216.  
  217.            elseif videomode eq -2
  218.  
  219. xmode      equ 0
  220. xmax       equ 9*16
  221. xmin       equ -9*16
  222. ymax       equ 60
  223. ymin       equ -70
  224. xactual    equ 320
  225. yactual    equ 200
  226.  
  227. xcenter    equ 160
  228. ycenter    equ 100
  229.  
  230. ratiox     equ 320
  231. ratioy     equ 260
  232. pages      equ 2
  233.  
  234.            endif
  235.  
  236. ; ===== general xmode constants =====
  237.  
  238. false   equ 0
  239. true    equ -1
  240. nil     equ 0
  241.  
  242. b       equ byte ptr
  243. w       equ word ptr
  244. d       equ dword ptr
  245. o       equ offset
  246. f       equ far ptr
  247. s       equ short
  248. ?x4     equ <?,?,?,?>
  249. ?x3     equ <?,?,?>
  250.  
  251. ; ===== vga register values =====
  252.  
  253. vga_segment     equ d 0a0000h ; vga memory segment
  254.  
  255. attrib_ctrl     equ 03c0h   ; vga attribute controller
  256. gc_index        equ 03ceh   ; vga graphics controller
  257. sc_index        equ 03c4h   ; vga sequencer controller
  258. sc_data         equ 03c5h   ; vga sequencer data port
  259. crtc_index      equ 03d4h   ; vga crt controller
  260. crtc_data       equ 03d5h   ; vga crt controller data
  261. misc_output     equ 03c2h   ; vga misc register
  262. input_1         equ 03dah   ; input status #1 register
  263.  
  264. dac_write_addr  equ 03c8h   ; vga dac write addr register
  265. dac_read_addr   equ 03c7h   ; vga dac read addr register
  266. pel_data_reg    equ 03c9h   ; vga dac/pel data register r/w
  267.  
  268. pixel_pan_reg   equ 033h    ; attrib index: pixel pan reg
  269. map_mask        equ 002h    ; sequ index: write map mask reg
  270. read_map        equ 004h    ; gc index: read map register
  271. start_disp_hi   equ 00ch    ; crtc index: display start hi
  272. start_disp_lo   equ 00dh    ; crtc index: display start lo
  273.  
  274. map_mask_plane1 equ 00102h  ; map register + plane 1
  275. map_mask_plane2 equ 01102h  ; map register + plane 1
  276. all_planes_on   equ 00f02h  ; map register + all bit planes
  277.  
  278. chain4_off      equ 00604h  ; chain 4 mode off
  279. async_reset     equ 00100h  ; (a)synchronous reset
  280. sequ_restart    equ 00300h  ; sequencer restart
  281.  
  282. latches_on      equ 00008h  ; bit mask + data from latches
  283. latches_off     equ 0ff08h  ; bit mask + data from cpu
  284.  
  285. vert_retrace    equ 08h     ; input_1: vertical retrace bit
  286. plane_bits      equ 03h     ; bits 0-1 of xpos = plane #
  287. all_planes      equ 0fh     ; all bit planes selected
  288. char_bits       equ 0fh     ; bits 0-3 of character data
  289.  
  290. get_char_ptr    equ 01130h  ; vga bios func: get char set
  291. rom_8x8_lo      equ 03h     ; rom 8x8 char set lo pointer
  292. rom_8x8_hi      equ 04h     ; rom 8x8 char set hi pointer
  293.  
  294. ; constants specific for these routines
  295.  
  296. num_modes       equ 8       ; # of mode x variations
  297.  
  298.