Mail Archives: djgpp/1998/09/06/21:01:44
Hi.
The mode for 640x480x16bit is in VESA 1.2: 0x111 But when I read Ralph
Browns interruptlist there was marked that Diamond Stealth used 0x211.
A friend of mine didn't get my code working on his Matrox VESA 2.0 card
and well the workaround was to only to add 0x4000 to the mode(actually
this sets the lineframe buffer, but it works anyway, If anybody knows
Why...).
Well:
Use it as you like...
int get_bank(int x,int y) /* for plot */
{
return((x+y*1280)>>16); /* I think */
}
int set_bank(int bank)
{
__dpmi_regs reg;
if(bank!=active_bank)
{
reg.x.ax=0x4f05;
reg.x.bx=0x0000;
reg.x.dx=bank;
reg.h.dh=0;
__dpmi_int(0x10,®);
active_bank=bank;
}
return(0);
}
int setmode(short mode)
{
int ret;
__dpmi_regs reg;
__dpmi_meminfo mi;
int vesa_err;
reg.x.ax=0x4f02;
reg.x.bx=mode;
__dpmi_int(0x10,®);
ret=reg.x.ax;
if(reg.h.al!=0x4f)
goto_error("Videomode not supported.");
if(reg.h.ah)
goto_error("Failed to install videomode.");
return(ret);
}
void plot16(int x,int y,unsigned int col)
{
int b;
int offset=plot16_y[y]+x<<1;
b=offset>>16;
offset=(offset&0x0000FFFF)+0xA0000;
if((x>=0)&&(x<640)&&(y>=0)&&(y<480))
{
if(b!=active_bank)
set_bank(b);
_farpokew(_dos_ds,offset,col);
}
}
- Raw text -