************************************************************* * * * BGI device driver TWEAKVGA.BGI for 'tweaked' VGA modes. * * * * Programmed by Timo Sillanpaa. * * version 1.0 * * 14/04/1991 * * * ************************************************************* TWEAKVGA.BGI is released to the Public Domain on the condition that it is transferred, copied and distributed unaltered and without any kind of a charge. TWEAKVGA.BGI and other files are distributed in an archive named TWEAKVGA.ZIP. Files included in the archive: 1. README.1ST read this before trying to run TWEAKDEM 2. TWEAKVGA.DOC this file 3. TWEAKVGA.BGI BGI device driver for Borland Turbo languages 4. TWEAKDEM.PAS demo of TWEAKVGA.BGI (modified version of Borland's BGIDEMO.PAS) 5. TWEAKDEM.EXE compiled demo Please do not change contents of this archive. * What is TWEAKVGA.BGI ? Device independent graphics output is made possible by the use of device drivers. Borland Turbo languages (Turbo Pascal, Turbo C etc.) use BGI device drivers. BGI device drivers included in Borland's Turbo languages aren't ideal for all purposes but anyone is allowed to make a BGI driver of his own. Hardware sprites aren't supported by PC computers and moving objects must be drawn (=copied to the video RAM) and moved by the CPU. Drawing and removing sprites are time consuming tasks and if sprites are drawed on the visual page, they will flicker. This can be avoided by drawing sprites on a hidden page. In 16- color graphics modes (except in 640x480/16) at least two pages are supported and animation is quite an easy task. Only one 256- color graphics mode is supported by the standard VGA: 320x200, 256 colors. That mode is exactly the same as that of MCGA. MCGA has only 64Kb of video RAM and only one page is supported in 320x200/256-mode. (320x200 = 64000) Animation is possible in that mode but general purpose animation routines are almost impossible to implement. VGA has at least 256Kb of video memory and in 320x200/256-mode four pages could be supported. Unfortunately VGA BIOS knows only one page. Some special modes exist in VGA but they must be switched on by programming registers directly = they must be 'tweaked'. (320x200/256-BGI (VGA256.BGI) is provided by Borland but only standard MCGA/VGA mode is supported.) So, I created TWEAKVGA.BGI for animation purposes. Animation routines ARE NOT included in this archive because they are not finished. Animation package (including TWEAKVGA.BGI) will be released in July 1991 (I hope). It will be shareware, not PD like this. * Features TWEAKVGA.BGI supports four special 256-color graphics modes: 0 = 320x200, 256 colors, 4 pages 1 = 320x400, 256 colors, 2 pages 2 = 320x200, 256 colors, 1 page (320x819) 3 = 320x400, 256 colors, 1 page (320x819) Modes 2 and 3 are actually same as modes 0 and 1. Normally there are some hundred (384) waste bytes between pages. In modes 0 and 1 those bytes are not used. In modes 2 and 3 whole video memory is considered as a big 320x819-page and those waste bytes are used. This capability is particularly useful in vertical scrolling. (scrolling routines will be included in my animation package) PutImage has a special feature not included in Borland's standard BGI drivers: color 0 can be put as a transparent. Normally you use PutImage like this: PutImage(X,Y,Image1,NormalPut); PutImage(X,Y,Image2,AndPut); To use this special putting mode, use number 5: PutImage(X,Y,Image,5); * Bugs FloodFill doesn't work BUT that is not a bug. FloodFill is not implemented because implementing flood fill in 256-color modes isn't an easy task. I'm trying to fix this in the next version of TWEAKVGA.BGI. TWEAKVGA.BGI has been tested with Turbo Pascal 5.5 and Turbo C++. I'm not sure whether tweaked VGA modes are supported by all VGA adapters. If any problems exist, please let me know and remember to mention the manufacturer and model of your VGA adapter. I don't have time to test TWEAKVGA.BGI carefully and some bugs may exist. If you notice a bug, please let me know and I'll try to fix it. Comments, suggestions and bug reports can be sent to: (Please write in Finish or English.) Ultraline +358 0 802 1869 /V.32/HST/V.42bis /24h Ultraline +358 0 809 1869 /V.32/HST/V.42bis /24h Future RCOM +358 0 326 690 /V.22/V.22bis /24h Leave PRIVATE MAIL to TUBE. or fidonet Timo Sillanpaa@2:220/59 internet timo.sillanpaa@f59.n220.z2.fidonet.org or send a letter to: Timo Sillanpaa Sveitsinkatu 3 05900 Hyvinkaa Finland