Mail Archives: djgpp/1997/02/20/09:06:50
George Foot wrote:
>
> Louis Antoine (lantoine AT ic DOT sunysb DOT edu) wrote:
> : I am hoping that someone can answer these questions on accessing the video
> : memory under djgpp. I have read a lot of intro to graphics programming
> : material for Djgpp and found that all of them basically state that
> : accessing the memory with near pointers is faster although it disables
> : memory protection.
>
> : QUESTIONS
>
> : (1). Will disabling memory protection affect my operating system which is
> : running in protected mode? ( Windows 95, OS/2, etc. )
>
> : (2). Is there an alternative method to accessing the video memory with the
> : speed of the near pointer but without disabling memory protection?
>
> : (3). Watcom compiler provides a near pointer to the video memory while in
> : protected mode. Does it disable memory protection as well? If not, is it
> : possible to use the same methods used by this compiler under Djgpp to
> : access the video memory?
>
> : Thanks To Anyone Who Responds.
>
> --
> --
> George Foot <gfoot AT mc31 DOT merton DOT ox DOT ac DOT uk>
> Merton College, Oxford.
Definately use near ptrs. They are faster, and easier too. Personally, I
have never used DJGPP near ptr function that gives access to all memory.
Instead, I use the __dpmi_map_physical_address() function to map the
physical address of the video buffer (for vga 320x200x256 this is
0xA0000 I think) to an allocated block in my ds. Then it can be accessed
locally. The same goes for the svga banked modes and the new linear
frame buffer in VBE 2.0. I have used all of these under windows 95 and
dos, and have never run into any problems (that weren't bugs in my code
anyway)
- Raw text -