home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 12 / CD_ASCQ_12_0294.iso / maj / 4383 / vgakit.doc < prev    next >
Text File  |  1994-02-08  |  12KB  |  421 lines

  1. VGAKIT Version 6.0
  2.  
  3. Here is my latest SVGA/VGA info pack. I've included the .OBJ versions in case
  4. anyone who does not have an assembler wants to play with these routines.
  5.  
  6. 5.0 Changes:
  7.  
  8. Support for VESA defined line widths, and correct support for bank sizes other
  9. than 64k. Old versions of VGAKIT would adjust all bank boundries to 64k by
  10. shifting up the bank numbers on cards that have 4k or 16k banks. To correct
  11. this I've changed the code to use an address table for screen offsets and
  12. bank numbers, this is very close to what I do in my own graphics code. To
  13. simplify things I've made the address table a fixed array that supports up
  14. to 1024 scanlines. In a real program I would probably allocate this array
  15. at runtime using malloc or some similar memory allocation function. 
  16.  
  17. 5.2 Changes:
  18.  
  19. New VESA memory detect
  20. VESA 1.2 support
  21. Memory detect for Tseng3000
  22. DAC Type call added
  23. More accurate Tseng4000 detect
  24.  
  25. 5.2b Changes:
  26.  
  27. DAC detect call for Tseng4000 boards would hang many other boards
  28.   now it is only made on Tseng4000 boards
  29.  
  30. MKADRTBL function would not handle bank sizes less than 64k correctly
  31.  
  32. VESASET function would not get the bank size correctly (it was using Winsize
  33.   instead of WinGranularity
  34.  
  35.  
  36. 5.3 Changes:
  37.  
  38. New utility called INFO added which displays all the information figured
  39. out by the detect code in BANKS.ASM. MKINFO.BAT compiles and links INFO.
  40.  
  41. A couple variables added to BANKS to avoid compatability problems, they
  42. are "justvesa" which forces the detect code to only check for vesa vbe
  43. support, and nosvga which disables all svga detect.
  44.  
  45.  
  46. 5.4 Changes:
  47.  
  48. I removed use of @@ local label in SVGAMODE.ASM, this is not supported
  49. by some assemblers, and there was no real reason to use it over a
  50. dummy label.
  51.  
  52.  
  53. 6.0 Changes:
  54.  
  55. Fixed a bug in Oak detect, added some flags to disable VESA detect
  56.  
  57. Mode set code for 320x200, 800x600 and 1024x768 256 color modes
  58. are now thrown in. The common code is put into modeset.asm.
  59.  
  60. New example program called GRAV, started as a small screen saver project
  61. but the deal fell through, so I'm throwing it in as a cute example.
  62.  
  63.  
  64.  
  65. John Bridges  1/1/1994
  66.  
  67. Compuserve ID: John Bridges [GRASP] 75300,2137
  68. Internet: 75300.2137@compuserve.com (John Bridges)
  69.  
  70. I can be found regularly in the GRAPHVEN forum on Compuserve (where GRASP is
  71. supported), as well as the GRAPHSUP forum (formally called PICS).
  72.  
  73. -------------------------------------------------------------------------------
  74.  
  75.  
  76.  The included modules are:
  77.  
  78. GRAV.C        Neat little display program which does an approximation of
  79.         serveral objects affecting each other. The first pass is
  80.         to determine machine speed (about 3 seconds long).
  81.  
  82. VGAKIT.MAK    make file for compiling/assembling/linking all of VGAKIT.
  83.  
  84. EXAMPLE.C    is a silly C program which shows that this code works,
  85.         it just plots a nice calculated pattern using the
  86.         point functions.
  87.  
  88.  
  89. MKEXAMP.BAT    batch file to compile and link EXAMPLE.C into EXAMPLE.EXE
  90.         for Microsoft C 6.0 and MASM 6.1
  91.  
  92. STICKS.C    is another silly C program which shows that this code works,
  93.         it uses the line function to draw a LOT of lines to make a
  94.         very nice complex weave type pattern. Amazing how complex the
  95.         image gets from such a trivial program.
  96.  
  97.  
  98. MKSTICKS.BAT    batch file to compile and link STICKS.C into STICKS.EXE
  99.         for Microsoft C 6.0 and MASM 6.1
  100.  
  101.  
  102. INFO.C        displays all the information figured out by the svga detect
  103.                 code in whichvga() (which is in BANKS.ASM).
  104.  
  105.  
  106. MKINFO.BAT    batch file to compile and link INFO.C into INFO.EXE
  107.         for Microsoft C 6.0 and MASM 6.1
  108.  
  109.  
  110. BANKS.ASM    SVGA bank switch code, used to address the beyond 64k
  111.         addressing sceams of the various SVGA chipsets. Also
  112.         includes a global variable "curbk" which is the current
  113.         hardware bank number which can be checked before each
  114.         bank switch to prevent the extra overhead of switching
  115.         into a currently selected bank. An example of this is
  116.         in the point routine in POINT.ASM which only switches
  117.         memory banks when required.
  118.                  BANKS.ASM includes the global variables ativga,tseng, tseng4
  119.         trident,video7,everex,paradise,chipstech, aheada, aheadb,
  120.         oaktech and vgamem. These variables are set by the WHICHVGA()
  121.         function which must be called at program startup time to
  122.         determine which SVGA (if any) you have installed. This
  123.         function returns a 1 (true) if you have a SVGA card installed.
  124.         
  125.  
  126. MODE13X.ASM    Is the function to setup the non-standard (ie: not supported
  127.         by the BIOS) 360x480x256 mode, this mode works on virtually
  128.         VGA that is fully IBM compatable. It's a great mode for
  129.         those without SVGA capabilities.
  130.  
  131. SVGA640.ASM    Is a limited function which sets up 640x480x256 color
  132.         mode on a SVGA, it uses the global chipset flags to
  133.         determine the BIOS mode number.
  134.  
  135. SVGA800.ASM    Same as SVGA640 except it sets 800x600x256 color mode.
  136.  
  137. SVGA1024.ASM    Same as SVGA640 except it sets 1024x768x256 color mode.
  138.  
  139. SVGA320.ASM    Same as SVGA640 except it sets 320x200x256 color mode.
  140.  
  141. POINT.ASM    Is a pair of simple point plotting functions,
  142.  
  143.           point(xpos,ypos,color)
  144.  
  145.         which plots a point at x,y coorinates xpos,ypos in SVGA
  146.         modes calling newbank() in BANKS.ASM to switch memory
  147.         banks when necessary.
  148.  
  149.           point13x(xpos,ypos,color)
  150.  
  151.         which plots a point at x,y coorinates xpos,ypos in 360x480
  152.         mode.  Both point functions will clip at screen boundries
  153.         correctly.
  154.  
  155.  
  156. XPOINT.ASM    Is just like POINT.ASM except that it's point functions draw
  157.         the points XOR'd to the screen.
  158.  
  159.           xpoint(xpos,ypos,color)
  160.           xpoint13x(xpos,ypos,color)
  161.  
  162.  
  163. RDPOINT.ASM    Is just like POINT.ASM except that instead of plotting points
  164.         it reads the color of screen pixel.
  165.  
  166.           color=rdpoint(xpos,ypos)
  167.           color=rdpoint13x(xpos,ypos)
  168.  
  169. LINE.ASM    Is a line plotting function callable from C, you pass it the
  170.         coordinates for the two end points of the line, the color to
  171.         draw the line in and the function to call to plot each point.
  172.  
  173.           bline(x1,y1,x2,y2,color,xpoint);
  174.  
  175.  
  176. here is a list of VGA Chipset producers and their BIOS mode numbers:
  177.  
  178. =======================================================
  179.  
  180. ACUMOS
  181. ------
  182.         width        height        colors 
  183.         -----        ------        ------ 
  184. 0x59          800           600             2 
  185. 0x58          800           600            16 
  186. 0x5e          640           400           256 
  187. 0x5f          640           480           256 
  188. 0x5c          800           600           256 
  189. 0x5d         1024           768            16 
  190.  
  191. AX=MODE
  192.  
  193. =======================================================
  194.  
  195. AHEAD
  196. -----
  197.         width        height        colors 
  198.         -----        ------        ------ 
  199. 0x6A          800           600            16 
  200. 0x71          800           600            16 
  201. 0x74         1024           768            16 
  202. 0x60          640           400           256 
  203. 0x61          640           480           256 
  204. 0x62          800           600           256 
  205. 0x63         1024           768           256 
  206.  
  207. AX=MODE
  208.  
  209. =======================================================
  210.  
  211. ATI
  212. ---
  213.         width        height        colors 
  214.         -----        ------        ------ 
  215. 0x54          800           600            16 
  216. 0x65         1024           768            16 
  217. 0x61          640           400           256 
  218. 0x62          640           480           256 
  219. 0x63          800           600           256 
  220. 0x64         1024           768           256 
  221.  
  222. AX=MODE
  223.  
  224. =======================================================
  225.  
  226. CHIPS & TECH
  227. ------------
  228.         width        height        colors 
  229.         -----        ------        ------ 
  230. 0x70          800           600            16 
  231. 0x72         1024           768            16 
  232. 0x78          640           400           256 
  233. 0x79          640           480           256 
  234. 0x7b          800           600           256 
  235.  
  236. AX=MODE
  237.  
  238. =======================================================
  239.  
  240. COMPAQ
  241. ------
  242.         width        height        colors 
  243.         -----        ------        ------ 
  244. 0x2e              640              480             256
  245. 0x38             1024              768             256
  246.  
  247. =======================================================
  248.  
  249. EVEREX
  250. ------
  251.         width        height        colors 
  252.         -----        ------        ------ 
  253. 0x01          752           410            16
  254. 0x02          800           600            16 
  255. 0x11         1280           350             4
  256. 0x12         1280           600             4
  257. 0x13          640           350           256
  258. 0x14          640           400           256 
  259. 0x15          512           480           256
  260. 0x20         1024           768            16 
  261. 0x30          640           480           256 
  262. 0x31          800           600           256 
  263. 0x32         1024           768           256 
  264.  
  265. AX=0x70 BL=MODE
  266.  
  267. =======================================================
  268.  
  269. GENOA GVGA
  270. ----------
  271.         width        height        colors 
  272.         -----        ------        ------ 
  273. 0x7c              512           512            16
  274. 0x59              720           512            16
  275. 0x79 or 0x6a      800           600            16 
  276. 0x7d              512           512            256
  277. 0x5b              640           350            256
  278. 0x7e              640           400            256
  279. 0x5c              640           480            256
  280. 0x5d              720           512            256
  281. 0x5e or 0x6c      800           600            256
  282. 0x7f             1024           768            4
  283. 0x5f             1024           768            16 
  284.  
  285. AX=MODE
  286.  
  287. =======================================================
  288.  
  289. NCR
  290. ---
  291.         width        height        colors 
  292.         -----        ------        ------ 
  293. 0x59          800           600             2 
  294. 0x58          800           600            16 
  295. 0x5e          640           400           256 
  296. 0x5f          640           480           256 
  297. 0x5c          800           600           256 
  298. 0x5a         1024           768             2 
  299. 0x5d         1024           768            16 
  300. 0x62             1024              768             256
  301.  
  302. AX=MODE
  303.  
  304. =======================================================
  305.  
  306. OAK TECH
  307. --------
  308.         width        height        colors 
  309.         -----        ------        ------ 
  310. 0x52          800           600            16 
  311. 0x53          640           480           256 
  312. 0x54          800           600           256 
  313. 0x56         1024           768            16 
  314. 0x59         1024           768           256 
  315. 0x58         1280          1024            16 
  316.  
  317. AX=MODE
  318.  
  319. =======================================================
  320.  
  321. PARADISE
  322. --------
  323.         width        height        colors 
  324.         -----        ------        ------ 
  325. 0x59          800           600             2 
  326. 0x58          800           600            16 
  327. 0x5e          640           400           256 
  328. 0x5f          640           480           256 
  329. 0x5d         1024           768            16 
  330. 0x5c          800           600           256 
  331.  
  332. AX=MODE
  333.  
  334. =======================================================
  335.  
  336. TRIDENT
  337. -------
  338.         width        height        colors 
  339.         -----        ------        ------ 
  340. 0x5b          800           600            16 
  341. 0x5f         1024           768            16 
  342. 0x5c          640           400           256 
  343. 0x5d          640           480           256 
  344. 0x5e          800           600           256 
  345.  
  346. AX=MODE
  347.  
  348. =======================================================
  349.  
  350. TRIDENT 8900
  351. ------------
  352.         width        height        colors 
  353.         -----        ------        ------ 
  354. 0x5b          800           600            16 
  355. 0x5c          640           400           256 
  356. 0x5d          640           480           256 
  357. 0x5e          800           600           256 
  358. 0x60         1024           768             4
  359. 0x5f         1024           768            16 
  360. 0x62         1024           768           256 
  361.  
  362. AX=MODE
  363.  
  364. =======================================================
  365.  
  366. TSENG  (Genoa, Orchid, Willow)
  367. -----
  368.         width        height        colors 
  369.         -----        ------        ------ 
  370. 0x29          800           600            16 
  371. 0x37         1024           768            16 
  372. 0x2d          640           350           256 
  373. 0x2e          640           480           256 
  374. 0x2f          720           512           256
  375. 0x30          800           600           256 
  376.  
  377. AX=MODE
  378.  
  379. =======================================================
  380.  
  381. TSENG 4000
  382. ----------
  383.         width        height        colors 
  384.         -----        ------        ------ 
  385. 0x29          800           600            16 
  386. 0x37         1024           768            16 
  387. 0x2d          640           350           256
  388. 0x2f          640           400           256 
  389. 0x2e          640           480           256 
  390. 0x30          800           600           256 
  391. 0x38         1024           768           256 
  392.  
  393. AX=MODE
  394.  
  395. =======================================================
  396.  
  397. VIDEO7
  398. ------
  399.         width        height        colors 
  400.         -----        ------        ------ 
  401. 0x60          752           410            16
  402. 0x61          720           540            16
  403. 0x62          800           600            16 
  404. 0x63         1024           768             2 
  405. 0x64         1024           768             4
  406. 0x65         1024           768            16 
  407. 0x66          640           400           256 
  408. 0x67          640           480           256 
  409. 0x68          720           540           256
  410. 0x69          800           600           256 
  411. 0x6A         1024           768           256 
  412.  
  413. AX=0x6f05 BL=MODE
  414.  
  415. =======================================================
  416.  
  417.  
  418.  
  419.  
  420.  
  421.