www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/20/09:06:50

Message-ID: <330BD7BF.77B4@asan.com>
Date: Wed, 19 Feb 1997 23:49:04 -0500
From: Tom Baehr-Jones <aragorn AT asan DOT com>
Reply-To: aragorn AT asan DOT com
MIME-Version: 1.0
Subject: Re: Djgpp Graphics Programming - far vs near pointer
References: <01bc1560$d66f66c0$1a4f3181 AT workstation> <5effk6$s1o AT news DOT ox DOT ac DOT uk>
Newsgroups: comp.os.msdos.djgpp
Lines: 44
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


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