Hi,
I wanted to get into the 800x600x32-bit colour VESA mode, so I made this little function:-
int sv_setmode(int mode)
{
union REGS regs;
regs.h.ah = 0x4F;
regs.h.al = 0x02;
regs.x.bx = mode;
return int86(0x10, ®s, ®s);
}
(The registered symbols are supposed to read "the address of regs" (& regs), this source parser is brilliant, don't you think?
)
And passed 115 as the parameter. This successfully placed me in what I could only assume to be my requested graphics mode. To test it, I wrote a simple pixel-plotting loop, using the good old 0xA000 VGA pointer as the place to write to:-
int x;
for(x=0;x<600;x++)
screen[x*800+x] = x;
But rather than giving me a straight diagonal line of pixels across the screen, I ended up with a rather strange pattern of pixels, what appeared to be several diagonal lines occupying the top area of the screen. I know there are several things I am not taking into account (32-bit pixel values, banked video memory, etc.), so could anybody explain to me how I would produce said pattern in this mode? Please?
I am using Borland Turbo C++ 3.0.
Edited by - SMurf7 on March 23, 2002 6:16:43 PM