www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/12/20/01:35:44

Date: Wed, 20 Dec 1995 08:22:35 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Laszlo Vecsey <master AT micro DOT internexus DOT net>
Cc: djgpp AT delorie DOT com
Subject: Re: Pointer to video memory (0xA000)

On 18 Dec 1995, Laszlo Vecsey wrote:

> Help! I get a general protection fault when accessing a pointer to video memory.
> 
> In Borland C++ I'm used to putting pixels to the screen as follows:
> 
> 	unsigned char far *videomemory = (unsigned char far*)(0xA0000000);
> 	videomemory[320*y+x] = color;

Please read the DJGPP FAQ list (available as faq102.zip from the same 
place you get DJGPP), section 10.6, which explains why this won't work 
and gives you a way to do this correctly.  The short answer is that in a 
protected-mode environment you cannot just poke any address, you must do 
it in a way that's compliant with memory-protection mechanism.

- Raw text -


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