[GEM Development] Today I Learned

John Elliott jce at seasip.demon.co.uk
Sat Feb 25 14:25:01 PST 2012


> For 16 color (or colour(?), in UK English) modes, I thought there was one, =
> and only one, set of 16 for ALL computers - not JUST versions of GEM. Those=
>  16 were THE same established ones for TI-99/4a, Apple II's., IBM CGA, EGA,=
>  and VGA, AND Macintoshes. (It was something like "native" choices. They MI=
> GHT not LOOK the same (or be) BUT the video chip WOULD BE making THE same a=
> ssignments for ANY system.)
> 
> It was when one 'went to' 256 colors that "variety" became an "issue". Is T=
> HIS what you're commenting upon? 

  No. This behaviour is present in any driver where the red/green/blue 
assignments of the colours onscreen can be changed. For example, EGA 640x200
mode has a palette of 16 colours and all 16 can be displayed on the screen. 
But because the EGA has palette registers of a sort, it's possible to use 
vs_color() to make all red pixels on the screen go green with one function 
call:

	WORD rgb[] = { 0, 1000, 0 };
	vs_color(vdi_handle, RED, rgb);

  The problem is that if this change is made by one program, and a second
program then asks 'what RGB values does the RED pen have?' the values 
returned will be { 1000, 0, 0 } not { 0, 1000, 0 }.

-- 
John Elliott


More information about the gem-dev mailing list