Dec 232017
 
The VGA16.BGI device driver is a device driver which supports various 16 color VGA graphics modes which can be used within Turbo C 2.0 and/or Turbo Pascal 5.X programs.
File VGA16.ZIP from The Programmer’s Corner in
Category Miscellaneous Language Source Code
The VGA16.BGI device driver is a device driver which supports various 16 color VGA graphics modes which can be used within Turbo C 2.0 and/or Turbo Pascal 5.X programs.
File Name File Size Zip Size Zip Type
DEMO.C 7802 2303 deflated
VGA16.BGI 4999 3226 deflated
VGA16.DOC 10218 2559 deflated

Download File VGA16.ZIP Here

Contents of the VGA16.DOC file


Documentation for the VGA16.BGI device driver.
by John Sieraski 4/10/90

* This release adds support for the Compro ABLE II VGA (800x600) 16 color
graphics mode.

The VGA16.BGI device driver is a device driver which supports various 16 color
VGA graphics modes which can be used within Turbo C 2.0 and/or Turbo Pascal 5.5
programs. No support for 256 color graphics display modes are provided by
this driver.

Technical details:

This driver was written by me (John Sieraski). The shell for the driver is
written in Turbo C 2.0 with the time critical support routines written using
Turbo Assembler 1.0's Ideal mode syntax. All of the display routines use
the EGA/VGA write mode 2 (the fastest mode) and write directly to the device
without going through the BIOS. Whenever a particular display routine is done
doing it's job, the card is returned to write mode 0 (The default). The video
mode switching, display page switching, and palette control is done through
calls to interrupt 10h BIOS functions. The video mode values used in the
interrupt 10h set video mode calls are listed in the table below, so if your
card uses the same video mode value shown for one of the supported cards,
chances are that selecting that mode will work on your card. If you have an
enhanced VGA not supported by this driver, drop me a note and I'll see about
adding support for your card.

List of files:

Filename Description
-------- -----------
VGA16.DOC Documentation for the VGA16.BGI device driver (This file).

VGA16.BGI A BGI driver supporting various EGA/VGA 16 color graphics modes.

DEMO.C A Turbo C 2.0 program which demonstrates some of the enhanced
features supported by the VGA16.BGI device driver.

Display modes supported by the VGA16.BGI driver:

BGI Mode Display card Resolution Interrupt 10h number of
number video mode display pages
-------- ------------ ---------- ------------- -------------
0 EGA/VGA 320x200 0Dh 8
1 EGA/VGA 640x200 0Eh 4
2 EGA/VGA 640x350 10h 2
3 VGA 640x480 12h 1
4 ATI VGA 800x600 54h 1
5 Orchid VGA 800x600 29h 1
6 Paradise VGA 800x600 58h 1
7 VEGA VGA 800x600 62h 1
8 Compro VGA 800x600 5Bh 1
9 SOTA VGA-16 800x600 29h 1

The VGA16.BGI driver provides a couple of extra features which are not
supported by the standard BGI drivers supplied with Turbo C and Turbo Pascal.
The following is a description of the enhanced capabilities:

Support for two color fill patterns
-----------------------------------
The standard BGI drivers allow you to set the colors that the 1's in the
fill patterns get plotted in, but do not allow you to alter the color that
the 0's get plotted in. The 0's in a standard BGI driver are always plotted
in color zero. The default setting for fills in the VGA16 driver is the same
as it is in a standard driver i.e. zeros in fill patterns are plotted in color
zero. To change the color that the zeros get plotted in, you need to make a
call to the setwritemode() function. The mode value that you pass to the
setwritemode() function is used to control the color that the zeros in fill
patterns will be plotted in. The valid mode values for controlling fill
pattern background colors are as follows:

mode value action performed
---------- ----------------
6 toggles the plotting of zeros in fill patterns ON in color 0.
7 toggles the plotting of zeros in fill patterns ON in color 1.
8 toggles the plotting of zeros in fill patterns ON in color 2.
9 toggles the plotting of zeros in fill patterns ON in color 3.
10 toggles the plotting of zeros in fill patterns ON in color 4.
11 toggles the plotting of zeros in fill patterns ON in color 5.
12 toggles the plotting of zeros in fill patterns ON in color 6.
13 toggles the plotting of zeros in fill patterns ON in color 7.
14 toggles the plotting of zeros in fill patterns ON in color 8.
15 toggles the plotting of zeros in fill patterns ON in color 9.
16 toggles the plotting of zeros in fill patterns ON in color 10.
17 toggles the plotting of zeros in fill patterns ON in color 11.
18 toggles the plotting of zeros in fill patterns ON in color 12.
19 toggles the plotting of zeros in fill patterns ON in color 13.
20 toggles the plotting of zeros in fill patterns ON in color 14.
21 toggles the plotting of zeros in fill patterns ON in color 15.

