[comp.sys.ibm.pc.misc] VGA video mode changes through hardware on a 386

barras@sdimax2.mitre.org (Barrus) (06/12/91)

Could someone out there mail me the source to a C or 386 assembly code
program to change video modes with VGA?

I'm writing some standalone 386 code on my PC (i.e. no BIOS) but can't
seem to switch video modes sucessfully (actually, a few that are
similar to the mode I was in when running the program work, but no
drastic changes seem to be possible)

I've copied the video parameter table from the BIOS into an array,
and am currently trying to switch modes by doing the following:
loading the sequencer(3c4) with 0x100, then the 4 sequencer values, then 0x300
loading the graphics controller(I forget the port) with the 9 values
loading the CRTC registers with 25 values
loading the 20 attribute control registers
setting the misc output register (3c2) to the correct value

Like I said, this partly works-- i.e. - if I'm in a 80x25 VGA screen,
it can go to a 80x25 EGA screen, etc....
but when I load the tables for things like 132x25, 132x60, 80x30, etc...
it totally blows up.
Is there some particular order these register must be loaded in, or
some other ports that have to be twiddled?    
I'm using a Trident VGA, but I was under the impression that the ports
should be the same for most VGA's.. only the values in the table would
be different... or so I thought....

So, what am I missing?  Does anyone have code examples?
Also, if anyone happens to have a listing of all the VGA video control
ports and all their registers/bits/functions.... I'd greatly appreciate it.
Thanks
  - Frank

P.S. - please mail me a response, because I don't have time to read news
very often.

------
sorry, my .sig got nuked...
 barras@sdimax2.mitre.org