Opened 6 weeks ago

Closed 2 weeks ago

Last modified 2 weeks ago

#13627 closed defect (fixed)

SCUMM: CGA rendering isn't working correctly across all games

Reported by: eriktorbjorn Owned by: athrxx
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game:

Description (last modified by eriktorbjorn)

This bug report sprang from a failed attempt at adding correct CGA rendering for SCUMM v1 games. See https://github.com/eriktorbjorn/scummvm/tree/scumm-v1-dither for details.

Basically, ScummVM doesn't support CGA mode for v1 games at all, i.e. the early Maniac Mansion and Zak McKracken.

But even for games where we support CGA mode, it's not always correct.

For instance, take Maniac Mansion v2. The faces on the character selection screen are supposed to have stripes. But if I fix that, they have stripes in-game as well, which they apparently shouldn't have. I have a feeling it has something to do with actor palettes?

The text color on the character selection screen is incorrect as well. We have some sort of text color translation in place, but perhaps it's for a different game?

And in DOSBox, all games that I've been able to test use a brighter version of the CGA palette. Maybe ScummVM should have an option for that?

DOSBox:


ScummVM:


Attachments (5)

maniac-dosbox.png (27.2 KB ) - added by eriktorbjorn 6 weeks ago.
maniac-scummvm.png (21.9 KB ) - added by eriktorbjorn 6 weeks ago.
2022-07-09 (1).png (25.1 KB ) - added by athrxx 2 weeks ago.
dosbox-composite.png (35.1 KB ) - added by eriktorbjorn 2 weeks ago.
maniac-composite.png (16.1 KB ) - added by eriktorbjorn 2 weeks ago.

Download all attachments as: .zip

Change History (17)

by eriktorbjorn, 6 weeks ago

Attachment: maniac-dosbox.png added

by eriktorbjorn, 6 weeks ago

Attachment: maniac-scummvm.png added

comment:1 by eriktorbjorn, 6 weeks ago

Description: modified (diff)

comment:2 by athrxx, 2 weeks ago

Owner: set to athrxx
Resolution: fixed
Status: newpending

I think I managed to fix the bug, please test whether this is now satisfactory.

comment:3 by GermanTribun, 2 weeks ago

Quick question: I just occurred to me, but does ScummVM support Composite CGA for the games that use it (like Maniac Mansion)?

by athrxx, 2 weeks ago

Attachment: 2022-07-09 (1).png added

comment:4 by eriktorbjorn, 2 weeks ago

The bits I've tried of Maniac (v1/v2) and Zak (v2) in CGA mode looked fine to me.

I'll let athrxx answer the Composite CGA question. All I can see is that there is such a mode in ScummVM, but it only appears to apply to the v1 games, not v2. (And I can't really compare it to DOSBox, since DOSBox seems to also do some colour blending thing?)

comment:5 by athrxx, 2 weeks ago

Yes, CGA composite works for MMv1 and ZAKv1.

I didn't get the DOSBox color blending thing for CGA mode, but I did notice that in Hercules mode. It looks good, but really doesn't make pixel comparison exactly easy... No idea if/how you can turn that off. I didn't set any filter/scaler and it still did that...

comment:6 by athrxx, 2 weeks ago

Status: pendingclosed

in reply to:  5 comment:7 by eriktorbjorn, 2 weeks ago

Replying to athrxx:

I didn't get the DOSBox color blending thing for CGA mode, but I did notice that in Hercules mode. It looks good, but really doesn't make pixel comparison exactly easy... No idea if/how you can turn that off. I didn't set any filter/scaler and it still did that...

I was told that pressing F12 in CGA mode switches DOSBox to composite mode (you may have to press it more than once, since I think there are more than two states?), and that does some colour blending for me that's further affected by other settings. I don't know.

As you say, that makes it hard to tell if ScummVM does it correctly.

comment:8 by athrxx, 2 weeks ago

Interesting. If you just want to enable the composite CGA in MM or ZAK, you have to press Shift-P. Then you can compare the pixels.

I don't think normal DOSBox allows any hardware emulation for it (if there actually is such a thing). F12 does nothing for me. And we certainly do not have any filters or similar things either.

comment:9 by athrxx, 2 weeks ago

Maybe all there is to it, is translating the 4-color patterns into colors like this:

https://en.wikipedia.org/wiki/Color_Graphics_Adapter#/media/File:CGA_CompVsRGB_320p1.png

Hmm, really interesting, that would not be much of a difficult thing to do...

Last edited 2 weeks ago by athrxx (previous) (diff)

comment:10 by GermanTribun, 2 weeks ago

Also interesting:

https://www.youtube.com/watch?v=niKblgZupOc

This video about CGA also shows what Maniac Mansion V2 is supposed to look in both modes (normal and composite) on real hardware. OK, Composite is really blurry, but at least we do get an idea about the colors.

by eriktorbjorn, 2 weeks ago

Attachment: dosbox-composite.png added

by eriktorbjorn, 2 weeks ago

Attachment: maniac-composite.png added

in reply to:  8 comment:11 by eriktorbjorn, 2 weeks ago

Replying to athrxx:

I don't think normal DOSBox allows any hardware emulation for it (if there actually is such a thing). F12 does nothing for me. And we certainly do not have any filters or similar things either.

This is what I see if I start DOSBox in "machine=ega" mode:


So it was even documented, and I didn't even notice until now! I don't know when it was added. I'm using the development version of DOSBox.

This is what Maniac (v1) looked like if I use Shift+P and then press F12. I haven't experimented with the "change hue" or "early/late CGA model" hotkeys. (The latter probably conflicts with X11's console switching, but it can probably be remapped.)


comment:12 by athrxx, 2 weeks ago

Cool, I have to try this. I had already thought how cheap it would actually be to just have EGA mode with that palette instead of the normal EGA one.
And that looks just like that...

Note: See TracTickets for help on using tickets.