delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/09/26/04:45:35

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Message-ID: <41568173$0$174$cc7c7865@news.luth.se>
From: Martin Str|mberg <ams AT speedy DOT ludd DOT ltu DOT se>
Subject: Re: Strange VESA problem
Newsgroups: comp.os.msdos.djgpp
References: <20040926034158 DOT 24216 DOT 00001082 AT mb-m10 DOT aol DOT com>
User-Agent: tin/1.4.6-20020816 ("Aerials") (UNIX) (NetBSD/1.6Q (alpha))
Date: 26 Sep 2004 08:44:35 GMT
Lines: 32
NNTP-Posting-Host: speedy.ludd.ltu.se
X-Trace: 1096188275 news.luth.se 174 130.240.16.13
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

JBS30000 <jbs30000 AT aol DOT com> wrote:
> I called my VBE info block structure "vesainfo".  For an exaple, using long
> OEM_String_PTR I'll show how I get the string to print.
> I have variables char OEM_String[255]; and short Real_Mode_PTR;
> To get the OEM String pointer:
> Real_Mode_PTR = ((vesainfo.OEM_String_PTR >> 16)  << 4) +
> (vesainfo.OEM_String_PTR & 0xFFFF);
>         dosmemget(Real_Mode_PTR & 0xFFFF, 255, &OEM_String);

You shouldn't have that "&" there before OEM_String. (I think it
works, but it's logically wrong.)

> Now, if I 
> printf("Chipset or OEM              %s \n", &OEM_String);

Again a "&" too much.

> under Windows XP DOS box, it prints out the string, but under pure DOS, it
> doesn't.  Does anybody have any ideas why?  Thanks.

Not really but I'd make OEM_String_PTR unsigned and throw in "&
0xffff" to mask the segment value after shifting it 16 bits to be sure
that you'd get a positive segment offset. (But that might be
unnecessay after you make the variable unsigned.)

Another thing to check is if your call to get "vesainfo" filled in
succeeded or not.


Right,

						MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019