Mail Archives: djgpp/1996/05/06/22:09:10
In article <Dqr73L DOT Hz1 AT nyongwa DOT montreal DOT qc DOT ca>,
Don Karnage <dunder AT nyongwa DOT montreal DOT qc DOT ca> wrote:
>
>How can I make pointers -> memory :P Meaning, how can I make pointers
>pointing to specific memory locations without dropping out of the protected
>mode in DJGPP ?
>
>Like, perhaps, mapping the video Screen directly with an array char[4000] or
>int[2000] !!!
>
>I'd want to have an adressable array pointer to ScreenPrimary so it can be
>compatible with my other programs...
If you call __djgpp_nearptr_enable() and it is successful you can access any
linear address below the 1meg mark via the following calculation:
(linear_ptr << 4) + __djgpp_conventional_base;
i.e. 0xa0000 + __djgpp_conventional_base for a pointer to VGA memory.
If it's above 1meg, you must map it in, I believe. Check out vbe.zip by
Charles Sandmann, also available on my web page.
http://www.rt66.com/~brennan/djgpp/
--brennan
--
brennan AT rt66 DOT com | fsck /u
- Raw text -