Is it possible to get into Mode13h in Borland C++ 5.01, or Dev-C++ 4.0.. If so, how? :'(
Is it possible to get into Mode13h in Borland C++ 5.01, or Dev-C++ 4.0.. If so, how? :'(
Here's some "borrowed" code you can use as a function:
void Set_Graphics_Mode(int mode)
{
// use the video interrupt 10h and the C interrupt function to set
// the video mode
union REGS inregs,outregs;
inregs.h.ah = 0; // set video mode sub-function
inregs.h.al = (unsigned char)mode; // video mode to change to
int86(0x10, &inregs, &outregs);
} // end Set_Graphics_Mode
In your programs, you could do as such:
#define GRAPHICS_MODE13 0x13
#define TEXT_MODE 0x03
And to use the function:
Set_Graphics_Mode(GRAPHICS_MODE13)
Hope that helps ;-)
Last edited by WHurricane16; 03-30-2002 at 10:19 PM.
Hi, could you explain these three lines:
inregs.h.ah = 0; // set video mode sub-function
inregs.h.al = (unsigned char)mode; // video mode to change to
int86(0x10, &inregs, &outregs);
i don't understand what i'm looking at, I can see that prior to the above lines a union was defined but whats the .h.ah stuff?
>inregs.h.ah = 0; // set video mode sub-function
>inregs.h.al = (unsigned char)mode; // video mode to change to
Here the variables are put into the registers.
Forgot to explain. The AL and AH are parts of register AX. If you don't know what I'm talking about, take a look at here
http://www.technology.niagarac.on.ca.../assembler.htm
>int86(0x10, &inregs, &outregs);
Here the interrupt 10h is called with the required values in the registers passed.
Last edited by Shiro; 04-01-2002 at 08:42 AM.
If you can use assembler in you code (TASM) you can do this:
You MUST call SetTextMode when you exit your program, it might crash otherwise...Code:void SetGraphicsMode() { asm mov ax, 0x13; asm int 0x10; } void SetTextMode() { asm mov ax, 0x03; asm int 0x10; }
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
Thanks Shiro, are the int86() function and the "REGS" macro (from: "union REGS inregs,outregs;") defined in the dos.h header file?