Undocumented SCI0 Picture Information for Accurate Rendering
By Brian Provinciano

The SCI interpreter is very picky about the picture's palette, and
it must be properly initiated for use. Have you ever wondered why
Sierra's pictures which only consisted of a single fill were full 
of more than just a colour set and fill command? This is because
unlike the third party rendering software such as SCI Decoder,
the interpreter does not exactly have a default palette. It is all
random. So, though a pic with just a SetColour(0),Fill(x,y) may
fill the screen with black (colour 0), it could also fill it 
with a random colour unless you set the palette.

Now to get to the core of the information.


Setting Palette Colours (0xFE:0x00,0xFE:0x01)
=============================================
The picture files contain palette commands within command 0xFE. One
of them (0x00) sets individual entries in the palette, while another
(0x01) sets an entire palette all at once. One may think that you simply
use one if you want to set a few colours, and the other if you want to 
set many to make the picture most efficient. However, this is not the 
case. They are two different commands which perform different tasks.


1. Initialization
	In order to use the palettes, their colours must all be first set with
	the 0xFE:0x01 command. This must be done for any of the palettes which 
	you plan on using. If you plan on using just one, only one command is 
	needed. If only two, then only two commands are needed, etc.
	
	If the palette is not completely filled, the new colours will be 
	ignored. For example, if you used 0xFE:00 without first 0xFE:01,
	it will do nothing.
2. Palette 3's Specialty
	There are four palettes (0-3). Palette 3 is special. It can be fully used
	as a palette, but can not be drawn with. Only 0xF0+(pal 0-2) work. 
	A 0xF0+(pal 3) can be emulated by simply setting VISUAL_DRAW_ENABLE to off.
	Palette 3 can be used for toggling the colours drawn my 0xF0+(pal 0).
3. Palette 0's Specialty and Locking the Colours
	Palette 0 is the master palette. If the picture is drawn with a specified 
	palette, all colours of palette[0] are drawn with the colour in the 
	active palette's palette unless the colour is locked.
	
	A colour is locked by setting it with 0xFE:00. Any colour set this way will
	stay as it is until changed by another 0xFE:00. Setting a colour with 
	0xFE:01 (all the colours at once) does not lock it.
2. kDrawPic and Specifying a Palette
	The kernel DrawPic() is used to draw a picture to the screen. One of it's
	params specifies the palette to be used when drawing the picture. Here is
	how it draws:
		if the specified palette is 0:
			colours of Pal[0] are drawn with Pal[0]
			colours of Pal[1] are drawn with Pal[1]
			colours of Pal[2] are drawn with Pal[2]
			colours of Pal[3] are not drawn
		if the specified palette is 1:
			colours of Pal[0] are drawn with:
				Pal[1] if only set by 0xFE:01 (not locked)
				Pal[0] is set by 0xFE:00 (locked)
			colours of Pal[1] are drawn with Pal[1]
			colours of Pal[2] are drawn with Pal[2]
			colours of Pal[3] are not drawn
		if the specified palette is 2:
			colours of Pal[0] are drawn with:
				Pal[2] if only set by 0xFE:01 (not locked)
				Pal[0] is set by 0xFE:00 (locked)
			colours of Pal[1] are drawn with Pal[1]
			colours of Pal[2] are drawn with Pal[2]
			colours of Pal[3] are not drawn
		if the specified palette is 3:
			colours of Pal[0] are drawn with:
				Pal[3] if only set by 0xFE:01 (not locked)
				Pal[0] is set by 0xFE:00 (locked)
			colours of Pal[1] are drawn with Pal[1]
			colours of Pal[2] are drawn with Pal[2]
			colours of Pal[3] are not drawn
