Close

Color resolution beyond 160x200?

A project log for XORYA - extremely low cost game console on PIC32

XORYA game console is just one chip PIC32MX170F256B (32-bit MIPS core, 256K flash, 64K data mem) in DIP28 package and a few other components

shaosSHAOS 12/20/2023 at 17:390 Comments

It was bothering me from the beginning that effective color resolution of composite NTSC colors is only 160x200 - such a downgrade from original monochrome 640x200, but then I started thinking that may be if image is having black-and-white/grayscale parts then resolution may look better? A year ago I wrote this program to show pixlel-level transitions between colors and blacks/whites/grays:

https://gitlab.com/shaos/xorlib/-/blob/master/examples/colodiag.c

It produces this pattern on NTSC TV:

Then I thought why I should flash every experiment into PIC32 if I can write "composite simulator" that imitate NTSC decoding and I did it in January 2023:

https://gitlab.com/shaos/xorlib/-/blob/master/tools/compositesim.c

By default this program produce color bars:

And we can shift phase too (90 degrees to imitate palette #1, 180 degrees - palette #2 and 270 degrees - pallette #3). Also it is possible to produce image from arbitrary XBM file like this one:

Then I put diagonal color pattern in it:

That looks very similar to what TV showed above. Then I looked at borders between colors:

As you can see smoothness is not always 160 pixels per line - sometimes it may look like 320 (yellow highlights) or even 640 (green highlights - it's only on borders between white and black). Actually it's easy to summarize this way:

- black (0000) and white (1111) may connect with 640-pixel precision;
- grays (0101 and 1010) are connecting with white or black with 320-pixel precision;
- colors with codes 0111, 1011, 1101 and 1110 (3 ones and 1 zero) may connect with black with 320-pixel precision;
- colors with codes 0001, 0010, 0100 and 1000 (3 zeros and 1 one) may connect with white with 320-pixel precision;
- all other connections are having 160-pixel precision.

Having this knowledge allows me to create color images for Xorya that look better than 160x200 because of more precise grayscale parts in it :)

Time to code some games? ;)

Discussions