Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#4367 closed defect (duplicate)

MONKEY: Wrong Palette for Amiga-Versions

Reported by: SF/nolange Owned by:
Priority: normal Component: Engine: SCUMM
Keywords: Cc:
Game: Monkey Island 1

Description

ScummVM Version 13.1 and 14
Game Version: Monkey Island Amiga, German Retail

Palette seems to be slightly wrong to really wrong (yellow->red). See attached pictures which comape it to the WinUAE Output.

Ticket imported from: #2807225. Ticket imported from: bugs/4367.

Attachments (2)

MI.zip (18.8 KB) - added by SF/nolange 10 years ago.
Screenshot from ScummVM and WinUAE
ScummVM_Hack.png (10.2 KB) - added by SF/nolange 10 years ago.
ScummVM with fixed Palette 0-15

Download all attachments as: .zip

Change History (16)

Changed 10 years ago by SF/nolange

Attachment: MI.zip added

Screenshot from ScummVM and WinUAE

comment:1 Changed 10 years ago by SF/nolange

Summary: Wrong Palette for Amiga-VersionsMONKEY: Wrong Palette for Amiga-Versions

comment:2 Changed 10 years ago by SF/quietust

Older versions of Monkey Island 1 Amiga used the actor palette located within the game's resources, which is equivalent to the standard EGA palette (making Guybrush's face and arms noticeably red). Newer versions overrode the palette with a hardcoded one, which I previously extracted as follows (RGB444): 000, 00A, 082, 067, B66, A2A, 852, 777, 333, 25D, 2D4, 0CF, F99, F5F, FF7, FFF

Changed 10 years ago by SF/nolange

Attachment: ScummVM_Hack.png added

ScummVM with fixed Palette 0-15

comment:3 Changed 10 years ago by SF/nolange

Thanks, fixing the lower 16 colors to those values fixed Guybrushs sunburn, but not the color of the flower.
New Pic showing that

comment:4 Changed 10 years ago by SF/ceztko

I was prompted by Kirben to post considerations about palette in amiga scummvm amiga here, so I will do: some years ago, I posted a "bug report" concerning palette here [1]. The post is dated Aug 17, 2003; to summarize, I observed there were micro differences in palette between screenshots taken within scummvm and screenshots taken within a REAL amiga (using MI as the test game). Unfortunately, I wasn't taken seriously by scummvm devs. To summarize their position, they asserted:
1) there were more versions of MI1, some of them were using different palettes, so my screenshot were correct but only for my version of MI1 and not the one scummvm devs used to grab palette;
2) palettes were grabbed testing games in Winuae, so it should have been considered correct for their respective version of the game.

What's the problem? The problem is that in 2005 I discovered a bug about colors produced by Winuae [2] still using MI1 as a test game (links to screenshots are still valid). Toni Wilen, dev of Winuae, confirmed the bug [3] and fixed it in Winuae 1.1 (this is an excerpt from the changelog "OCS/ECS color translation to native colors fixed. (this was bug since the beginning of UAE..) Colors are now slightly brighter. No effect on AGA-mode colors.").

So, what can I assert now? I assert palettes that are used in scummvm for amiga games are all wrong because of that bug, unless you fixed them between 2005 and today using a fixed Winuae version to grab them. Another important consideration -> I still doubt there are multiple versions of MI1: in my opinion, there's only one palette used for various MI1 amiga versions/translations. The palette differences I observed in [1] (screenshots links are still valid :-) are caused by the fact scummvm used a wrong palette taken within a bugged Winuae while my screenshots were taken in a REAL amiga.

[1] http://forums.scummvm.org/archives.php?thread=919739&sid=890cb0d3c415e31169cff5b1db8dd797
[2] http://www.freelists.org/post/uae/Palette-differences-between-real-amiga-and-WinUAE
[3] http://www.freelists.org/post/uae/Palette-differences-between-real-amiga-and-WinUAE,4

comment:5 Changed 10 years ago by SF/nolange

Hmm, how did you take "screenshots" on a real amiga?
If you ripped them out of memory then thats useless, as then you only get the internal 4-4-4 bit representation and the 8-8-8 bit color in those images just depends on the program used.

Note that there are two issues, for one that you have to map 12 to 24 bit color - which cant be solved by taking frames directly from the 12 bit Hardware.
And then there is a softwarebug, or apparently different versions of the software, which cause wrong values - but already in the 12 bit representation.

