🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #7049

VGA video mode changes through hardware on a 386

#7049
From: Barrus
Date: Wed, 12 Jun 1991 12:52
36 lines
2209 bytes
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
Technical Details
Message-ID: <1991Jun12.125245.29102@linus.mitre.org>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!linus!linus!sdimax2!barras

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!linus!linus!sdimax2!barras
From: barras@sdimax2.mitre.org (Barrus)
Newsgroups: comp.os.msdos.programmer
Subject: VGA video mode changes through hardware on a 386
Keywords: VGA 386 video mode
Message-ID: <1991Jun12.125245.29102@linus.mitre.org>
Date: 12 Jun 91 12:52:45 GMT
Sender: news@linus.mitre.org (News Service)
Organization: The MITRE Corporation, Bedford MA
Lines: 36
Nntp-Posting-Host: sdimax2.mitre.org