Mail Archives: djgpp/1997/07/31/23:04:02
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 -