home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Current Shareware 1994 January
/
SHAR194.ISO
/
graphuti
/
vesamode.zip
/
VESAMODE.CPP
< prev
next >
Wrap
Text File
|
1993-07-17
|
2KB
|
49 lines
//
// VESAMODE
//
// A utility for setting VESA modes on VESA-capable
// video cards.
//
// Copyright (c) July, 1993 by Jack Courtney, Compuserve 70322.1500.
//
// Placed in the public domain, July, 1993.
//
#include <iostreams.h>
#include <strstream.h>
#include <dos.h>
#define VIDEO 0x10
main( int argc, char *argv[] )
{
if( argc<2 ) {
cerr << "SYNTAX: vesamode <mode>" << endl
<< endl
<< "where <mode> is any 'C'-formatted integer." << endl
<< "For example, executing the command" << endl
<< endl
<< "> VESAMODE 0x10c" << endl
<< endl
<< "sets VESA mode 10C, a 60x132 text mode." << endl;
}
else {
unsigned mode;
REGS iregs, oregs;
istrstream arg1( argv[1] );
arg1 >> mode;
iregs.x.ax=0x4f02; // Setmode is VESA function #2.
iregs.x.bx=mode;
int86( VIDEO, &iregs, &oregs );
if( oregs.h.al != 0x4F )
cerr << "VESA setmode function not supported." << endl;
if( oregs.h.ah == 0x01 )
cerr << "Unable to set requested mode." << endl;
}
}