Mail Archives: djgpp/1997/08/05/05:03:32
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 -