Go to Google Groups Home  
Web    Images    Groups    News    LocalNew!    more »
  Advanced Groups Search
  Preferences    
 Groups Viewing message <3e2234ce.1638784@news.voyager.net> 
 Screen Scrape the Web • Scrape the Web to a Database/Excel Powerful, Flexible, Easy. • www.velocityscape.comSponsored Links 
 PCI-X Parallel / Serial • For 32/64 Bit 3.3/5 volt slots in Win / Linux. We ship world-wide. • www.softio.com
 Screen Scraping • Why cut & paste? Try RoboSuite for automated content migration. • www.kapowtech.com
From: Chris Giese (NoEmailAds@execpc.com)
Subject: Re: VGA DAC programming
View: Complete Thread (16 articles)
Original Format
Newsgroups: comp.os.msdos.djgpp
Date: 2003-01-12 19:41:55 PST
"Joel_S" <jbs30000.news.invalid@web2news.net> wrote:

>Well, since I'm writting routines for screen mode 0x12 being able to
>change the palettes of the 16 colors is necessary for properly diplaying
>a bitmap file.  But I'm not to worried, the built in SCREEN commands in

The 16 colors are processed by both the 256-color palette (the DAC)
and the 16-color palette in the first 16 registers of the Attribute
Controller. You can set the palette with code like this:

 int i, j;

 for(i = 0; i < 16; i++) {
/* reset Attribute Controller (AC) flip-flop so 0x3C0 is AC address */
  (void)inportb(0x3DA);
/* set AC address = i. You must clear bit b5 here to modify the palettes.
Clearing this bit will also blank the display. */
  outportb(0x3C0, i);
/* read AC register #i
THIS is the index into the 256-color palette, not 'i' */
  j = inportb(0x3C1);
/* set the 256-color palette (DAC) entry. Only the bottom 6 bits of each
R, G, and B entry are significant, so we divide by 4. Change RED, GREEN,
and BLUE to whatever is appropriate for your code. */
  outportb(0x3C8, j);
  outportb(0x3C9, RED  [i] / 4);
  outportb(0x3C9, GREEN[i] / 4);
  outportb(0x3C9, BLUE [i] / 4);
 }
/* set bit b5 in AC address register to lock palette and unblank display */
 (void)inportb(0x3DA);
 outportb(0x3C0, 0x20);


Google Home - Advertising Programs - Business Solutions - About Google

©2005 Google