Mail Archives: djgpp/1996/06/09/10:56:57
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;
> }
- Raw text -