It's wonderful how many times I changed opinion in this couple of days. Let's try to summarize positions and facts:LogicDeLuxe wrote:The sprites use the EGA graphics in the Amiga version while the backgrounds have 32 colors. Now, there are two different versions of the Amiga executable.
In most frequent display modes, amiga is able to display a maximum of 32 colours chosen from a palette of 4096.
Amiga version of Monkey Island 1 stores two kinds of objects for graphics:
- backgrounds;
- sprites.
Each pixel of a background is stored using a 12bit representation of the colour. Backgrounds use a maximum of 32 colours, so the amiga display mode is respected. This does mean there exist an implicit 32 colours palette for backgrounds, and there's no need to hardcode it in scummvm: the 12bit colour will be drawn in the surface SDL exposes.
Each pixel of a sprite is stored using a 4 bit bit representation of the colour. This does mean sprites use a maximum of 2^4=16 colors. This is done to save space, as sprites are many more than backgrounds. This 4 bit colour must be mapped to the 2^12 = 4096 colours palette of the OCS chipset in the amiga. To do this, an explicit 16 positions map table is stored on the MI1 executable. Still, the total sum of background plus sprite colours must not be over 32.
Having an hardcoded map table in the MI1 executable means it must be implemented in scummvm as well: the sprite palette is stored in engines/scumm/palette.cpp source file as 24bit colours (8-8-8 representation).
Whatever scummvm must draw a background or sprite pixel, the final output will be 16bit as scummvm use a 16bit SDL surface, so there can be a little loss of accuracy (but not easy noticeable) in the final colours displayed. This because of the 12bit->16bit conversion for backgrounds and 24bit->16bit rescale for sprites.
It seems there are 2 executable versions, with different sprite palettes:
- mine, that is the same of the EGA sprite palette;
- nolange's one, that is the same of old 16 colours amiga scumm games (Zak and MM).
There's no reason that one should be prefered in favor of another, so probably they should be both implemented.
After these considerations, there is a strange bug with the colour of the poisoned flower in the forest. Some parts of the screens in the forest are randomly generated at runtime but the screen with the poisoned flower (the one you can actually pick up) should have a constant appearance with the flower of a yellow colour. The bug manifests in BOTH (nolange's and mine) sprite palette versions, causing the flower to be red instead.
(correct poisoned flower screen, EGA sprites palette)
(bugged poisoned flower screen, EGA sprites palette)
(correct poisoned flower screen, scumm V2 amiga games sprites palette)
(bugged poisoned flower screen, scumm V2 amiga games sprites palette)
Actually is unknow what is causing the poisoned flower colour bug. It could be something related to:
- sprite palette;
- random generated forest algorithm (md5 don't agree the algorithm is related to this bug while logicdeluxe is opened to this interpretation);
- graphichs engine of scummvm;
- others parts of scummvm.
If there's something wrong in what I've just wrote, please tell me so I will fix this post.