Mail Archives: djgpp/2001/06/29/01:45:13
> I have a game which accesses VGA memory (A000:0000) directly. In 16-bit
> mode, that's ok, but to get it to run under DJGPP I either have to rewrite
> the thing or map VGA memory to linear memory. There is a function to do
> that, but I can only do it with a DPMI 1.0 server.
If you only plan to run under DOS, and use CWSDPMI, this feature is
available. But I don't recommend using it because of the portability
reasons.
> Is there a way to accomplish the same thing (i.e. direct linear access to
> A000:0000 from my ds selector) with a DPMI 0.9 server? Right now I'm looking
> at the following options, and neither of them look good:
>
> 1. Use __djgpp_nearptr_enable(). The documentation recommends against this,
> and considering that I just overhauled a number of asm files and am aware of
> a number of bugs already, I'm not so sure I like the thought of being able
> to kill my system.
Just try it. You probably won't kill the system - that's the worse case.
If worried you could do another method first, then fall back to near pointers
which are portable to everything except Windows NT type platforms.
> 2. Use function 02h to map the segment to a descriptor, use function 06h to
> locate the linear base of the descriptor, then use functions 07h and 08h to
> modify my ds segment so I can read that linear address.
No, use sys/farptr.h instead. Best solution. Check the FAQ.
> Is there any way to do it directly, or is there a DPMI 0.9 server which
> supports function 0508h (map device -> linear)?
CWSDPMI (if DOS only). dosmemget/dosmemput functions in the library.
near pointers. far pointers. 4 different ways, which ever you are most
comfortable. Have fun.
- Raw text -