Jump to content
IGNORED

2600 RGB colormap - looking for feedback


cwilkson

Recommended Posts

I'm kicking around another piece of vaporware here and I'm looking for some initial feedback. For those who use the Stella emulator, could you take a look at some games using the attached palette and offer some feedback? It would be much appreciated. The palette setting can be changed in Options->Video settings->TIA palette...select "user". Then tell it where to find the file in Options->Config Files->Palette file.

 

Thanks,

-Chris

STELLA.zip

Link to comment
Share on other sites

Evil math. These are the colors a 2600 would produce in a perfect world. (sorta)

 

The basic process goes like this. (This is not intended to be rigorous explanation. More like a stream of conciousness thing. So buyer beware.)

 

First decide what the Y/C video would look like if it were ideal. Convert that to YUV. Then convert that to RGB. In our perfect world, COLUM=$00 (black) would give RGB=$000000 and COLUM value $0E (white) would give RGB=$FFFFFF. (I'm neglecting bit 0 of COLUM...it isn't used in the 2600.) The 6 grays would be evenly spaced between black and white. That part is easy and the 2600 does it already. For the non-gray colors, the output would be evenly spaced around the color wheel starting with HUE 1 at 180 degrees and progressing clockwise from there in 24 degree increments. This, the 2600 can closely approximate (using the color adjust pot on the motherboard) but each color actually has an error in it's angle and these errors are all different. The last thing needed is the saturation. There is no way to change this from color to color in the 2600. It's a fixed value, set by the resistor between the TIA's pin 9 (COLOR) and pin 6 (/BLANK). Some consoles have the resistor, others don't. Without the resistor, the colors look faded. With it you get bleeding and color ringing and...well, 2600 color is a big mess.

 

Since I'm playing with imaginary machine for now I get to arbitrarily choose some things. I decided to keep the LUMA values the way they are and to keep the 15 colors around the color wheel. And I wanted to keep all the saturation values the same. But I wanted a bit more saturation than "none" so I chose to make it equal to the 75% blue color bar - a known value. These things are what the 2600 tries to do as is. I just decided to assume that it succeeded perfectly.

 

After a bunch of digging around in the public library, my private library, a few book stores, and the internet I was able to put together a self-consistent set of equations for converting RGB -> YUV -> Y/C -> YUV -> RGB. The entire encoding and decoding process. I didn't have access to the original raw RGB or the YUV numbers - they don't exist and never did. So I started with a known data point: the 75% blue color bar. It has an angle of 347 degrees. I could get normalized values of U and V from basic trigonometry. I had equations for Y given RGB and for blue given YUV. I knew that RGB for this blue bar is 0:0:191 (75% pure blue). That data point allowed me to solve the 2 sets of equations to find the scale factor for U and V given my arbitrarily chosen saturation level.

 

Finally I can turn the crank to find Y for every LUMA value and U and V for every HUE value. Then turn the crank again to find the RGB set. But now the big non-ideality pops up. The YUV and RGB color spaces don't overlap perfectly. Each one has colors that don't exist in the other. For example, COLUM=$90 gives YUV=0:42.3:-9 which is perfectly acceptable. And it gives RGB=-20:-23:170. Note the negative values. When the numbers go outside the range 0-255 the only option is to clip them.

 

NOTE:

After I started this thread last night I decided to make an Excel tool to do a lot of this for me and realized I made an early mistake in my qbasic program (yeah...old tech) that carried all the way into the colormap I posted. It's minor and might not make much difference, but I'll post an updated color map....RSN.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...