From: "Joel_S" Newsgroups: comp.os.msdos.djgpp Subject: Re: VGA DAC programming Date: Tue, 14 Jan 2003 14:44:52 +0100 Organization: Web2news.com Message-ID: <11200N092@web2news.com> References: <10780N882 AT web2news DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 NNTP-Posting-Host: 198.81.26.238 X-Complaints-To: abuse AT web2news DOT net Lines: 52 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Great, I'll give it a try. Thanks, I appreciate it. > Check the values of the ATC Palette values. > Believe it or not, all VGA modes, except 8-bit or higher, > use *both* the ATC > Palette and the RAMDAC Palette. > The reason that it works under BASIC is that BASIC sets > all of the ATC > palette > values to their indexes. > However, INT 0x10 does not do so. > > If you don't believe me, try the following BASIC code: > > SCREEN 12 > FOR N=0 TO 15 > LINE (N*20,0)-STEP(19,100),N,BF > NEXT > SLEEP > FOR N=0 TO 15 > X = INP(&H3DA) > OUT &H3C0, N > OUT &H3C0, RND * 64 > NEXT > X = INP(&H3DA) > OUT &H3C0, &H20 > X = INP(&H3C0) > X = INP(&H3DA) > SLEEP > END > > This should first produce the expected colour bars, then > after pressing a > key, change the colours to random ones. > > Try the following code: > { > char n, x; > for (n=0; n<16; n++){ > x = inportb (0x3DA); > outportb (0x3C0,n); > outportb (0x3C0,n); > } > outportb (0x3C0, 0x20); > x = inportb (0x3C0); > x = inportb (0x3DA); > } > > Hope this helps. > -- Posted via http://web2news.com the faster web2news on the web