From: jerry AT eteklabs DOT nospam DOT com (Jerry Lawrence) Newsgroups: comp.os.msdos.djgpp Subject: Re: far pointers using djgpp Date: Wed, 17 Jun 1998 17:28:50 -0400 Message-ID: References: <35881d34 DOT 2869157 AT news DOT unisys DOT com DOT br> Organization: e-Tek Labs NNTP-Posting-Host: dial-dominion-19.netacc.net Lines: 49 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article <35881d34 DOT 2869157 AT news DOT unisys DOT com DOT br>, brunobg AT geocities DOT com says... > On Tue, 16 Jun 1998 14:12:23 GMT, Butler Owen scm2211 > wrote: > > >I would like to create a pointer to my VGA cards memory. I know this > >starts at 0xA000,0000 > >in another compiler I would use: > >char far *screen= (char far *) MK_FP(0xa000,0); > >problems arise: > >1. djgpp does not support the "far" keyword > >2. the implementation of "dos.h" that comes with djgpp does not contain > >MK_FP() > >if I try this: > >char * screen = (char *) 0xa0000000; > >it compiles fine, then crashes at the point I try and set anything through > >this pointer. > >Any suggestions? > > You need to use the _far* functions... Here is a little tutorial I wrote. It's > basic, but once you understand far pointers in DJGPP it's easy to go deeper. Hope > it helps, any questions, please email me. > > -----------cut---------- > Far pointers and DJGPP > Or, you could do this: (can't remember where i got the info from) 1) store a local ram buffer of the screen buffer; do all screen operations to this buffer. 2) in your graphics init function, use this right after you change screen mode: __djgpp_nearptr_enable(); 3) in your graphics deinit function, use this: __djgpp_nearptr_disable(); 4) when a full screen buffer is ready to be displayed: memcpy( (unsigned char *) (0xa0000+__djgpp_conventional_base), (buff),320*200); where "buff" is a 64k buffer (assuming 320x200x256 color) i think i got this info from a link off the djgpp homepage -j