delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/10/20:19:38

Date: Wed, 10 Dec 1997 17:17:43 -0800 (PST)
Message-Id: <199712110117.RAA12523@adit.ap.net>
Mime-Version: 1.0
To: Fabrice ILPONSE <fabrice AT trash DOT lip6 DOT fr>, djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: Pointer to 0xA000

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



- Raw text -


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