From: "Ben Peddell" Newsgroups: comp.os.msdos.djgpp References: <10780N882 AT web2news DOT com> <11200N092 AT web2news DOT com> Subject: Re: VGA DAC programming Lines: 58 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: Date: Fri, 17 Jan 2003 10:55:25 +1000 NNTP-Posting-Host: 144.134.90.23 X-Trace: newsfeeds.bigpond.com 1042764524 144.134.90.23 (Fri, 17 Jan 2003 11:48:44 EST) NNTP-Posting-Date: Fri, 17 Jan 2003 11:48:44 EST Organization: Telstra BigPond Internet Services (http://www.bigpond.com) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com By the way, how'd it go? Joel_S wrote in message news:11200N092 AT web2news 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