Mail Archives: djgpp/1997/12/10/20:19:38
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 -