Jump to content



0

Colors (again!)


2 replies to this topic

#1 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,545 posts
  • Location:Georgia, USA

Posted Wed May 25, 2011 3:24 AM

This week I reviewed the old [stella] posts in which Eric Ball gave formulas for calculating the RGB values for the 2600's NTSC color palette. I managed to create a Visual Basic program to calculate the colors, although I haven't quite completed it yet-- I still need to add gamma correction, as well as controls for adjusting the parameters, and I want to try to add additional "TV" controls for brightness, contrast, color (i.e., saturation), and tint. I understand most of the formulas he posted, and actually replaced some of his numeric coefficients with the parameters they're derived from (i.e., the RGB weights and the UV scaling). But I still don't understand how he got the TIA's luma increment and saturation value.

I also reviewed the field service manuals for the 2600, 5200, and 400/800 computers. Contrary to my previous belief, they *do* say that hue 15 should be adjusted via the color delay pot so it's the same as hue 1. I'd previously interpreted the wording to mean that hue 15 should be adjusted to fall somewhere between hue 1 and hue 2, because that's what the values in the GTIA documentation indicate (the time delay values it gives work out to a phase shift delay of about 27 degrees). But the illustrations in all three field service manuals clearly indicate that hue 15 and hue 1 should be the same color! I'll come back to this in a moment.

Another thing I found interesting is that Eric Ball's formulas-- or more specifically, the luma step increase he gave-- generate a palette that looks too dark, as everyone who replied to his posts had stated. However, I have an actual screenshot from my heavy sixer that I'd recorded to DVD, and not only does *it* look too dark when viewed on my computer screen, but it's actually a little bit *darker* than the palette Eric Ball's formulas produce! The difference between how dark the screenshot looks on my computer monitor versus how it looks on my TV must be due to the differences in the gamma, as well as the overall brightness settings.

So here's what I fnd so odd about the phase delay. When I set it so hue 15 is the same as hue 1, the palette actually does look "correct," although hue 15 and hue 1 don't look the same. Nevertheless, they are exactly the same, so their apparent difference is just an optical illusion because of the surrounding colors.

Also, I've compared different documents that specify or imply different phase delays.

For example, the documentation for the CGIA chip (which, as far as I know, was never produced) specifically stiplulates a phase delay of 24 degrees, which gives 15 different hues that are equally-spaced around the Y'IQ/Y'UV color wheel. This actually seems to match the way my heavy sixer is adjusted (which I didn't do myself; it came that way when I bought it a few years ago).

The Stella programming guide doesn't stipulate the phase delay value, but it does imply that the colors are equally-spaced over nearly 360 degrees, which *could* mean a 24-degree delay such that the span from hue 1 to hue 15 is 336 degrees (nearly 360 degrees obviously means *less* than 360 degrees).

As already noted, the field service manuals say hue 15 should be the same as hue 1, which is a phase delay of about 25.7 degrees (360 degrees divided by 14).

As I said above, the GTIA documentation lists timing values for each of the hues that are equivalent to a phase delay of about 27 degrees, which puts hue 15 exactly two-thirds of the way between hue 1 and hue 2.

I've also worked out several other possible phase delays between 24 degrees and 28 degrees, such as red=hue4, blue=hue9, blue=hue8, green=hue13, green=hue12, yellow=hue15, hue15="hue1.5" (exactly halfway between hue1 and hue2), and a setting that gives the closest simultaneous fit for red/green/blue (where red~hue4, blue~hue8, and green~hue12). Obviously, since different people might prefer to adjust the color delay pot differently, I want my palette generator to be adjustable. Personally, I feel rather strongly that hue15 should *not* be set equal to hue1, otherwise there's only 120 different colors, not 128.

Anyway, here's a few screenshots from my (unfinished) program, along with the screenshot from my heavy sixer, and one from my 7800.

First, my heavy sixer:

Atari 2600 Colors.png

My 7800:

Atari 7800 Colors.png

My Visual Basic program, with a delay of 24 degrees, as per the CGIA documentation (compare to my heavy sixer):

phase 24.png

My program, with hue15=hue1, as per the FSM (they may *look* different, but are exactly the same):

phase 25.7143.png

My program, with a delay of 27 degrees, as per the GTIA documentation:

phase 27.png

When I complete my program, I'll post it here so people can use it to create palette files for their emulators if they want.

Michael

Attached Thumbnails

  • Atari 2600 Colors.png


#2 eshu OFFLINE  

eshu

    Chopper Commander

  • 163 posts

Posted Thu Jun 23, 2011 7:58 AM

Any news on this - any chance you'll do PAL palettes as well?

#3 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,545 posts
  • Location:Georgia, USA

Posted Thu Jun 23, 2011 9:09 PM

View Posteshu, on Thu Jun 23, 2011 7:58 AM, said:

Any news on this - any chance you'll do PAL palettes as well?
I put it aside and haven't gotten back to it yet, as I've been focused more on TIA sound lately. But I need to re-code some of it (it's atrocious), as well as add working controls for the parameters.

I'd like to do a PAL version, but I'm not sure about the formulas. There was a PAL palette generator (and an NTSC palette generator) posted on the web several years ago when the colors were being discussed in the old [stella] mailing list-- those old posts are where I got the NTSC formulas from. But I haven't looked at the PAL code yet. :)

Michael




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users