delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/10/06:36:35

From: Nils Desle <ndesle AT eps DOT agfa DOT be>
Newsgroups: comp.os.msdos.djgpp,comp.graphics.algorithms
Subject: Re: VESA 2.0 and NEAR PTR
Date: Mon, 10 Mar 1997 09:39:55 +0100
Organization: Agfa-Gevaert N.V.
Lines: 32
Message-ID: <3323C8DB.308F@eps.agfa.be>
References: <33232BE7 DOT 2F3D AT nada DOT kth DOT se>
NNTP-Posting-Host: paris.eps.agfa.be
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Niklas wrote:
> 
> The following program doesn't work, and so doesn't the wide-spread
> vbetest.zip. but vbetest.zip used to work for me, but not any longer.
> is there some update problem? I use djgpp2, sdd53 and win95.

[Snip]

> 
>   int mode = 0x4101;
> 
>   VBE_getmodeinfo(mode, &modeinfo);
>   if(modeinfo.ModeAttributes & 0x8)
>     printf("Linear frame buffer found\n");
>   else {
>     printf("Linear frame buffer not found\n");
>     exit(1);
>   }
> 

[Snip]

The problem might be that you're assuming mode 640x480 is 0x4101. While 
this was usually true for Vesa 1.2, this is not at all guaranteed in Vesa 
2.0. The correct way to get the modenumber of the mode you're looking for 
is requesting the mode-table, and scanning that for the desired 
resolution & bits per pixel, thus giving you the right modenumber.

Hope this helps ...

Nils Desle
ndesle AT eps DOT agfa DOT be

- Raw text -


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