delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/17/11:31:20

From: ludvig <ludvig AT club-internet DOT fr>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: graphics_mode
Date: Tue, 14 Oct 1997 01:30:38 +0200
Organization: Grolier Interactive Europe
Lines: 62
Message-ID: <3442AF1E.102C@club-internet.fr>
References: <19971015004000 DOT UAA25782 AT ladder01 DOT news DOT aol DOT com>
Reply-To: ludvig AT club-internet DOT fr
NNTP-Posting-Host: ppp-122-220.toulouse.club-internet.fr
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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,&reg);
	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, &reg);
 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019