Thread: BSNES (rules)
View Single Post
Old 01-11-2006, 06:32 PM   #33
blargg
Regular Member
 
Join Date: Jul 2004
Posts: 45
Default Re: BSNES (rules)

> Well, those screenshots are easily the closest thing to a real NES I've
> ever seen on a monitor before, nonetheless.

And now two NES emulator builds have been posted.

Thank NewRisingSun for converting the NES and NTSC specifications into an algorithm; I've mainly just rewritten it a bunch of times and refined it down to the minimal (making it 25x faster in the process). I'm still not entirely familiar with how the NES video circuitry works.

Basically color information is encoded into the phase of a a pair of sine waves added to the signal, relative to the phase of the color burst reference sine wave that's at the beginning of the signal. The reference sine wave goes through three phase offsets, one each scanline. This accounts for the three different variations you get for an identical set of pixels. During normal operation, the NES PPU phase at the beginning of each frame toggles between two values, so things "shake" every field but visually blend together unless the scene is scrolling, then you see the artifacts.

I think that proper encoding calls for just two phases, alternating every scanline, and alternating every field for the same scanline, so that the checkerboard effect cancels out between scanlines and between frames. I haven't looked but I imagine the SNES does this, so you might find just two alternating patterns rather than three.

The artifacts are mainly due to the low-pass filter applied to the color signal in the TV, causing the phases of neighboring pixels to mix in. This also causes the brightness (luma) to be affected by color changes, since the color signal is added on top of it. So emulating this isn't a simple RGB mix from neighboring pixels.

> I'd happily add this to my emulator if you did research the SNES'
> display capabilities

We need someone with NTSC video knowledge and an oscilloscope to examine the NTSC composite video signal from a SNES.

But since the SNES includes RGB output, you can just say you're emulating that and be done with it.

<P ID="signature"></P>
blargg is offline   Reply With Quote