Mail Archives: djgpp/1998/08/11/22:15:35
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 -