Mail Archives: djgpp/1997/01/16/20:10:14
In article <19970110 DOT 151040 DOT 8799 DOT 0 DOT chambersb AT juno DOT com>, chambersb AT juno DOT com (Benjamin D Chambers) writes:
|> On Thu, 09 Jan 1997 20:40:57 GMT genocide AT praxis DOT net (GENOCiDE) writes:
|> >Ok, in my struct, there is a pounter called VideoModePtr;
|> >
|> >struct VbeInfoBlock {
|> > ....
|> > unsigned *VideoModePtr;
|> > ....
|> >};
|> >
|> >I should be able to retrieve all the video modes by using:
|> >
|> >VbeInfoBlock vbeinfo;
|> >unsigned *p;
|> >for (p=vbeinfo.VideoModePtr; *p != (unsigned) -1; p++) {
|> > printf("Mode: 0x%x\n", *p);
|> >}
|> >
|> >this works under regular ANSI C, why doesn't work here? is it because
|> >of protected mode? Please help me!
|> The address returned is a RM address. You need to convert it to a PM
|> address (I believe with _dos_ds, the FAQ explains how to do this.)
Just do a "dosmemget" into your program memory...
And you better use a "short unsigned *" for the modelistpointer- DJGPP is a 32bit-compiler!
Bye,
Andree
- Raw text -