Mail Archives: djgpp/2001/09/08/15:30:08
#include <dpmi.h>
//you have to include <dpmi.h> to get access to the video memory
(a000h++)
void setmode(short mode)
{
__dpmi_regs r;
r.x.ax=mode;
__dpmi_int(0x10,&r);
}
// do a _dpmi_regs variable (r for an instance)
// fill it with the stuff you want
//
// do the __dpmi_int, and pass the register struct, too... the
__dpmi_int()
// cares about switching between the real mode, and back to protected
void wtsync(void)
{
while((inportb(0x3da)&8));
while(!(inportb(0x3da)&8));
}
// ... just because you could need it
void setpal(char * pal)
{
int i;
outportb(0x3c8, 0);
for (i=0; i< 256*3; i++)
outportb(0x3c9, pal[i]);
}
void getpal(char*pal)
{
int i;
outportb(0x3c7,0);
for(i=0;i<256*3;i++)
pal[i]=inportb(0x3c9);
}
void blit2screen(char * buffer)
{
dosmemput(buffer,64000,0xa0000);
}
// i use blit2screen to blit the graphics, i prepare them in a memory
buffer...
// i kinda don't use the putpixel anymore, because i always flip the
memory
// buffer to the graphic card memory...
// ***************** end of source **********************
i would suggest to go to delorie (www.delorie.com), look at the djgpp
page, follow to links, and somewhere there i found more stuff...
if you cannot find anything, i will look it up for you again...
or maybe send you the tutorials. good resources are everywhere :)
- Raw text -