Repository navigation
Support for custom CGA color overrides - #1794
Conversation
|
This pull request introduces 26 alerts when merging 79af68c into c4679e0 - view on LGTM.com new alerts:
|
ce7b152 to
fda4915
Compare
|
This pull request introduces 26 alerts when merging fda4915 into f2b1855 - view on LGTM.com new alerts:
|
|
This pull request introduces 26 alerts when merging 39786af into f2b1855 - view on LGTM.com new alerts:
|
The hardcoded monochrome text palettes seem to be wrong as they're not using the "dark grey" (or "bright black") colour. The MDA specs clearly state that four intensity levels were supported by the display adapter (but not necessarily by all monitors) which include the "dark grey" colour. `VGA_ATTR_SetEGAMonitorPalette` generated the correct palette in MONO mode (this is how an EGA card emulates the MDA mono text mode (07h)), so we're changing the hardcoded `mono_text` palette to reflect that and reference it. The `mono_text_s3` palette has also been adjusted by an educated guess; it's most likely correct.
39786af to
2549b03
Compare
|
Thanks for the review @kcgen. Build all green & ready for merging, as far as I'm concerned. |
|
This pull request introduces 26 alerts when merging 2549b03 into 2b95fd5 - view on LGTM.com new alerts:
|
Oh, check out the LGTM scanner: #1794 (comment) (It's catching some variable names shadowing global variables) Use the 'view on lgtm' link, then expand the int10_modes diff, which will show the 26 lines highlighted in red. |
That global was a leftover I forgot about. Removed, should be fine now. |
kcgen
left a comment
There was a problem hiding this comment.
Another really nice refinement, @johnnovak !
|
This pull request introduces 21 alerts when merging b6268a2 into 2b95fd5 - view on LGTM.com new alerts:
|
|
Oh, looks like the LGTM warnings dropped from 26 to 21 after that last commit. Do we still have those 21 left? (the CI actions can be a mit of a maze; sorry if I'm not seeing it!) |
Sorry @kcgen, didn't see that before I merged. I'll raise a separate cleanup PR. |
Overview
This change allows the user to redefine the interpretation of CGA/EGA RGBI colours. There are two main motivations for introducing the feature:
Emulate Amiga palettes
Amiga ports of Sierra and LucasArts games feature improved EGA-like palettes that better represent certain colours (e.g. skin tones). ScummVM has an option to use the Amiga palettes even in DOS versions of the supported games, and this was the primary motivation for adding the feature.
Emulate the actual colours you would see on CRT monitors
CGA and EGA cards had no DAC; they output the colour information via digital TTL signals. In a nutshell, the graphics adapter only output colour indices (from 0 to 15 in case of CGA or CGA-like modes), then the interpretation of colours was up to the monitor hardware. One notable difference was the interpretation of the brown colour at index 6: old monitors displayed it as dark yellow instead of brown, and Tandy monitors even had a "brown adjustment" potentiometer so the user could dial in the exact green channel level. The
tandypreset emulates this behaviour.Some CGA monitors had interesting quirks: the contrast control of the IBM 5133 monitor effectively controlled the dimming of the first 8 non-bright colours only; the upper 8 bright colours were left completely intact. Also, the interpretation of all colours were a bit different from the canonical CGA/EGA palette (as emulated by VGA cards). The
ibm5153preset emulates this archetypal CGA monitorLastly, sRGB standardisation wasn't a thing yet in the 80s and early 90s. The gamma levels and colour gamuts of CRT monitor models from different (or even the same) manufacturers were all over the place. The exact colours displayed by these monitors depended not just on how the monitor interpreted the digital RGBI colours in the circuitry, but also the gamma and colour reproduction of the CRT screen. It turns out that the measured colour output of these old monitors can be quite a bit nicer and less garish than just naively displaying the canonical emulated CGA palette on modern sRGB displays. The
tandy-warmpalette is a good example of this (and is my #1 favourite).Limitations
Only 6-bit colour components are allowed because this was the least invasive way of adding the feature to the existing code. This is not a problem at all for emulating the Amiga palettes, as the original Amiga chipset used only 4-bit components. For emulating the actual measured output of a monitor this is a slight of a limitation, but given this is a relatively niche feature and 262k colours can still quite faithfully represent the colour output of these monitors, I don't think this would warrant an extensive refactorisation of the codebase just to support 8-bit per component overrides.
The colour overrides can only be set at startup. Again, support could be added to switch the palettes at runtime, but that would be quite a bit of work. I think we should do it in the future anyway once we have the long awaited OSD functionality in place but probably it can wait until then.
Examples
I suggest to open the images pairwise in two browser tabs, and switch between them to appreciate the differences.
Defender of the Crown
I'm really fond of
tandy-warm. I've picked these colours off a camera capture of a real Tandy EGA monitor. This palette subdues all colours a little, making them a bit warmer and less radioactive. The difference is very noticeable on the green — a big improvement over the harsh greens you'd get with the default palette on modern sRGB displays.default
tandy-warm
Gold Rush!
The "Amigaish" colourscheme introduced by the Sarien AGI interpreter is a mix between EGA and Amiga/Apple IIgs colours. Notice how the sky has a more natural colour and the skin tones are much improved.
default
agi-amigaish
Maniac Mansion
The Amiga ports of EGA LucasArts games feature an improved palette that might be preferable to some. In particular, the characters portraits are not suffering from severe sunburn anymore...
default
scumm-amiga
Zak McKracken and the Alien Mindbenders Enhanced
The
ibm5153palette softens the EGA colours a little, and thecolodorebrings back those C64 memories. Now you can play the game with C64-like graphics and 3-channel Tandy music with no loading times!default
ibm5153 (contrast 80)
colodore