For example, the following call to setwritemode() would toggle the plotting
of zeros in fill patterns ON in color 7:

#define SET_BACK 6

setwritemode(SET_BACK+7);

Support for transparent fill patterns
-------------------------------------
In the standard BGI drivers, the zeros in fill patterns are always plotted
in color zero. I've added an extension into the VGA16.BGI driver which allows
you to toggle OFF the plotting of zeros in fill patterns so that you can get
a transparent effect when filling overlapping regions. To toggle the plotting
of the zeros in fill patterns OFF you make the following call to
setwritemode():

#define NO_BACK 4

setwritemode(NO_BACK);

Support for two color line patterns
-----------------------------------
The standard BGI drivers allow you to set the colors that the 1's in the
line patterns get plotted in, but the zeros in standard BGI patterned lines
are not plotted. The default setting for patterned lines in the VGA16 driver
is the same as it is in a standard driver i.e. zeros in line patterns are not
plotted. To change the color that the zeros get plotted in, you need to
make a call to the setwritemode() function. The mode value that you pass to
the setwritemode() function is used to control the color that the zeros in line
patterns will be plotted in. The valid mode values for controlling line
pattern background colors are as follows:

mode value action performed
---------- ----------------
22 toggles the plotting of zeros in line patterns ON in color 0.
23 toggles the plotting of zeros in line patterns ON in color 1.
24 toggles the plotting of zeros in line patterns ON in color 2.
25 toggles the plotting of zeros in line patterns ON in color 3.
26 toggles the plotting of zeros in line patterns ON in color 4.
27 toggles the plotting of zeros in line patterns ON in color 5.
28 toggles the plotting of zeros in line patterns ON in color 6.
29 toggles the plotting of zeros in line patterns ON in color 7.
30 toggles the plotting of zeros in line patterns ON in color 8.
31 toggles the plotting of zeros in line patterns ON in color 9.
32 toggles the plotting of zeros in line patterns ON in color 10.
33 toggles the plotting of zeros in line patterns ON in color 11.
34 toggles the plotting of zeros in line patterns ON in color 12.
35 toggles the plotting of zeros in line patterns ON in color 13.
36 toggles the plotting of zeros in line patterns ON in color 14.
37 toggles the plotting of zeros in line patterns ON in color 15.

For example, the following call to setwritemode() would toggle the plotting
of zeros in line patterns ON in color 11:

#define LINE_BACK 22

setwritemode(LINE_BACK+11);

Support for transparent line patterns
-------------------------------------
In the standard BGI drivers, the zeros in line patterns are never plotted.
I've added an extension into the VGA16.BGI driver which allows you to toggle ON
and OFF the plotting of zeros in line patterns so that you can get still get
a transparent effect when plotting overlapping patterned lines. To toggle the
plotting of the zeros in line patterns OFF you make the following call to
the setwritemode() function:

#define NO_LINE_BACK 5

setwritemode(NO_LINE_BACK);

Support for extended line transfer modes
----------------------------------------
The standard mode values supported by the setwritemode() function for
controlling the transfer mode used by the line drawing routines are:

0 : for overwrite transfer mode (COPY_PUT).
1 : for XOR transfer mode (XOR_PUT).

The VGA16 driver adds support for the following additional line transfer
modes:

2 : for AND transfer mode (AND_PUT).
3 : for OR transfer mode (OR_PUT).

Standard BGI functions not supported by VGA16.BGI:
--------------------------------------------------
The only function defined in the standard BGI interface that isn't supported
by the VGA16 driver is support for the floodfill() function. I'll probably
add support for floodfill() in a future release, but I didn't want to delay
making this driver available until I debug my current floodfill routine. If
you make a call to floodfill() within a program, the function call will just
do nothing and then return.

Bugs
----
If you experience any problems in using this driver, I'd appreciate it if
you'd let me know.

My BIX account has been canceled, so I can no longer be contacted there.

I can be contacted on Compuserve as John Sieraski 76117,2022.

I also have an MCI MAIL account "jsieraski".

Distribution
------------
This driver may be distributed freely as long as no fee (besides download
costs) are required. I take no responsibility for any problems you might
encounter when using this driver, but if you have any trouble, I'd
appreciate it if you'd let me know so that I can attempt to correct the
problem(s).
Enjoy!


 December 23, 2017  Add comments

Leave a Reply