[comp.sys.mac] Cloning MacII color displays

summer@rhea.trl.oz.au (Mark Summerfield - Switching) (12/28/89)

I wonder if someone can help me out...

We have here two fairly similar Mac II's, which we wish to use for a
color image transfer demonstration. In the past we have been using
Mac+'s, in black and white, and I am currently upgrading the demo to
include color. I am doing as much as I can 'legitimately', however since
it is of paramount importance that the demonstration graphically show the
transfer rate, the actual contents of the screen memory is transferred
directly from one machine to the other. Since we will always know the
configuration of both machines, and be able to control it, this is OK
for us.

My problem is duplicating the colors on the receiving machine. What I am
currently doing is this:
	On the transmitting machine I establish the characteristics of
	the display by extracting them from the GDevice record obtained
	from getMainDevice. These include the pixel depth, the bounds
	of the display, and the address of the screen buffer. I then
	extract the color table from the GDevice's pixMap, and transmit
	it to the receiving machine (along with some other display
	characteristics).

	The receiving Mac then establishes its own display
	characteristics in like manner, and checks that it is compatible
	with the incoming data. If it is, it opens a window the size of
	the entire display (thus ensuring that after we mess up the
	display with the new image, we can close the window, and allow
	the original contents to redraw themselves). I then attempt to
	set the palette from the new color table by converting it from
	a GDevice color table to a PixMap color table (by clearing the
	high bit of ctFlags); assigning it a new CTSeed (using
	GetCTSeed); then I use NewPalette, SetPalette and
	ActivatePalette to assign the palette to my window.

When the image arrives, it is quite obvious that the correct SET of
colors is being used, but that they are being mapped incorrectly (for
example, if a digitized photo of a woman's head is sent, most of the
colors are skin tones, but they are all in the wrong places!)

How can I completely clone the palette of a color Mac? The program works
perfectly if I select 2 colors, or 2 grays from the Monitors control
panel accessory.

Thanks in advance...

Mark Summerfield
Telecom Research Laboratories (Australia).

=========================================================================
"You mean, spell 'bolour' with a 'k'?
 Kolour! Oh yeah, never thought of that! What a silly bunt!"
					- Monty Python.
=========================================================================