delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/20/13:05:18

From: Mitchell Spector <spector AT EnchantedLearning DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Background color in Allegro
Date: Sat, 19 Apr 1997 22:37:36 -0700
Organization: Enchanted Learning Software
Lines: 72
Message-ID: <3359AB9F.559C@EnchantedLearning.com>
References: <861302268 DOT 21239 AT dejanews DOT com> <33589603 DOT 5CB9 AT mcs DOT nl>
Reply-To: spector AT EnchantedLearning DOT com
NNTP-Posting-Host: mg134-041.ricochet.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I'd like to thank Peter Zijlstra and Hez Carty for pointing me in the
right direction. I've found that the border color (or porch color) can
be changed by using a BIOS interrupt:

 __dpmi_regs r;

 r.h.ah = 0x10; 
 r.h.al = 1;
 r.h.bh = color_index;
 /* index in the SVGA palette for the desired color */

 __dpmi_int(0x10, &r);

Since I haven't found any documentation spelling this out (I guessed it
after looking at some old documentation for VGA, which works similarly
but not quite the same way), does anyone know if I'm likely to find any
compatibility problems with this appoach?  Should this work on any
super-VGA card in 8-bit color mode, any resolution?  (Or if somebody
could just point me to the proper documentation, I'd appreciate it.)

Thanks,

Mitchell
--
Mitchell Spector
Enchanted Learning Software
E-mail: spector AT EnchantedLearning DOT com
Web site: http://www.EnchantedLearning.com


Peter Zijlstra wrote:

 > spector AT EnchantedLearning DOT com wrote:
 > >
 > > I've observed that whichever color I set to be color 0 in the
palette
 > > becomes the background color of my screen (that is, the color of
the area
 > > outside the drawable area).  Does anyone know if there's any way
around
 > > this, or is this simply the way all video cards (or my video card)
work?
 > >
 > > I'd like to change color 0 in my palette, but I want to keep the
area
 > > outside the drawable area of my display black.  Can this be done? 
(I'm
 > > using Allegro, if that matters.)
 > >
 > > Thanks in advance for any information on this.
 > >
 > > Mitchell
 > > --
 > > Mitchell Spector
 > > Enchanted Learning Software
 > > E-mail: spector AT EnchantedLearning DOT com
 > > Web site: http://www.EnchantedLearning.com
 > >
 > > -------------------==== Posted via Deja News ====------------------

 > Hi,
 > 
 > I´m not that familair with allegro but it seems that the
PAGE-clearing
 > routine sets all the bytes to 0, try rewriting this routine so that
they
 > become another value eg. memset( page-offset, another-color,
 > size-of-page);
 > 
 > greetinx,
 > 
 > Peter

- Raw text -


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