delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/11/22:15:35

From: "Michel Gallant" <mgallant AT NOSPAM DOT grassroots DOT ns DOT ca>
Newsgroups: comp.os.msdos.djgpp
References: <6q8kl0$rjq$1 AT news DOT minn DOT net> <6q8lpr$7h4$1 AT news DOT luth DOT se> <35D0A66D DOT 44848B1C AT unb DOT ca>
Subject: Re: __dpmi_regs defined where?
Lines: 70
Message-ID: <Bm6A1.106$Qi3.545012@sapphire.mtt.net>
Date: Wed, 12 Aug 1998 01:38:41 GMT
NNTP-Posting-Host: 142.177.10.111
NNTP-Posting-Date: Tue, 11 Aug 1998 22:38:41 ADT
Organization: MTT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Endlisnis wrote in message <35D0A66D DOT 44848B1C AT unb DOT ca>...
>Martin Str|mberg wrote:
>
>> minn.net (levity AT minn DOT net) wrote:
>> : I have been looking into supporting 640x480x256 color graphics
and every
>> : code example I have seen uses _dpmi_regs to set the mode.  When I
try to use
>> : this the compiler states that it is "undeclared (first use in
this
>> : function)".  I cannot find any reference to this (object?) any
where and
>> : cannot find its definition.  Can any one point me in the right
direction?
>> It's a type and I think it's declared in go32.h.
>>                                                         MartinS
>
> Nope, it is in <dpmi.h> and remember there are _2_ underscores in
__dpmi_regs.
>
>--


#include <go32.h>
#include <dpmi.h>
//i'm not sure which one you need....

In addition to the above:
I recently had a similar problem with a program I was working on.  For
starters, __dpmi_regs is a structure, not a function.  So it is not
listed in the info files, which annoyingly only list functions.  It is
detailed in the DPMI overview, but this includes only a type
definition and no examples.  Also, a variable must first be
initialised with this structure BEFORE ANY CODE.  Here's how it works
in case I scrambled your brain:

main()
{
//variable to store a register value, in this example, the ax reg.
int value_of_ax;

//initialize a variable with the __dpmi_regs structure; don't
initialize
//with a normal int() or whatever, just use this code
__dpmi_regs MyRegs;


....your code here....


//here's how to use a variable containing this structure:
value_of_ax=whatever you want to put in the register;
MyRegs.ax=value_of_ax;

....call your mode-set program here....

}

And that's it!  I hope I did a good job of explaining this.  I learned
all of this by experience through a really intense debugging
session... hopefully this will be of value to you (and actually solve
your problem!).

Michel Gallant





- Raw text -


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