Reply 260 of 760, by NewRisingSun
wrote:If I'm understanding it correctly, the problem is this: There are some games where the art was originally made for EGA/Tandy/PCJr 160x200 16 colour mode (which has the standard RGBI colours) but which also support composite CGA (which has a completely different set of colours).
That may be robertmo's goal, not mine.
wrote:If, for any given composite dot pattern, you look at all of the "original art" colours that map to that dot pattern across all games, you'll find that the colour in the middle of all those colours is the same as the average colour that that dot pattern produces over all the composite monitors used by the game designers, which in turn is going to be something pretty close to the ideal colour for that dot pattern that the NTSC standards demand.
I'm not sure I understand that statement. The average RGB color is the same as the average composite color is the same as the NTSC-ideal? If all composite monitors deviate from the NTSC standard in a similar way (which they do), at least the last part of that statement will turn out to be untrue. For example, composite color 8 is almost always used as brown, on CGA composite and Apple II double hi-res alike, yet looks more like a yellowish green with standard NTSC. The only exception I have seen is the PC version of BurgerTime, which indeed uses it as a darker shade of green for lettuce.
Conclusion: to at least have a chance of DosBox replicating any real monitor or TV instead of just the hypothetical NTSC reference receiver, make the NTSC decoding matrix adjustable in dosbox.conf in polar coordinate form the way NEStopia does, and be done with it. I could imagine something like this:
[composite]
angler=90
angleg=236
angleb=0
gainr=1.140
gaing=0.701
gainb=2.029
which would produce the NTSC reference receiver in this example. I think that's tolerable for developers and users alike.
And having thought some more about comb filters, the best implementation for DosBox would be in my opinion to not comb filter except when there's a detectable reason for it, because for CGA images, the bad results of indiscrimate comb filtering outweigh the good. I think that is the method used by most Apple II emulators as well. A reasonable detection routine might be (CVBS meaning a composite signal):
bCombFilter =((cvbs[row][col] == cvbs[row+2][col] != cvbs[row+1][col]) |
(cvbs[row+1][col] == cvbs[row-1][col] != cvbs[row][col]) |
(cvbs[row][col] == cvbs[row-2][col] != cvbs[row-1][col]))
Just from the top of my head, I haven't tried it yet.