SNES NTSC Composite Video Filter

Strictly for discussing ZSNES development and for submitting code. You can also join us on IRC at irc.libera.chat in #zsnes.
Please, no requests here.

Moderator: ZSNES Mods

Post Reply
blargg
Regular
Posts: 327
Joined: Thu Jun 30, 2005 1:54 pm
Location: USA
Contact:

Post by blargg »

the only other major difference that PAL has vs NTSC is that the color clock phase is switched at the beginning of each scanline, so that color doesn't get shifted weirdly toward the bottom of the screen by the TV internal color clock getting desynchronized from the color clock in the incoming signal (the colorburst).
The colorburst is present on every visible scanline of an NTSC signal, so any color shift would be on the right side of the screen. The TV has to lock on to the colorburst's phase every scanline, since different signal sources shift it differently. If it didn't (say, assumed that it shifted 180 degrees every scanline), most video game consoles wouldn't display correctly. PAL does have something in its design that avoids color shift (i.e. no need for a tint control on the TV), but I forget what it is.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

blargg wrote:PAL does have something in its design that avoids color shift (i.e. no need for a tint control on the TV), but I forget what it is.
It's what made its name. Phase Alternating. Every line's colour shift is compensated by the surrounding ones. The brain sums up and averages the colours at the end of each line to the correct one.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Sith
Lurker
Posts: 100
Joined: Tue Jul 19, 2005 12:32 pm
Location: Belgium

Re: pal version

Post by Sith »

Ichinisan wrote:
SteveSnake wrote:[awesome information]
[offtopic]You were the best playable character in NBA JAM.[/offtopic]
Steve wrote that game. :wink:
[url=http://zsnes.ipherswipsite.com/]Zsnes WIP[/url]
[url=http://byuu.cinnamonpirate.com/?page=bsnes]Bsnes[/url] by Byuu
[url=http://www.eidolons-inn.net/tiki-index.php?page=Kega]Kega Fusion[/url] by SteveSnake
[url=http://www.viceteam.org/]Vice[/url] by Viceteam
King Of Chaos
Trooper
Posts: 394
Joined: Mon Feb 20, 2006 3:11 am
Location: Space

Re: pal version

Post by King Of Chaos »

Sith-Smasher wrote:
Ichinisan wrote:
SteveSnake wrote:[awesome information]
[offtopic]You were the best playable character in NBA JAM.[/offtopic]
Steve wrote that game. :wink:
Accually it was NBA Jam T.E. :wink:
Ichinisan
Veteran
Posts: 603
Joined: Wed Jul 28, 2004 8:54 am

Re: pal version

Post by Ichinisan »

Sith-Smasher wrote:
Ichinisan wrote:
SteveSnake wrote:[awesome information]
[offtopic]You were the best playable character in NBA JAM.[/offtopic]
Steve wrote that game. :wink:
I know. he's an elite coder. I'd wager that Steve knows Sega hardware better than most of their own engineers. I had no idea that he was also so familiar with NTSC/PAL broadcast standards. Was this self-taught?
SteveSnake
Rookie
Posts: 11
Joined: Thu Mar 02, 2006 8:41 pm

Re: pal version

Post by SteveSnake »

King Of Chaos wrote:
Sith-Smasher wrote:
Ichinisan wrote:
SteveSnake wrote:[awesome information]
[offtopic]You were the best playable character in NBA JAM.[/offtopic]
Steve wrote that game. :wink:
Accually it was NBA Jam T.E. :wink:
Actually you're both right ;)
ICEknight
Rookie
Posts: 33
Joined: Sun Mar 12, 2006 7:15 pm

Post by ICEknight »

grinvader wrote:There are horizontal scanlines on PAL tvs. They are just smaller than on NTSC sets.

The even and odd fields are both used, but there are still scanlines because they aren't used at the same time, heh (and the lower scan rate produces the flicker).
No, there aren't. Look:
Image
That's as close as you can get to the TV and you can see there's no scanlines at all, due to the brick-like arrangement of the RGB cells. I've also tried with a NES and it doesn't show any scanlines either, by the way.
tetsuo55 wrote:about the pal scanlines

i know the scanlines should be there, but i checked it on 10+ different tv's and there are no visable scanlines

once i get close enough i do see vertical lines (im at less than 30 cm distance from the tv now)
One out of four PAL TVs I've checked seemed to have those vertical lines, but if you look closer (try using a magnifyier) you'll see that's just the dark blue from those cells:
Image
Sith
Lurker
Posts: 100
Joined: Tue Jul 19, 2005 12:32 pm
Location: Belgium

Post by Sith »

Hey ICEknight. Welcome here too! :D
[url=http://zsnes.ipherswipsite.com/]Zsnes WIP[/url]
[url=http://byuu.cinnamonpirate.com/?page=bsnes]Bsnes[/url] by Byuu
[url=http://www.eidolons-inn.net/tiki-index.php?page=Kega]Kega Fusion[/url] by SteveSnake
[url=http://www.viceteam.org/]Vice[/url] by Viceteam
ICEknight
Rookie
Posts: 33
Joined: Sun Mar 12, 2006 7:15 pm

Post by ICEknight »

I'm also quite interested in this display simulation stuff, so I thought I'd try to help a little.

By the way, I think it would be quite useful to separate between two different kinds of filters:

a)-Filter that shows in your monitor how it would look like on a TV using a real console.
b)-Filter that shows the signal as it comes from the real console (so it would look like the previous filter when the PC video signal is being output through a real TV).


Do you guys think it would be possible to make? Perhaps making two combinable filters that could be updated separately, since (a) would be just (b) with an additional "TV output" filter?
Last edited by ICEknight on Sun Mar 12, 2006 10:12 pm, edited 1 time in total.
kick
Trooper
Posts: 550
Joined: Wed Mar 01, 2006 8:47 pm

Post by kick »

Yes,that's exactly how a good old large-screen SABA PAL TV looks like :)
The colors are excellent and there's no noticeable "interlacing" (scanlines) when viewing the screen normally.The vertical RGB stripes are really noticeable at low distances,and the mesh of cells can be seen at very low distances.

The quality of the picture good PAL TVs produce is great even these days when HDTV is all the rage.Europeans don't notice THAT much of a difference.PAL TVs produce a superb picture with DVD players,getting the most of the details,so HDTV is not that tempting.

But there ARE visible "scanlines",although they are not noticeable at all in most TVs,even at very small distances from the screen.

They are very light,unlike those in NTSC TVs that are very pronounced (dark).

The only way to see PAL scanlines is to blink very fast with your eyes,or to move your head up and down while being close to the TV screen.

It depends on the quality of the TV if you can see those all the time,or when just moving your head/eyes very fast).
Last edited by kick on Sun Mar 12, 2006 11:47 pm, edited 2 times in total.
ICEknight
Rookie
Posts: 33
Joined: Sun Mar 12, 2006 7:15 pm

Post by ICEknight »

kick wrote:But there ARE visible scanlines,although they are not noticeable at all,even at very small distances from the screen.

They are very light,unlike those in NTSC TVs that are very pronounced (dark).

The only way to see PAL scanlines is to blink very fast with your eyes,or to move your head up and down while being close to the TV screen.
I have the feeling that those aren't the kind of scanlines we were discussing. They should be visible even if you're not moving your head vertically or blinking fast...


So, in other words, nobody seems to have seen any "proper scanlines" in any PAL TVs.
blargg
Regular
Posts: 327
Joined: Thu Jun 30, 2005 1:54 pm
Location: USA
Contact:

Post by blargg »

b)-Filter that shows the signal as it comes from the real console (so it would look like the previous filter when the PC video signal is being output through a real TV).
That wouldn't be very hard to code but it would require a way to output a ~14.32 MHz raw signal from a video card (i.e. like an 8-bit sound card with a 14.32 MHz sampling rate). This would be simpler than the full NTSC filter since it's only doing the first half of the operation. I even wrote something like this for the NES video signal but I did't have any way to actually output it from my PC to a TV. Since the only composite video output you can easily get is from a TV card, it's more difficult becuase the TV card itself has its own encoding characteristics, and cards probably differ somewhat.
BFeely
Rookie
Posts: 32
Joined: Mon Nov 22, 2004 8:14 pm
Contact:

Post by BFeely »

Bahamut_ZERO_939 wrote:Maybe it's my resolution or my eyes but the NTSC Filter does nothing from the most recent CVS sources. Is my resolution of 1024x768 too high a resolution?
I used the latest WIP version and it did not do anything either. Also, the following things should be added:
- Do hi-res (512 pixel wide) rendering, as you said you would.
- When the SNES is in interlaced 448 line mode, make the scanline effect interlaced.
- When a resolution doubling filter (2xSaI, etc.) is enabled along with the NTSC filter, do a two-pass effect: Filter the SNES image with 2xSaI or whatever (make sure the HQ filter only uses HQ2X), then render the filtered image using an interlaced NTSC effect.
- Fix the problem where the NTSC test version of ZSNES would go crazy with 240 line mode and stretch out the image vertically until you quit and restart ZSNES.
- Add an option to use full 15-bit color quality instead of 13-bit quality, because 13-bit sometimes causes certain gradient effects to have weird colors, similarly to what happens when you turn New GFX Engine off. Of course, it should only be an option, because of the higher system requirements for the 15-bit conversion table.
Last edited by BFeely on Mon Mar 13, 2006 11:32 pm, edited 3 times in total.
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

BFeely wrote:
Bahamut_ZERO_939 wrote:Maybe it's my resolution or my eyes but the NTSC Filter does nothing from the most recent CVS sources. Is my resolution of 1024x768 too high a resolution?
I used the latest WIP version and it did not do anything either. Also, the following things should be added:
- Do hi-res (512 pixel wide) rendering, as you said you would.
- When the SNES is in interlaced 448 line mode, make the scanline effect interlaced.
- When a resolution doubling filter (2xSaI, etc.) is enabled along with the NTSC filter, do a two-pass effect: Filter the SNES image with 2xSaI or whatever (make sure the HQ filter only uses HQ2X), then render the filtered image using an interlaced NTSC effect.
- Fix the problem where the NTSC test version of ZSNES would go crazy with 240 line mode and stretch out the image vertically until you quit and restart ZSNES.
If you didn't pay attention to the changes.txt file (I made that mistake too), you would realize that it's only included in the source. It is not accessible for any ports in the current build even though there's a nice NTSC filter checkbox in the Video Options (which does nothing at the moment).
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
Bahamut_ZERO_Clue

Post by Bahamut_ZERO_Clue »

You've got to be joking. You mean to tell me the developers added a TOTALLY and COMPLETELY useless feature into ZSnes? And people wonder why I raised a fuss about the code I submitted. Go figure.

So if it's totally and completely useless why the heck is it even in the code to begin with? It makes no sense to have useless code in an emulator if it does absolutely nothing at all.

Okay whatever the devs are smokin'... I want some of it too.
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

Bahamut_ZERO_939 wrote:You've got to be joking. You mean to tell me the developers added a TOTALLY and COMPLETELY useless feature into ZSnes? And people wonder why I raised a fuss about the code I submitted. Go figure.

So if it's totally and completely useless why the heck is it even in the code to begin with? It makes no sense to have useless code in an emulator if it does absolutely nothing at all.

Okay whatever the devs are smokin'... I want some of it too.
Um... there are kinks that need to be worked out obviously.. hence why it hasn't been totally added just yet (I think hires support was the current issue, if you looked through the progression of the thread).
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
Bahamut_ZERO_Clue

Post by Bahamut_ZERO_Clue »

I thought ZSnes already did 512x448 high-res modes or was it the Psuedo High Res that Mode 6 does?
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

Bahamut_ZERO_939 wrote:I thought ZSnes already did 512x448 high-res modes or was it the Psuedo High Res that Mode 6 does?
I think you missed the point.. even though hires is already supported, filters need to be able to be applied to them. They are the only special case. The best example is the HQx modes.. they aren't applied when a hires mode is used (see Secret of Mana).
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
blackmyst
Zealot
Posts: 1161
Joined: Sun Sep 26, 2004 8:36 pm
Location: Place.

Post by blackmyst »

blargg wrote:
b)-Filter that shows the signal as it comes from the real console (so it would look like the previous filter when the PC video signal is being output through a real TV).
That wouldn't be very hard to code but it would require a way to output a ~14.32 MHz raw signal from a video card (i.e. like an 8-bit sound card with a 14.32 MHz sampling rate). This would be simpler than the full NTSC filter since it's only doing the first half of the operation. I even wrote something like this for the NES video signal but I did't have any way to actually output it from my PC to a TV. Since the only composite video output you can easily get is from a TV card, it's more difficult becuase the TV card itself has its own encoding characteristics, and cards probably differ somewhat.
What about that videocard that came up a while ago, that was specifically made for emulation and allowed you to make all sorts of custom video modes? I can't find the url at the moment but maybe someone else remembers.
[size=75][b]Procrastination.[/b]
Hard Work Often Pays Off After Time, but Laziness Always Pays Off Now.[/size]
ICEknight
Rookie
Posts: 33
Joined: Sun Mar 12, 2006 7:15 pm

Post by ICEknight »

Well, it would be amazing if it was indeed possible to output a perfectly emulated signal to a TV.
zidanax
Rookie
Posts: 49
Joined: Thu Jul 29, 2004 5:17 am
Location: USA

Post by zidanax »

blackmyst wrote:
blargg wrote:
b)-Filter that shows the signal as it comes from the real console (so it would look like the previous filter when the PC video signal is being output through a real TV).
That wouldn't be very hard to code but it would require a way to output a ~14.32 MHz raw signal from a video card (i.e. like an 8-bit sound card with a 14.32 MHz sampling rate). This would be simpler than the full NTSC filter since it's only doing the first half of the operation. I even wrote something like this for the NES video signal but I did't have any way to actually output it from my PC to a TV. Since the only composite video output you can easily get is from a TV card, it's more difficult becuase the TV card itself has its own encoding characteristics, and cards probably differ somewhat.
What about that videocard that came up a while ago, that was specifically made for emulation and allowed you to make all sorts of custom video modes? I can't find the url at the moment but maybe someone else remembers.
Would you be thinking of the ArcadeVGA?
Bahamut_ZERO_Clue

Post by Bahamut_ZERO_Clue »

I see the issue also in Mode7 as well as the high-res modes. I noticed this with not only Lufia 2 but other Mode7 games as well.
pagefault
ZSNES Developer
ZSNES Developer
Posts: 812
Joined: Tue Aug 17, 2004 5:24 am
Location: In your garden

Post by pagefault »

We do not have any kind of QA that goes into the code that goes into the WIP builds.

They are simply a snapshot of CVS so any features that aren't complete and or bugs that may be present are there. If you are not comfortable with this then use a stable version instead.We have a message we added to the WIP to remind the people of this. Ipher does this as a service for people, not as a requirement.
blargg
Regular
Posts: 327
Joined: Thu Jun 30, 2005 1:54 pm
Location: USA
Contact:

Post by blargg »

Wow, I connected the computer's composite video out to a TV and it's really close to a NES (my NES NTSC filter is very similar to the SNES version). The NTSC filter to normal palette-based filter is imporant for reproducing the shimmering artifacts when scrolling. I had figured it wouldn't help much when using composite video. The main problem is that my computer's composite video out uses interlace, and a more minor problem is the dot crawl. Using the non-interlace mode of Ultimarc's Arcade VGA video card mentioned a few messages ago with a TV would probably get very close to matching a NES. Even with my setup the image is so nice that I'm considering finding a place for a TV somewhere near the desk.
Verdauga Greeneyes
Regular
Posts: 347
Joined: Tue Mar 07, 2006 10:32 am
Location: The Netherlands

Post by Verdauga Greeneyes »

Blargg, do you currently have plans for a PAL filter (that would also work on 60 Hz), given that you can gather enough information? I'm sure all us PAL people would really appreciate that. (I know I would!)
Post Reply