Date: Sun, 5 Oct 1997 22:31:15 -0700 (PDT) Message-Id: <199710060531.WAA06446@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: "Alex Barsamian" , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Yet another graphics problem... Precedence: bulk At 01:28 10/5/1997 -0600, Alex Barsamian wrote: > I started out tonite porting my crusty mode 13h real mode graphics code out >to djgpp. I can init the graphics mode okay, even write to the screen >without too much trouble. Now for some reason when I began to implement the >double buffer routines into the new source file, I compile without any >trouble, but about 1/4 of the time, when I should be seeing a PCX image, I >see a blank screen (in graphics mode), and the rest of the time I get a >lovely page fault. Have you tried symifying it? That's often helpful in finding crashes. Also, fsdb can debug graphics programs, and IIRC so can RHGDB. Something else I noticed follows. [lots deleted] >// get a pcx, skipping most unnecessary stuff that can be assumed >// e.g., size (for now 640x480 pcx's are all i'll use, 8 bpp, etc. >// I know this is far from portable but this is just to get this thing >// rolling > >unsigned char *load_pcx(char *filename) >{ [ /* ... deleted ... */ ] > width = -(getw(f)); /* xmin */ > height = -(getw(f)); /* ymin */ > width += getw(f) + 1; /* xmax */ > height += getw(f) + 1; /* ymax */ I'm afraid I don't know what the PCX format is, but are you sure these are supposed to be 32-bit values? getw reads an int, which is 32 bits on DJGPP, but 16 on most other DOS compilers. If they *are* 16-bit values, use fread and a `short'. That could be a porting issue that slipped by. If I'm wrong, sorry for giving bad advice :) Nate Eldredge eldredge AT ap DOT net