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

From: frenchc AT cadvision DOT com (Calvin French)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: HELP! Unidentifiable error, may be null pointer bug
Date: 26 Jul 1997 19:50:11 GMT
Organization: CADVision Development Corp.
Lines: 90
Message-ID: <5rdkdj$1k20@elmo.cadvision.com>
References: <5r3k0n$chb$1 AT excalibur DOT flash DOT net>
NNTP-Posting-Host: ts7ip234.cadvision.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <5r3k0n$chb$1 AT excalibur DOT flash DOT net>, kwe1 AT flash DOT net says...
It seems like you're using C; mainly I do C++ but I'll try to help...

/void setpalzero ()
/{
/   int i;
/   COLOR *temp;
/   for (i = 0; i < 256; i++)
/      temp[i].red = temp[i].gre = temp[i].blu = 0;
/
/   SlamPal (temp);
/}

Are you allocating memory for temp? Can't be sure, but should you do: COLOR* 
temp = new COLOR[256] (in C++, in C it might be COLOR* temp; <crlf> temp = 
malloc( sizeof(COLOR) * 256): I think...)

/void main ()
/{
/   setvideo(0x13);
/
/   /*byte *waitpic = "wait.pcx";
/   byte *waitimg;
/   COLOR *palw;
/   PCXheader headw;*/
/   int wth, wth2;
/   /*LoadPCXinfo(waitpic, &headw, palw);
/   wth = (headw.xmax - headw.xmin + 1) * (headw.ymax - headw.ymin + 1);
/waitimg = malloc(wth);
/        LoadPCX(waitpic, waitimg, &headw, palw, 1);
/   setpalzero ();
/        dosmemput (waitimg, 64000, 0xa0000);
/   fromblack (palw);*/
/
/   byte *file1 = "art5.pcx", *file2 = "art3.pcx";//, *file3 = "art1.pcx";
/   byte *image1, *image2;//, *image3;
/   COLOR *Pal1, *Pal2;//, *Pal3;
/   PCXheader head1, head2;//, head3;
/
/   LoadPCXinfo(file1, &head1, Pal1);
/   wth = (head1.xmax - head1.xmin + 1) * (head1.ymax - head1.ymin + 1);
/image1 = malloc(wth);
/   LoadPCXinfo(file2, &head2, Pal2);
/   wth2 = (head2.xmax - head2.xmin + 1) * (head2.ymax - head2.ymin + 1);
/image2 = malloc(wth2);
/   /*LoadPCXinfo(file3, &head3, Pal3);
/   wth = (head3.xmax - head3.xmin + 1) * (head3.ymax - head3.ymin + 1);
/image3 = malloc(wth);*/

Looks to me that you aren't allocating memory for your palettes, I don't 
know for sure though...

/        LoadPCX(file1, image1, &head1, Pal1, 0);
/   LoadPCX(file2, image2, &head2, Pal2, 0);
/   /*LoadPCX(file2, image2, &head2, Pal2, 0);
/   LoadPCX(file3, image3, &head3, Pal3, 0);
/
/   toblack (palw);
/   free (waitimg);*/
/
/   setpalzero(); //remember to comment setpalzero when the bugs are gone
/   dosmemput (image1, 64000, 0xa0000);
/   //SlamPal(Pal1);
/   fromblack(Pal1);
/   delay (500);
/   toblack(Pal1);
/
/
/   /*dosmemput (image2, 64000, 0xa0000);
/   SlamPal (Pal2);
/   fromblack(Pal2);
/   delay (100);
/   toblack(Pal2);
/
/   free (image1);
/   free (image2);
/   free (image3);*/
/
/   setvideo (0x03);
/}
/
/
/Please help me! This is my last resort... I've been troubleshooting this
/one program for about a week, and I have no idea what to do. Please reply
/by e-mail kwe1 AT flash DOT net .

Good luck!!!

- Calvin -

- Raw text -


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