www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/06/22:09:10

Xref: news2.mv.net comp.os.msdos.djgpp:3519
From: brennan AT mack DOT rt66 DOT com (Brennan "Mr. Wacko" Underwood)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Pointers -> memory how ?
Date: 6 May 1996 17:22:58 -0600
Organization: None, eh?
Lines: 29
Message-ID: <4mm1ki$c1o@mack.rt66.com>
References: <Dqr73L DOT Hz1 AT nyongwa DOT montreal DOT qc DOT ca>
NNTP-Posting-Host: mack.rt66.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Thread: Frames, NoFrames, TwoWindows

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.


brennan AT rt66 DOT com  |  fsck /u

- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2014   by DJ Delorie     Updated Aug 2014