delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/16/22:23:18

Date: Sun, 16 Nov 1997 19:21:51 -0800 (PST)
Message-Id: <199711170321.TAA02309@adit.ap.net>
Mime-Version: 1.0
To: killferfun AT aol DOT com (KillFerFun), djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: General Protection Fault

At 10:15  11/14/1997 GMT, KillFerFun wrote:
>I made this program by combining two of the Allegro examples, 2 and 15 I
> believe. While the two examples seperately work fine on my computer, when
> combined in this fashion, I get a GPC. Ive even gotten General Page Faults
> when I use a BMP file. 
>
>The program gives me the desired results. It puts a 20x20 piece of the image
> all over the screen, then waits for a keypress, and then the whole computer
> goes idle, and a cold boot is nessecary. 
>
>Could someone PLEEZE help me out? What am I doing wrong? Much appreciated....
[snipped]
>   PALLETE *the_pallete;
[snipped]
>   the_image = load_bitmap(argv[1], the_pallete);
Either you need to have `the_pallete' point at some valid memory in which
the pallete can be stored, or declare it as `PALLETE' and not `PALLETE *'.
>   exit(0);
You don't restore text mode at the end. I'm not sure if Allegro does it
automatically on exit, but it's not a bad idea to do it explicitly.

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


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