The later should be definitly fixed, the "correct" 12 to 24 bit mapping is not important -- especially as I dont know what should be taken as reference.
For fixed palette games ScummVM should already use the same values as WinUAE.

comment:6 Changed 10 years ago by SF/ceztko

nolange, how I took the screenshots is totally irrilevant now (but please consider Toni Wilen recognized my screenshots were correct and after the fix in WinUAE, screenshots in it were identical in colors to mine taken in real amiga). The fact is there were a bug in WinUAE: scummvm devs used bugged WinUAE (that produced wrong colors, as I've told you) to discover palette for scummvm games -> unless this is has been fixed between Sepetember 2005 and today, scummvm is now using wrong palette for most if not all amiga scummvm games. Or at least palettes need now a recheck.

comment:7 Changed 10 years ago by fingolfin

Hi ceztko,

thanks for your report. This sounds quite useful.

You say you were not taken serious by scummvm devs back then -- to clarify that, are you sure any scummvm devs were even *aware* of what you said? You only link to a forum post, which still many devs don't read at all (back then *I* certainly didn't read them regularly). And the post you link to was not commented on by any ScummVM dev...

comment:8 Changed 10 years ago by SF/ceztko

Well...I have to admit I'm too much sure scummvm palette are bugged now. I will test colors myself and produce a proper report.

comment:9 Changed 10 years ago by SF/ceztko

fingolfin, I don't remember it well...Anyway, I will do some proper testing with recent build of scummvm and report it here. At the time, I was bit unhappy by the fact people were considering my screenshots wrong when the truth was they had more value that winuae ones.

comment:10 Changed 10 years ago by SF/nolange

Just to make sure you are aware of it, there are 2 problems discussed in the thread:
1) mapping from the Amigas 12bit colors to 24bit
Well, all fixed palettes in ScummVM use the "WinUAE colors". Its different if the game reads the palette from files, as atleast in "Monkey Island" those are 24bit values, ie more than the Amiga can display.
On a real Amiga this means that the 24bit value will be truncated to 12 bit.
On WinUAE it will be truncated to 12 bit aswell and then scaled back to 24bit, losing information from the 24bit source.
On ScummVM the 24bit value will be displayed unmodified.
The best way for ScummVM to handle this is debateable.. since the Amiga-gfx where converted from VGA I would prefer the way its done now. Its more authentic to the source, even if that means output is not similar to WinUAE.

2) ScummVM using wrong colors, as in having bugs in the emulation. Look at the attached pics for reference.
*) Guybrush has wrong colors - fixed by using a hardcoded palette. If hacked this into my branch, but this will mess up all other Amiga games which use a different palette. Note that the colors on Guybrush now match those from WinUAE exactly.
*) Other problems - like the flowers being red instead of yellow. No idea how to fix this yet.

comment:11 Changed 10 years ago by SF/ceztko

WARNING: It seems Winuae is unreliable concerning colors displayed compared to e-uae (unix platform). IMO, there's some Windows platform problem, as e-uae in linux is working as I'm expecting: see comparison between quickgrab.005.png and screen1-euae.png below. Maybe 32bit palette used in window isn't a regular RGB palette like 12bit/24bit ones are, according to [1], or some kind RGB overlay is used by default in Windows and I can't get rid off. So this is my recommendation: don't use Winuae for testing purpose. Use e-uae (morgoth repositories[3]) in a unix enviroment with a 24bit display mode.

@nolange: I realize you opened this bug report to see 2) solved. I wanted to talk with you personally before intervening, but kirben asked me to disccus here, so I did. It seems you are convinced that:
a) is impossible to map amiga native colors, as a 12bit palette is not a subset of a 24bit palette;
b) because of a, accuracy of colors in screenshots taken in a real amiga depend on how a 12bit color is converted in a 24bit color;
c) because of a, accuracy of colors in screenshots taken in a Winuae depend on how Winuae converts a 12bit color in a 24bit color;
d) because of a and b, it's ok to use Winuae as a reference because you trust more Winuae 12bit->24bit conversion;
e) scummvm uses the same 24bit colors that winuae actually (recent versions) displays.

My opinion is that a,d and e are not true:

