From: phreadd AT powerup DOT com DOT au (David Orme) Newsgroups: comp.os.msdos.djgpp Subject: problem with setting the palette Date: 25 Jul 1997 06:19:40 GMT Organization: Power Up Lines: 34 Message-ID: <5r9ghs$5e8$2@grissom.powerup.com.au> Reply-To: phreadd AT powerup DOT com DOT au NNTP-Posting-Host: ts0315.powerup.com.au Mime-Version: 1.0 Content-Type: Text/Plain; charset=US-ASCII To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I'm displaying PCX files to the screen in VESA mode 0x101 (640x480x256). The problem is that the palette either: a) isn't being loaded correctly, or b) isn't being set correctly. This is what I'm doing: byte pal[768]; FILE f; /* open the file and load the palette */ f=fopen("file.pcx","rb"); fseek(f,-768,SEEK_END); fread(pal,1,768,f); fclose(f); /* set the vga palette */ outportb(0x3c8,0); for(i=0;i<768;i++) outportb(0x3c9,pal[i]); This isn't working! Should I be setting the palette some other way? Thanx in advance, -- | David Orme <>< | "Striving for Excellence" | | phreadd AT powerup DOT com DOT au | | | powerup.com.au/~phreadd | "Professional Newbie" |