www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/31/23:04:02

From: phreadd AT powerup DOT com DOT au (David Orme)
Newsgroups: comp.os.msdos.djgpp
Subject: URGENT! repost: palette problems, please help.
Date: 31 Jul 1997 11:48:34 GMT
Organization: Power Up
Lines: 36
Message-ID: <5rpu2i$40p$1@grissom.powerup.com.au>
Reply-To: phreadd AT powerup DOT com DOT au
NNTP-Posting-Host: ts1608.powerup.com.au
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I'm displaying PCX files to the screen in VESA mode 0x101 (640x480x256, all 
calls being VESA 1.2 for convenience). 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]);


PLEASE! Why isn't this working? It seems pretty straight forward, but 
there's a glitch somewhere. I have posted this before, but I didn't get a 
response, and I really need this for uni.

Your help is very appreciated.


-- 
|  David Orme                 <><   |  "Striving for Excellence"  |
|  phreadd AT powerup DOT com DOT au           |                             |
|  powerup.com.au/~phreadd          |    "Professional Newbie"    |

- Raw text -


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