From: Shawn Hargreaves 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: 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 Precedence: bulk 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.