Mail Archives: djgpp/1996/10/16/19:24:00
> > What would the correct order of the
> > seg:offset in the Vesamode variable be: is it HiWord = Segment, LoWord ==
> > Offset, or the other way around?
> Usually, if the far pointer is a 32-bit int, its higher 16 bits are the
> segment and lower 16 bits are the offset.
Bascially, this is right... :) But its still kinda strange how it is
stored. The segment (4 bits) is stored in the most significant bits of
the first data _word_ and the offset is stored in the second _word_. The
VESA mode specs stats that you have to declare the pointer as a long,
or 4 bytes.
To get the correct address you need to do something like:
In your structure, have:
unsigned long VesaModeList;
In your program have:
unsigned int DosAddress;
DosAddress = ((VesaModeList & 0xFFFF0000) >> 12)
| (VesaModeList & 0xFFFF);
Leathal.
- Raw text -