www.delorie.com/djgpp/v2faq/faq082.html | search |
| Previous | Next | Up | Top |
0xa0000
, but my program crashes with SIGSEGV... Q: How can I access the text-mode video memory of my VGA?
_farpeekb
and _farpokew
; they are described in the C Library reference. See more details on using "farptr" functions to access absolute addresses in low
memory, below.
For text-mode screen updates, you can use the ScreenUpdate
and ScreenUpdateLine
library functions to quickly update the screen from a text buffer.
Using the _farpeekX/_farpokeX
paradigm to access memory isn't much slower than direct access (they compile into 2 machine instructions when optimizations are enabled). But if you need
even faster access (and don't want to write it in assembly), see using the "nearptr" access facilities, as described below.
If your video card supports the VBE 2.0 standard, you can access the linear frame buffer as a normal array in memory. For an example of such a technique, see the VBE example code by Charles Sandmann. You can also reach this file via the Web. Some examples of how to access video memory from DJGPP programs are available from Brennan Underwood's Web page.
webmaster donations bookstore | delorie software privacy |
Copyright ⌐ 1998 by Eli Zaretskii | Updated Sep 1998 |
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)