Mail Archives: djgpp/1997/02/23/20:51:21
I am trying to get the VBE implementation to return a VBEInfoBlock, and
VBEInfoBlock is supposed to be 512 bytes long, but the structure I
defined after the VBE 2.0 specs to have 512 bytes (I counted them) is
turning out to be 516 bytes long!
Here's the structure definition (I tried a 'typedef struct' too incase
it made a diff to the compiler, but no cigar).
struct VBEInfoBlock {
char VBESignature[4]; //should be 'VESA', preset to 'VBE2'
char VBEVersion_Minor,VBEVersion_Major;//major and minor version #
char *OEMStringPtr;
char capabilities[4];
short *videoModePtr;
short totalMemory;
short OEMSoftwareRev;
char *OEMVendorNamePtr;
char *OEMProductnamePtr;
char *OEMProductRevPtr;
char reserved[222]; //up to here, adds up to 256 bytes
char OEMData[256]; //and then another 256 = 512
};
Now, if you count out each member it SHOULD add up to 512 bytes but the
compiler seems to be inserting spaces between certain members, the one I
found was betwee 'VBEVersion_Major' and 'OEMStringPtr' it is leaving 2
bytes between them ... why? I don't have optimizations turned on so it
should try to align the data to even offsets, should it?
I even made code that added up the 'sizeof' each element and got 512
bytes, please let me know if you know whats goind wrong here (since all
data after VBEVersion_Major is getting screwed, but before that it
works).
Thanks,
--
... Andrew Delong
______________________________________________________________
Check out my hompage ... Great for graphics & DOS programming
http://www.osha.igs.net/~dandelong/nash.htm
- Raw text -