Mail Archives: djgpp/1998/06/17/20:17:07
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 <s9708172 AT tiger DOT vut DOT edu DOT au>
> 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
- Raw text -