[comp.sys.ibm.pc] EGA: How do I find the values of the colour registers?

datanguay@watdaisy.UUCP (05/14/87)

In EGA Bios ram there is a pointer at 0040:00a8 which points to a table
of pointers. The second of these pointers points to a buffer into which
the values for the palette registers will be saved. How do I get bios
to do the save? I have tried setting up my own pointer table (by changing
the pointer at 04:00a8 to another set of pointers with my own values) and
then setting a register. I also tried int 10h ah=12h bl=10 (both hex and
decimal), which is a call to return ega info.

David Tanguay

apn@nonvon.UUCP (05/17/87)

in article <8314@watdaisy.UUCP>, datanguay@watdaisy.UUCP says:
> 
> In EGA Bios ram there is a pointer at 0040:00a8 which points to a table
> of pointers. The second of these pointers points to a buffer into which
> the values for the palette registers will be saved. How do I get bios
> to do the save? I have tried setting up my own pointer table (by changing
> the pointer at 04:00a8 to another set of pointers with my own values) and
> then setting a register. I also tried int 10h ah=12h bl=10 (both hex and
> decimal), which is a call to return ega info.
> 
> David Tanguay

assume hex

How about using int 10, ah=10,al=0,bh=color value, bl=palette register
or if setting all of them then try
int 10, ah=10, al=2, es:dx = segment:offset of color list
which is 17dec bytes
0-f are color values to be loaded to palette registers 0-f
byte 10 is the new border value color register.

Alex P Novickis
707 575 9616

UUCP: {ihnp4,ames,qantel,sun,seismo,amdahl,lll-crg,pyramid}!ptsfa!nonvon!apn

{* Only those who attempt the absurd   ...   will achieve the impossible   *}
{* I think... I think it's in my basement... Let me go upstairs and check. *}
{*                                                      -escher            *}

datanguay@watdaisy.UUCP (05/17/87)

In article <317@nonvon.UUCP>, apn@nonvon.UUCP (root) writes:
> in article <8314@watdaisy.UUCP>, datanguay@watdaisy.UUCP says:
> > 
> > In EGA Bios ram there is a pointer at 0040:00a8 which points to a table
> > of pointers. The second of these pointers points to a buffer into which
> > the values for the palette registers will be saved. How do I get bios
> > to do the save? I have tried setting up my own pointer table (by changing
> > the pointer at 04:00a8 to another set of pointers with my own values) and
> > then setting a register. I also tried int 10h ah=12h bl=10 (both hex and
> > decimal), which is a call to return ega info.
> > 
> 
> How about using int 10, ah=10,al=0,bh=color value, bl=palette register
> or if setting all of them then try
> [....]

Oops. Sorry for the lack of clarity, but I want to *read* the values of the
palette registers, not write them. Thanks...

David Tanguay

apn@nonvon.UUCP (root) (05/18/87)

in article <8320@watdaisy.UUCP>, datanguay@watdaisy.UUCP says:
>> How about using int 10, ah=10,al=0,bh=color value, bl=palette register
>> or if setting all of them then try
>> [....]
> 
> Oops. Sorry for the lack of clarity, but I want to *read* the values of the
> palette registers, not write them. Thanks...
> 

	That one is a bit tougher. The EGA card you have is probably based
on the C&T chip set.   DId you say you would like to be hardware independant 
on this ?? (*laugh* *cough*)   One way to do it independantly is to write
a system "extension"  and filter all int 10 calls and trap the useful infor-
mation and keep around in ram somewheres. Then just jump to where the old
int 10 went to. This is the only system/hardware independant way that I found.
Now for some hardware dependent methods:
C&T chipset : no way!! palette registers are W/O (write only)
paradise chipset  : roumor is that it is possible 

Possible help:  Some mouse drives do the above for you... lets see who:

logitech : Yes, ega functions can be done through logitech
microsoft : Yes, ........... (same).....,.................
             however, since m/s 's drivers are not written by them
	    I am not sure if the version they are now shipping does this
            or not... It is certainly not in their application note. 
	    After talking to the people that write their drivers I 
	    concluded that (see note below) it was a very new feature
	    and may only be in house as of 1/87
contriver: no way. This driver does not even know about EGA cards
           (or pretend to!!)


In either case, it may be easier to do the stuff youself and not
bother with the 3 zillion versions of mouse drivers around.


(note: as promised up above somewheres)
  I contacted the driver people a while back because I was in a position
of needing a much-more-flexible-than-what's-available driver written for
a new (and actually working and available) pointing device. I'm still
writting it, after 2 months and plan to make it public domain unless you
are one of the above mentioned  companies (*evil grin*)



Alex P Novickis
Fulcrum Consulting


UUCP: {ihnp4,ames,qantel,sun,seismo,amdahl,lll-crg,pyramid}!ptsfa!nonvon!apn

{* Only those who attempt the absurd   ...   will achieve the impossible   *}
{* I think... I think it's in my basement... Let me go upstairs and check. *}
{*                                                      -escher            *}