Date: Sun, 9 Jun 1996 17:41:46 +0200 (IST) From: Eli Zaretskii To: Chris Grubb Cc: djgpp AT delorie DOT com Subject: Re: newbie djgpp putpixel ques. In-Reply-To: <31BA4381.7C6E@ccm.tdsnet.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sat, 8 Jun 1996, Chris Grubb wrote: > I'm new to djgpp, and c in general..but I'm learning..can someone please point out to me what's wrong > with this putpixel routine..when I try to run it, I get a page fault..here's the code Please download the file v2/faq200b.zip and read the DJGPP FAQ list, especially since you are a newcomer to DJGPP. Sections 10.1 and 18.4 there explain how to access the video memory under DJGPP. Specifically, the code below is your problem: > void put_pixel(int color, int x, int y) > { > long *base_address = 0xA0000; > long *memory_address = 0; > > memory_address = base_address + (320 * y) + x; > *(memory_address) = color; > }