VGAKIT Version 4.1 Hi, here is my latest SVGA/VGA info pack. I've included the .OBJ versions in case anyone who does not have an assembler wants to play with these routines. The included modules are: EXAMPLE.C is a silly C program which shows that this code works, it just plots a nice calculated pattern using the point functions. MKEXAMP.BAT batch file to compile and link EXAMPLE.C into EXAMPLE.EXE for Microsoft C 6.0 STICKS.C is another silly C program which shows that this code works, it uses the line function to draw a LOT of lines to make a very nice complex weave type pattern. Amazing how complex the image gets from such a trivial program. MKSTICKS.BAT batch file to compile and link STICKS.C into STICKS.EXE for Microsoft C 6.0 BANKS.ASM SVGA bank switch code, used to address the beyond 64k addressing sceams of the various SVGA chipsets. Also includes a global variable "curbk" which is the current hardware bank number which can be checked before each bank switch to prevent the extra overhead of switching into a currently selected bank. An example of this is in the point routine in POINT.ASM which only switches memory banks when required. BANKS.ASM includes the global variables ativga,tseng, tseng4 trident,video7,everex,paradise,chipstech, aheada, aheadb, oaktech and vga512. These variables are set by the WHICHVGA() function which must be called at program startup time to determine which SVGA (if any) you have installed. This function returns a 1 (true) if you have a SVGA card installed. MODE13X.ASM Is the function to setup the non-standard (ie: not supported by the BIOS) 360x480x256 mode, this mode works on virtually VGA that is fully IBM compatable. It's a great mode for those without SVGA capabilities. SVGAMODE.ASM Is a limited function which sets up 640x480x256 color mode on a SVGA, it uses the global chipset flags to determine the BIOS mode number. POINT.ASM Is a pair of simple point plotting functions, point(xpos,ypos,color) which plots a point at x,y coorinates xpos,ypos in SVGA modes calling newbank() in BANKS.ASM to switch memory banks when necessary. point13x(xpos,ypos,color) which plots a point at x,y coorinates xpos,ypos in 360x480 mode. Both point functions will clip at screen boundries correctly. XPOINT.ASM Is just like POINT.ASM except that it's point functions draw the points XOR'd to the screen. xpoint(xpos,ypos,color) xpoint13x(xpos,ypos,color) RDPOINT.ASM Is just like POINT.ASM except that instead of plotting points it reads the color of screen pixel. color=rdpoint(xpos,ypos) color=rdpoint13x(xpos,ypos) LINE.ASM Is a line plotting function callable from C, you pass it the coordinates for the two end points of the line, the color to draw the line in and the function to call to plot each point. bline(x1,y1,x2,y2,color,xpoint); here is a list of VGA Chipset producers and their BIOS mode numbers: =============================================================================== AHEAD ----- width height colors Direct Mode ----- ------ ------ ----------- 0x6A 800 600 16 Q 0x71 800 600 16 Q 0x74 1024 768 16 V 0x60 640 400 256 R 0x61 640 480 256 S 0x62 800 600 256 T AX=MODE =============================================================================== ATI --- width height colors Direct Mode ----- ------ ------ ----------- 0x54 800 600 16 Q 0x65 1024 768 16 V 0x61 640 400 256 R 0x62 640 480 256 S 0x63 800 600 256 T AX=MODE =============================================================================== CHIPS & TECH ------------ width height colors Direct Mode ----- ------ ------ ----------- 0x70 800 600 16 Q 0x72 1024 768 16 V 0x78 640 400 256 R 0x79 640 480 256 S 0x7b 800 600 256 T AX=MODE =============================================================================== EVEREX ------ width height colors Direct Mode ----- ------ ------ ----------- 0x01 752 410 16 0x02 800 600 16 Q 0x11 1280 350 4 0x12 1280 600 4 0x13 640 350 256 0x14 640 400 256 R 0x15 512 480 256 0x20 1024 768 16 V 0x30 640 480 256 S 0x31 800 600 256 T AX=0x70 BL=MODE =============================================================================== OAK TECH -------- width height colors Direct Mode ----- ------ ------ ----------- 0x52 800 600 16 Q 0x53 640 480 256 S 0x54 800 600 256 T 0x56 1024 768 16 V AX=MODE =============================================================================== GENOA GVGA ---------- width height colors Direct Mode ----- ------ ------ ----------- 0x7c 512 512 16 0x59 720 512 16 0x79 or 0x6a 800 600 16 Q 0x7d 512 512 256 0x5b 640 350 256 0x7e 640 400 256 R 0x5c 640 480 256 S 0x5d 720 512 256 0x5e or 0x6c 800 600 256 T 0x7f 1024 768 4 0x5f 1024 768 16 V AX=MODE =============================================================================== NCR --- width height colors Direct Mode ----- ------ ------ ----------- 0x59 800 600 2 P 0x58 800 600 16 Q 0x5e 640 400 256 R 0x5f 640 480 256 S 0x5c 800 600 256 T 0x5a 1024 768 2 U 0x5d 1024 768 16 V AX=MODE =============================================================================== PARADISE -------- width height colors Direct Mode ----- ------ ------ ----------- 0x59 800 600 2 P 0x58 800 600 16 Q 0x5e 640 400 256 R 0x5f 640 480 256 S 0x5d 1024 768 16 V AX=MODE =============================================================================== TRIDENT ------- width height colors Direct Mode ----- ------ ------ ----------- 0x5b 800 600 16 Q 0x5f 1024 768 16 V 0x5c 640 400 256 R 0x5d 640 480 256 S 0x5e 800 600 256 T AX=MODE =============================================================================== TRIDENT 8900 ------------ width height colors Direct Mode ----- ------ ------ ----------- 0x5b 800 600 16 Q 0x5c 640 400 256 R 0x5d 640 480 256 S 0x5e 800 600 256 T 0x60 1024 768 4 0x5f 1024 768 16 V 0x62 1024 768 256 X AX=MODE =============================================================================== TSENG (Genoa, Orchid, Willow) ----- width height colors Direct Mode ----- ------ ------ ----------- 0x29 800 600 16 Q 0x37 1024 768 16 V 0x2d 640 350 256 R 0x2e 640 480 256 S 0x2f 720 512 256 0x30 800 600 256 T 0x38 1024 768 256 X AX=MODE =============================================================================== TSENG 4000 ---------- width height colors Direct Mode ----- ------ ------ ----------- 0x29 800 600 16 Q 0x37 1024 768 16 V 0x2d 640 350 256 0x2f 640 400 256 R 0x2e 640 480 256 S 0x30 800 600 256 T 0x38 1024 768 256 X AX=MODE =============================================================================== VIDEO7 ------ width height colors Direct Mode ----- ------ ------ ----------- 0x60 752 410 16 0x61 720 540 16 0x62 800 600 16 Q 0x63 1024 768 2 U 0x64 1024 768 4 0x65 1024 768 16 V 0x66 640 400 256 R 0x67 640 480 256 S 0x68 720 540 256 0x69 800 600 256 T 0x6A 1024 768 256 X AX=0x6f05 BL=MODE =============================================================================== John Bridges 10/2/1991 CIS:75300,2137 GENIE:J.BRIDGES BIX:JBRIDGES