delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/05/05:03:32

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: using MK_FP in djgpp
Date: Sat, 2 Aug 1997 13:17:13 +0100
Organization: None
Distribution: world
Message-ID: <H3nyZKAJVy4zEw2r@talula.demon.co.uk>
References: <19970801234501 DOT TAA18453 AT ladder02 DOT news DOT aol DOT com>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 24
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Egg brains writes:
>how would i use 
>UCHAR *vga = MK_FP(0xA000, 0);
>in djgpp WITHOUT simulating MK_FP 

This is one of the most commonly asked djgpp FAQ's. Video memory access
is quite different to the way it works in real mode, so there's no real
equivalent to MK_FP. Basically there are two alternative approaches: you
can use far pointer functions with the _dos_ds as a selector (eg.
dosmemput(), movedata(), _farpokeb(), etc, all of which are described in
the info docs), or you can use the __djgpp_nearptr_enable() function to
enable direct access to the video RAM. Which to go for is a matter of
personal preference. The nearptr technique is certainly easier to work
with, but personally I prefer using far pointers because they leave
memory protection enabled and work under all DPMI hosts, while the
nearptr trick doesn't get on well with Windows NT or Linux.

For more info see the FAQ section 10.2, and the tutorial on:
http://www.rt66.com/~brennan/djgpp/


--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
Beauty is a French phonetic corruption of a short cloth neck ornament.

- Raw text -


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