Mail Archives: djgpp/1999/02/04/02:14:37
Paul Derbyshire wrote:
>
> Can anyone exhibit for me a snippet of code that retrieves the current
> video mode code number and one that sets an arbitrary video mode by number?
>
> Nothing fancy needed here...no drivers or svga detection or anything. Just
> intend to retrieve a video mode at the start of a program, then put it back
> at the end of the program.
Untested:
#include <dpmi.h>
void set_mode(int m)
{
__dpmi_regs r;
r.h.ah = 0;
r.h.al = m;
__dpmi_int(0x10, &r);
}
int get_mode(void)
{
__dpmi_regs r;
r.h.ah = 0x0f;
__dpmi_int(0x10, &r);
return r.h.al;
}
For stuff like this, you should read Ralf Brown's Interrupt List,
available as inter* in the info tree of Simtelnet.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -