| www.delorie.com/archives/browse.cgi | search |
| From: | Elliott Oti <e DOT oti AT stud DOT warande DOT ruu DOT nl> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Direct access to VGA memory |
| Date: | Tue, 24 Sep 1996 11:52:46 -0700 |
| Organization: | Academic Computer Centre Utrecht, (ACCU) |
| Lines: | 22 |
| Message-ID: | <32482DFE.E2A@stud.warande.ruu.nl> |
| References: | <5290et$g40 AT pulp DOT ucs DOT ualberta DOT ca> |
| NNTP-Posting-Host: | warande1078.warande.ruu.nl |
| Mime-Version: | 1.0 |
| To: | B Hodge <bhodge AT gpu5 DOT srv DOT ualberta DOT ca> |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
B Hodge screamed in despair:
>
> I recal someone discussing it a few weeks ago on the mailing list, but
> what is the way to access the VGA memory directly using a pointer and not
> the _farpoke and _farpeek commands?
#include <sys/nearptr.h> // gotta include this
void main()
{
char *screen; // this is gonna grow up into a pointer to display memory
__djgpp_nearptr_enable(); // turn off memory protection
screen = (char *)(0xa0000 + __djgpp_conventional_base); // set screen to video
// memory base
/* Do whatever ya want with screen here */
__djgpp_nearptr_disable(); // turn memory protection back on
}
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |