Date: Wed, 10 Dec 1997 17:17:43 -0800 (PST) Message-Id: <199712110117.RAA12523@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Fabrice ILPONSE , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Pointer to 0xA000 Precedence: bulk At 11:16 12/10/1997 +0100, Fabrice ILPONSE wrote: >> Olmeca wrote: >> >> > I wanna have a pointer to the address 0xA000, but in Djgpp it's a problem. >> > e.g.: unsigned char *vga=0xA000 (this doesn't work, cause of protected >> > mode) > > I know it exists _djgpp_convential_base_adress() or something like >that. You can do char *videomem=_djgpp_convential_base_adress()+0x0a0000 >and use it as a normal pointer. I saw an example in the Mikmod 2.xx >code. But only if you use nearpointers! This is a hack which lets you access all of memory with a normal pointer. However, it doesn't work on semi-secure systems like Windows NT or Linux/Dosemu. It also makes it all too easy for a bug in your program to destroy the system. IMHO, it shouldn't be used except where speed is *critical* (and even then it's a subject of debate whether it helps). I think the farptr functions for single-byte access and `movedata' for blitting are the best way to go. Nate Eldredge eldredge AT ap DOT net