Why Doesn't the NES Show Artifact Colors?

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

tepples
Posts: 21936
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Why Doesn't the NES Show Artifact Colors?

Post by tepples » Tue Jul 05, 2016 7:41 am

In PAL, the V plane flips relative to U on every other scanline.

"Phase reversal" in the NTSC sense refers to a different phenomenon. Because a standard scanline is 227.5 cycles long, a vertical edge in a conforming picture will hit opposite phases of U and V from one scanline to the next, causing any color artifacts to visually cancel out. It could be seen as both U and V flipping relative to the start of the horizontal sync pulse.

lidnariq
Posts: 9281
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Why Doesn't the NES Show Artifact Colors?

Post by lidnariq » Tue Jul 05, 2016 12:07 pm

Great Hierophant wrote:Apparently [Tandy's CoCo] did not do enough right with composite color because you cannot guarantee which pattern of colors will be generated when you boot the system.
As far as I know, the Apple 2 was the only system that was explicitly designed to make use of artifact color. So I'm not terribly surprised that everywhere else it was a convenient discovery rather than carefully designed in.

tomaitheous
Posts: 592
Joined: Thu Aug 28, 2008 1:17 am
Contact:

Re: Why Doesn't the NES Show Artifact Colors?

Post by tomaitheous » Thu Jul 07, 2016 11:14 am

Speaking of NTSC color artifacts: PC-Engine demo by Chris Covell http://www.youtube.com/watch?v=g51QqurGqg0

7.159mhz dot clock mode used, dot crawl filter turned off (no cycling per frame-to-frame difference).
__________________________
http://pcedev.wordpress.com

supercat
Posts: 161
Joined: Thu Apr 18, 2019 9:13 am

Re: Why Doesn't the NES Show Artifact Colors?

Post by supercat » Sat May 18, 2019 8:45 pm

lidnariq wrote:When you say "artifact colors", do you mean "composite artifacts" ? Or do you actually mean artifact colors ?

For the latter, to meaningfully be able to generate useful artifact colors, your pixel clock must be at least twice as fast as the NTSC colorburst. The only thing we've really managed on the NES is tepples's "tvpassfail" test that uses specific pixel choice to cancel the actual chroma content. (In fact, because the pixel clock is less than twice the colorburst frequency, i.e. the colorburst frequency is above the Nyquist rate, nothing else is even possible)

Additionally, for it to be practical, it should be a "nice" ratio with a small denominator in the ratio. 1's easy, 2 or 3 would be ok, 7 would be actively obnoxious.
Composite artifact tricks can yield a nice range of colors my NES and television set, even just using a single "four-color" background palette. The one problem I haven't figured out is how to determine the chroma state. There are six chroma states at the start of each frame, which I'll call AA, BB, CC, AB, BC, and CA. If rendering is disabled at the end of vblank, they progress through the states AA, BC, CC, AB, BB, CA. With rendering enabled, they alternate in one of three patterns: AA<->BC, BB<->CA, and CC<->AB. The system can easily display a test pattern to identify the chroma state, and nudge things into any desired state by disabling rendering for 1-5 frames, but don't know of any practical alternative to asking the user to indicate what color things are.

Once color phase is set, all that is necessary to exploit chroma artifacts in the background of a game is to have the three foreground colors be 4 apart, and have three versions of each tile--one for each color phase. While some sets of hardware colors will work better than others, each combination of a background color and three phase-shifted colors can yield up to 64 different colors. While most colors will show some diagonal striping, they are solid enough that they could be used in things like sunset or rainbow effects.

This demo is set up for an NTSC televsion set. Push down (and release) to play chroma roulette. There's a 50/50 shot you'll land on a bad phase (flickery mess); if you do, just push down again. The three groups of 64 boxes show the same colors, but in different order. The four "hardware" colors are in the upper left (black), second row sixth column (lavender), third row tenth colmn (orange), and bottom right (greenish).

One way to think about this demo is to regard the NES as showing each of its built-in colors one of three ways depending upon its exact position and chroma phase, and each pixel will alternate between two of these ways of being displayed. Mixing three colors chosen from a set of four would offer only 20 choices if the order and phase didn't matter (000, 001, 002, 003, 011, 012,013, 022, 023, 033, 111, 112, 113, 122, 123, 133, 222, 223, 233, 333) but on a real set the order and phase do matter, thus enhancing the set to 64 colors.

PS--The demo shows aliasing effects in MESEN with an NTSC video filter selected, but the chroma roulette behavior doesn't match my real system.

lidnariq
Posts: 9281
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Why Doesn't the NES Show Artifact Colors?

Post by lidnariq » Sat May 18, 2019 9:17 pm

Where's the attachment?

supercat
Posts: 161
Joined: Thu Apr 18, 2019 9:13 am

Re: Why Doesn't the NES Show Artifact Colors?

Post by supercat » Sat May 18, 2019 9:46 pm

lidnariq wrote:Where's the attachment?
Oops.
Attachments
colorArtifact1.nes
(64.02 KiB) Downloaded 200 times

Post Reply