a) 4096 colors is the OCS theoric palette (even if you could use really the full palette only on HAM mode). According [1]:

(OCS Palette) = 4096 = 2^12 = 2^4 * 2^4 * 2^4 --> 4-4-4 representation
(Truecolor) = 2^24 = 2^8 * 2^8 * 2^8 --> 8-8-8 representation

2^8 / 2^4 = 2^4

Do you want to perform a conversion of the color x = (r,g,b) in a 12bit palette, 4-4-4 representation, to a color y in a 24bit palette, 8-8-8 representation? y = (c * 2^4, g * 2^4, b * 2^4)

The conversion is so easy that it doensn't need any rounding/truncating. Or the conversion is wrong?

d) As of 26 Sep 2005, (Win)UAE was using a bugged 12bit -> 24bit conversion, as I discovered [2];
e) As far as I know, palette that are used NOW in scummvm were grabbed before 26 Sep 2005, so your affirmatation "all fixed palettes in ScummVM use the "WinUAE colors" may have been true before 26 Sep 2005, but it is no more actual.

Now, let pass to something more objective. The following is one of the screenshots I took in 2003:

http://web.tiscali.it/franzo/QuickGrab.005

It's in ILBM format, so probably it stored a 12bit rappresentations of colors (!). This was later converted in png:

http://web.tiscali.it/franzo/quickgrab.005.png

Here is a screenshot taken today in e-uae (any recent build [3]):

http://web.cheapnet.it/imeriopretto/screen1-euae.png

With your favourite tool/app compare numerically the colors. Here are the results I got:

Real Amiga e-uae
(quickgrab.005.png) [screen1-euae.png]

Red (Guybrush's skin) (255,85,85) (255,85,85)
Yellow (the pixel on Gubrush's shoes) (255,255,85) (255,255,85)
Violet (Governor's hat) (170,0,170) (170,0,170)
Brown (Guybrush's hairs) (170,85,0) (170,85,0)
...

There is a 100% match. I'm taking this as a confirm to my suppositions. In a reply to a my question, Toni Wilen wrote me:

> Maybe amiga native screenshots are not paragonable with the grabs taken with winuae? ...
This was with or without AGA? Non-AGA modes should have exact the same colors, even at 16-bit.

--

Now, assuming e-uae and scummvm colors are comparable (and I think they should be, as e-uae IMO doesn't need to do any truncating/rounding), here is a scummvm screenshot:
NOTE: to compare e-uae colors with scummvm, I ran scummvm 1.13.1 in linux, to be 100% sure screenshots are really comparable.

http://web.cheapnet.it/imeriopretto/screen1-scummvm.png

and here is a numeric comparison between e-uae and scummvm colors:

e-uae scummvm 1.13.1
[screen1-euae.png] [screen1-scummvm.png]

Red (Guybrush's skin) (255,85,85) (248,84,80)
Yellow (the pixel on Gubrush's shoes) (255,255,85) (248,252,80)
Violet (Governor's hat) (170,0,170) (168,0,168)
Brown (Guybrush's hairs) (170,85,0) (168,84,0)
...

Why they are different? Because IMO the palette grabbed for scummvm is wrong because a bugged Winuae version was used (and this is the nth times I am repeating this).

To conclude: nolange, is good you want to fix the flower color (I confirm the bug) and be sure Guybrush's face color is ok, but I think I gave you enough hints that palettes used NOW in scummvm need first to be wholly rechecked.
As I told before, these are my recommendations: use e-uae in a 24bit display mode and gimp to grab screenshot. DON'T use Winuae.

[1] http://en.wikipedia.org/wiki/List_of_monochrome_and_RGB_palettes
[2] http://www.freelists.org/post/uae/Palette-differences-between-real-amiga-and-WinUAE
[3] http://morgoth.free.fr/ubports/

comment:12 Changed 10 years ago by SF/ceztko

It Seems "tables" in my previous comment were quite borked by the bug tracker. And I meant 0.13.1 scummvm version, not 1.13.1. Created this forum thread, that is more readable:

http://forums.scummvm.org/viewtopic.php?p=49687

comment:13 Changed 10 years ago by SF/nolange

There is a similar, but more fitting Bug-report for the remaining open issue: MONKEY: Palette glitches in Amiga version - ID: 2838205

comment:14 Changed 10 years ago by SF/nolange

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.