Mail Archives: djgpp/1997/10/17/11:31:20
Mejorm wrote:
>
> I extracted this compiler yesturday, and have not been able to piece together
> the ins and outs of graphics. I'm used to other compilers...anyone out there
> willing to point me in the right direction? Right now I'm trying to find out
> how to set the videomode (13h, etc) and to set up a page-loading routine.
> (Single Array style).
> The basics would be fine.
> Mail be at Mejorm AT AOL DOT COM or post.
> Thanks
Maybe this might be useful:
int set_bank(int bank)
{
__dpmi_regs reg;
if(bank!=active_bank)
{
reg.h.ah=0x4f;
reg.h.al=0x05;
reg.h.bh=0x00;
reg.h.dl=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.h.ah=0x4f;
reg.h.al=0x02;
reg.h.bl=mode;
if(mode>255)
reg.h.bh=1;
else
reg.h.bl=0;
__dpmi_int(0x10, ®);
ret=reg.h.ah;
return(ret);
}
just ripped it out of my code but you should be able to use it right
away(one #include.. or two maybe), setmode(), like 0x13 for(320x200x256)
or 0x111 for(640x480x65536) or any other VESA compatible, access
videomemory with setbank(you don't need setbank for the 0x13-mode) and
write to the 64kb starting at 0xa0000, but thats common knowledge I
guess.
I'v got a (rather)fast put_bmp for the mode 0x111 if anyone is
interrested. Guess not, everuone's using Allegro(which migh be something
if you need a graph-package for DJGPP).
Hope it helps anyway...
Ludvig
- Raw text -