[comp.os.msdos.programmer] EGA/VGA display routines

hafey@capitol.com (Rob Hafey) (06/20/91)

I am planning to port an Amiga animation library to the PC.  I am looking for some
examples of how to access EGA and VGA cards directly (not through the bios) and
possibly some example routines to perform basic pixel operations (write pixel, 
write block, read pixel, lines, etc...).  I know good fast routines normally stay
with the author but though I would at least ask before starting into this project.
If anyone out there knows of routines like these available free (prefered), 
shareware, or commercially I would like to hear about them.  Also if there are
any good reference books on the topic please tell.

Thanks in advance.
-- 
 Rob Hafey
 Capitol Disk Interactive (CD-I) 
 2121 Wisconsin Ave NW, Washington D.C. 20007   (202)625-0141 
 hafey@capitol.com

msmith%peruvian.utah.edu@cs.utah.edu (Matthew Smith) (06/21/91)

In article <1991Jun19.195444.2699@capitol.com> hafey@capitol.com (Rob Hafey) writes:
>I am planning to port an Amiga animation library to the PC.  I am looking for some
>examples of how to access EGA and VGA cards directly (not through the bios) and
>possibly some example routines to perform basic pixel operations (write pixel, 
>write block, read pixel, lines, etc...).  I know good fast routines normally stay
>with the author but though I would at least ask before starting into this project.
>If anyone out there knows of routines like these available free (prefered), 
>shareware, or commercially I would like to hear about them.  Also if there are
>any good reference books on the topic please tell.
>

A good book in this area is "The Programmer's Guide to the EGA/VGA" cards.  I
would suggest you look at this book.  Directly programming the EGA/VGA 
registers is a pretty nasty thing.  I can't remember the name of the publisher
right off of the top of my head.  My book's at home.  But it is VERY 
informative as to what registers to write to.

A good explanation of what you need to do is you need to write a value to a
particular register to select what mode you want to use, write a value to 
another register selecting the function, and writing a value to another 
register constituting of a bitmap you want to write out.  

Your first write is usually done at the first of the program, but the next 2
writes are usually done each time you want to write to the screen.  The real
hassle comes in when you are writing successive pixels.  The bitmap overlaps
from pixel to pixel (I'm assuming VGA mode), and you need to make sure that
you know what values you are writing, and exactly what they are doing.  

It's a pretty big headache, depending on what you want to do.

Just my opinion on programming graphics stuff...  your mileage may vary...

Matt Smith
msmith@peruvian.utah.edu
University of Utah Computer Science